feat: add app code

- journal domain package
- httpserver package
- html templates
- main.go in root dir
This commit is contained in:
Vojtěch Mareš 2025-04-22 22:01:53 +02:00
parent 3cc4d28aac
commit 943922a6e1
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
20 changed files with 1032 additions and 0 deletions

29
templates/entries.html Normal file
View file

@ -0,0 +1,29 @@
{{ template "layout.html" . }}
{{ define "title" }}Home{{ end }}
{{ define "content" }}
<style>
.disabled {
color: #aaa !important;
pointer-events: none;
}
</style>
<main class="container">
<h1>Journal entries</h1>
<hr />
<ul>
<!-- Entry title [date | YYYY-MM-DD] -->
{{ range .Entries }} <!-- begin range -->
<li>
<a href="/entry/{{ .ID }}">{{ .Title }}&nbsp[{{ .FormattedDate }}]</a>
</li>
{{ end }} <!-- end range -->
</ul>
<hr />
<p>
[<a href="/?offset={{ .Pagination.Prev }}" class="{{ if eq .Pagination.Prev 0 }}disabled{{ end }}">prev</a>]
[<a href="/?offset={{ .Pagination.Next }}" class="{{ if eq .Pagination.Next 0 }}disabled{{ end }}">next</a>]
</p>
</main>
{{ end }}