From 2545016f8d6b63b0d857fc20fdd7276d2f0fc2a9 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Thu, 12 Oct 2023 23:40:26 -0400 Subject: Layout refinements. add config, disclaimer --- assets/css/main.css | 48 ++++++++---------------------- config.toml | 3 ++ layouts/_default/list.html | 19 ++---------- layouts/_default/summary.html | 18 +++++------ layouts/book/list.html | 54 ++++++++++++++++----------------- layouts/partials/disclaimer.html | 2 ++ layouts/partials/footer.html | 64 ++++++++++++++-------------------------- layouts/post/single.html | 5 +++- 8 files changed, 79 insertions(+), 134 deletions(-) create mode 100644 config.toml create mode 100644 layouts/partials/disclaimer.html diff --git a/assets/css/main.css b/assets/css/main.css index 4574690..c1aae11 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,7 +1,3 @@ -:fullscreen { - color: blue; -} - body { min-height: 100vh; } @@ -10,14 +6,6 @@ body::-webkit-scrollbar { display: none;; } -#content { - width: 65ch; -} - -#content::first-letter { - initial-letter: 2; -} - main { height: inherit; display: flex; @@ -25,10 +13,6 @@ main { justify-content: stretch; } -footer { - background: #00000055; -} - .fixed { position: fixed; top: 0; @@ -66,6 +50,14 @@ footer { flex-direction: row; } +.space-between { + justify-content: space-between; +} + +.align-end { + align-items: flex-end; +} + .centered { align-items: center; justify-content: center; @@ -80,6 +72,10 @@ footer { justify-content: center; } +.flex-end { + justify-content: flex-end; +} + .flex.footer-info { gap: 1rem; } @@ -92,26 +88,6 @@ footer { position:relative; } -.poweredby, -.copyright { - position: absolute; - left: 0; - width: 100%; - padding: 1rem; - text-align: center; -} - -.poweredby { - background: #00000055; - bottom: 0; - padding: .5rem; -} - -.copyright { - background: #00000022; - bottom: 50px; -} - .post { margin-bottom: 1em; } diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..c41540e --- /dev/null +++ b/config.toml @@ -0,0 +1,3 @@ +[params] + _merge = 'deep' + themeVersion = '0.1' diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 065f708..7a26339 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,26 +1,11 @@ {{ define "main" }} -

{{ .Title }}

+

{{ .Title | title }}

{{ if .Content }}

{{ .Content }}

{{ end }}
- {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ range sort .Pages "Date" "desc" }}
{{ .Render "summary" }}
{{ end }} - {{ with .Paginator }} -
-
- {{ if .HasPrev }} - prev - {{ end }} - {{ if (or (.HasPrev) (.HasNext)) }} -

{{ .PageNumber }} of {{ .TotalPages }}

- {{ end }} - {{ if .HasNext }} - next - {{ end }} -
-
- {{ end }}
{{ end }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 4512b16..48c7b97 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,19 +1,17 @@ -
-
-

+
+
+

{{ .Title }} {{ if isset .Params "rating" }} {{ .Params.rating }} {{ end }} -

+

+

{{ .Date | time.Format ":date_full" }}

- {{ .WordCount }} words {{ .ReadingTime }} min read

-

Published: {{ .Date | time.Format ":date_full" }} -

-
{{ .Summary | markdownify }}
-
-
+ +
{{ .Summary | markdownify }}
+ diff --git a/layouts/book/list.html b/layouts/book/list.html index 346a918..d1d1263 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -1,33 +1,31 @@ {{ define "main" }} -
-

{{ .Title }}

- {{ if .Content }} -

{{- .Content -}}

- {{ end }} -
- {{ if .IsSection }} - {{ range sort (.Paginator 3).Pages "Date" "desc" }} - {{ if ne .Layout "list" }} -
{{ .Render "summary" }}
- {{ end }} - {{ end }} - {{ else }} - {{ $metric := .Params.sortby }} - {{ $direction := "asc" }} - {{ if eq .Params.sortby "rating" }} - {{ $direction = "desc" }} - {{ end }} - {{ $pages := (where .Site.RegularPages "Type" "book") }} - {{ $pages = (where $pages "Layout" "!=" "list")}} - {{ if eq $direction "desc" }} - {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} - {{ else }} - {{ $pages = (sort ($pages.ByParam $metric)) }} - {{ end }} - {{ range $pages }} +

{{ .Title }}

+ {{ if .Content }} +

{{- .Content -}}

+ {{ end }} +
+ {{ if .IsSection }} + {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ if ne .Layout "list" }}
{{ .Render "summary" }}
{{ end }} {{ end }} -
-
+ {{ else }} + {{ $metric := .Params.sortby }} + {{ $direction := "asc" }} + {{ if eq .Params.sortby "rating" }} + {{ $direction = "desc" }} + {{ end }} + {{ $pages := (where .Site.RegularPages "Type" "book") }} + {{ $pages = (where $pages "Layout" "!=" "list")}} + {{ if eq $direction "desc" }} + {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} + {{ else }} + {{ $pages = (sort ($pages.ByParam $metric)) }} + {{ end }} + {{ range $pages }} +
{{ .Render "summary" }}
+ {{ end }} + {{ end }} + {{ end }} \ No newline at end of file diff --git a/layouts/partials/disclaimer.html b/layouts/partials/disclaimer.html new file mode 100644 index 0000000..7cac018 --- /dev/null +++ b/layouts/partials/disclaimer.html @@ -0,0 +1,2 @@ +{{ $disclaimer := .Site.GetPage "/disclaimer.md" }} +{{ $disclaimer.Content }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 3800b98..171d3ba 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,55 +1,35 @@ + \ No newline at end of file diff --git a/layouts/post/single.html b/layouts/post/single.html index 166ecd6..25bfc23 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,10 +1,13 @@ {{ define "main" }} + {{ if not .Params.dontDisclaim }} + {{ partial "disclaimer" . }} + {{ end }}

{{ .Title }}

{{ .Date | time.Format ":date_full" }}
+
{{ .Lastmod | time.Format ":date_full" }}
{{- .Content -}}
- {{ end }} -- cgit v1.1