diff --git a/.misc/screenshot1.png b/.misc/screenshot1.png index 3171d5b..388a618 100644 Binary files a/.misc/screenshot1.png and b/.misc/screenshot1.png differ diff --git a/.misc/screenshot2.png b/.misc/screenshot2.png index 5a45b0f..44b8bac 100644 Binary files a/.misc/screenshot2.png and b/.misc/screenshot2.png differ diff --git a/main.go b/main.go index 9d822b8..cc5defc 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ type TemplateData struct { Entry string Title string EntryTitle string + Footer []template.HTML } func loadTemplate() { @@ -41,7 +42,7 @@ func handleApplication(w http.ResponseWriter, req *http.Request) { } err = appTemplate.ExecuteTemplate( w, "app", - TemplateData{TOC: db.Keys, Entry: entry, Title: MainTitle, EntryTitle: entryName}) + TemplateData{TOC: db.Keys, Entry: entry, Title: MainTitle, EntryTitle: entryName, Footer: FooterContent}) if err != nil { logger.Println(err) } } diff --git a/public/index.html b/public/index.html index 731a9dd..ffbcc77 100644 --- a/public/index.html +++ b/public/index.html @@ -19,6 +19,7 @@ {{- else -}}
+

{{ .Title }}

@@ -29,5 +30,6 @@
{{- end}} + diff --git a/public/static/style.css b/public/static/style.css index bc06cbe..4f115a1 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -6,6 +6,7 @@ body { flex-direction: column; align-items: center; width: 100vw; + min-height: 100vh; font-family: sans-serif; } a:hover, a:focus { text-decoration: underline; } @@ -14,6 +15,22 @@ a { text-decoration: none; outline: none; } +footer { + margin-top: auto; + padding: 1rem; + box-sizing: border-box; + display: flex; + justify-content: center; + flex-wrap: wrap; +} +footer > div { + margin: 0 .5rem; +} +footer, footer * { + color: #00000080 !important; + font-size: .9rem; + text-align: center; +} .homebtn { position: absolute; @@ -33,7 +50,8 @@ a { } .main > h1 { font-size: 1.4rem; - margin-bottom: 0; + margin-top: 1.5rem; + margin-bottom: .5rem; text-align: center; } .content { white-space: pre-line; } @@ -44,6 +62,9 @@ a { box-sizing: border-box; gap: 1rem; } +.home-main > h1 { + font-size: 1.6rem; +} .home-main, .toc, #search-results { display: flex; flex-direction: column; @@ -66,6 +87,9 @@ a { @media only screen and (max-width: 750px) { .main { margin-top: 4rem; } + .main > h1 { + margin-top: unset; + } .main > h1, .content { width: 90vw; max-width: unset; diff --git a/settings.go b/settings.go index 3e0b3d2..640521c 100644 --- a/settings.go +++ b/settings.go @@ -1,10 +1,19 @@ package main -import "golang.org/x/text/language" +import ( + "html/template" + + "golang.org/x/text/language" +) const ServerListen = ":7000" + const EntriesDirectory = "./entries" const TemplateFile = "./public/index.html" const StaticDirectory = "./public/static" -const MainTitle = "Encyclopedia" var ContentLanguage = language.English + +const MainTitle = "Encyclopedia" +var FooterContent = []template.HTML{ + template.HTML("powered by plaintext-encyclopedia"), +}