From 59b4fc0d0e761238f51f27658d116b90c0abb528 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Sat, 13 May 2023 23:14:24 -0400 Subject: tweak index page --- layouts/_default/summary.html | 6 ++++-- layouts/index.html | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index afd5f2b..6ae4fd0 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,13 +1,15 @@
- {{with .CurrentSection.Title }}{{ . }}{{end}}

{{ .Title }}

+

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

- {{ .Summary }} + {{ .Summary | markdownify }}
diff --git a/layouts/index.html b/layouts/index.html index 51f6625..16138b4 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,8 +1,13 @@ {{ define "main" }}
+
+ {{- .Content -}} +
{{ with .Site.GetPage "post" }} {{ range .Pages }} -

{{ .Title }}

+
+

{{ .Render "summary" }}

+
{{ end }} {{ end }}
-- cgit v1.1 From 6416a7cb1adb60c7dd142abb0204f3751ab36a1f Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Sun, 14 May 2023 17:57:10 -0400 Subject: tweak css, layouts, add new archetype --- layouts/_default/list.html | 24 ++++++++++++------------ layouts/_default/single.html | 13 ++++++++++--- layouts/book/single.html | 26 ++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 layouts/book/single.html (limited to 'layouts') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 5d1370f..cf36155 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,12 +1,12 @@ -{{ define "main" }} -
-
{{- .Content -}}
-
- {{ range .Paginator.Pages }} -
- {{ .Render "summary" }} -
- {{ end }} -
-
-{{ end }} +{{ define "main" }} +
+
{{- .Content -}}
+
+ {{ range .Paginator.Pages }} +
+ {{ .Render "summary" }} +
+ {{ end }} +
+
+{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3e48693..306df48 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,4 +1,11 @@ -{{ define "main" }} -

{{ .Title }}

- {{- .Content -}} +{{ define "main" }} +
+
+

{{ .Title }}

+
{{ .Date | time.Format ":date_full" }}
+
+
+ {{- .Content -}} +
+
{{ end }} \ No newline at end of file diff --git a/layouts/book/single.html b/layouts/book/single.html new file mode 100644 index 0000000..3ffb236 --- /dev/null +++ b/layouts/book/single.html @@ -0,0 +1,26 @@ +{{ define "main" }} +
+

{{ .Title }}

+

{{ .Params.author }}

+
{{ .Date | time.Format ":date_full" }}
+ {{ if isset .Params "image" }} + Book cover of the book {{ .Title }} + {{ end }} + {{ if isset .Params "amazon" }} +

+ amazon +

+ {{ end }} +
+

Rating:

+ {{ if isset .Params "rating" }} + {{ $rating := .Params.rating }} + {{ range $i, $num := (seq $rating) }} + ⭐ + {{ end }} + {{ else }} +

N/A

+ {{ end }} +
+
+{{ end }} \ No newline at end of file -- cgit v1.1 From e19ebe26ecd117a77c8fdda2e7667fca42160e1d Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Tue, 26 Sep 2023 22:06:05 -0400 Subject: stuff --- layouts/partials/footer.html | 47 ++++++++++++++++++++++++++++++++++++++++++++ layouts/partials/social.html | 16 +++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 layouts/partials/social.html (limited to 'layouts') diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index eb1e7e7..d60e941 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,52 @@

{{ .Site.Title }}

+
+
+
+

Contact Info

+

Phone: {{ .Site.Params.phone }}

+

Email: {{ .Site.Params.email }}

+
+
+

Connect

+
    + {{ range $key, $value := .Site.Social }} +
  • + {{ partial "social.html" (dict "social" $key "username" $value) }} +
  • + {{ end }} +
+
+
+ {{ with .Site.Params.friends }} +
+

Friends

+ +
+ {{ end }} +
+

Navigation

+
    + {{ range .Site.Menus.main }} +
  • {{ .Name }}
  • + {{ end }} +
+
+
+
+
\ No newline at end of file diff --git a/layouts/partials/social.html b/layouts/partials/social.html new file mode 100644 index 0000000..03645ad --- /dev/null +++ b/layouts/partials/social.html @@ -0,0 +1,16 @@ +{{ $social := .social }} +{{ $username := .username }} + +{{ $url := "" }} + +{{ if eq $social "github" }} + {{ $url = printf "https://github.com/%s" $username }} +{{ else if eq $social "linkedin" }} + {{ $url = printf "https://www.linkedin.com/in/%s" $username }} +{{ else }} + {{ $url = "#" }} +{{ end }} + + + {{ title $social }} + \ No newline at end of file -- cgit v1.1 From f7ccee9be8569eb2efc2319554e49757f550c77f Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Tue, 26 Sep 2023 23:26:39 -0400 Subject: update archetypes --- layouts/_default/single.html | 1 - layouts/post/single.html | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 layouts/post/single.html (limited to 'layouts') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 306df48..db0c449 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,6 @@

{{ .Title }}

-
{{ .Date | time.Format ":date_full" }}
{{- .Content -}} diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..306df48 --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
{{ .Date | time.Format ":date_full" }}
+
+
+ {{- .Content -}} +
+
+{{ end }} \ No newline at end of file -- cgit v1.1 From b179606dac7cf36c490512146ad8ce898f7800b2 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Wed, 27 Sep 2023 21:50:42 -0400 Subject: theme tweaks --- layouts/_default/list.html | 19 +++++++++++++++---- layouts/_default/single.html | 4 ++-- layouts/_default/summary.html | 2 +- layouts/partials/head.html | 2 +- layouts/post/single.html | 16 ++++++++-------- 5 files changed, 27 insertions(+), 16 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index cf36155..a86ef3a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,10 +1,21 @@ {{ define "main" }}
-
{{- .Content -}}
+

{{ .Title }}

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

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

+ {{ if .HasNext }} + next + {{ end }} +
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index db0c449..1564845 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,10 +1,10 @@ {{ define "main" }}
-

{{ .Title }}

+

{{- .Title -}}

{{- .Content -}}
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 6ae4fd0..0753995 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,4 +1,4 @@ -
+

diff --git a/layouts/partials/head.html b/layouts/partials/head.html index dbc55b1..d7b2381 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,4 +9,4 @@ {{- template "_internal/opengraph.html" . -}} {{- template "_internal/schema.html" . -}} {{- template "_internal/twitter_cards.html" . -}} - \ No newline at end of file + diff --git a/layouts/post/single.html b/layouts/post/single.html index 306df48..432b9df 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,11 +1,11 @@ {{ define "main" }} -
-
+
+

{{ .Title }}

{{ .Date | time.Format ":date_full" }}
-
-
- {{- .Content -}} -
-
-{{ end }} \ No newline at end of file +
+
+ {{- .Content -}} +
+
+{{ end }} -- cgit v1.1 From 81200fa6a598557f36593c950d7a63c52aa0b22f Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Fri, 29 Sep 2023 00:14:30 -0400 Subject: tweak styles --- layouts/index.html | 9 +-------- layouts/partials/footer.html | 5 ++++- layouts/partials/header.html | 10 +++------- 3 files changed, 8 insertions(+), 16 deletions(-) (limited to 'layouts') diff --git a/layouts/index.html b/layouts/index.html index 16138b4..2f86fca 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,12 +3,5 @@
{{- .Content -}}
- {{ with .Site.GetPage "post" }} - {{ range .Pages }} -
-

{{ .Render "summary" }}

-
- {{ end }} - {{ end }}

-{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d60e941..3800b98 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -47,6 +47,9 @@
+
+ Powered by Hugo & Blackbear +
- \ No newline at end of file + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4a9ae70..28d3734 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,13 +1,9 @@
    {{ range .Site.Menus.main }}
  • {{ .Name }}
  • @@ -15,4 +11,4 @@
-
\ No newline at end of file + -- cgit v1.1 From 93a4ba55f2159e69aa1fcdaa1cf87c09e7455017 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Tue, 3 Oct 2023 23:44:31 -0400 Subject: add changelog, assets, new partial --- layouts/404.html | 7 +++++++ layouts/_default/baseof.html | 2 ++ layouts/_default/list.html | 9 +++++++-- layouts/_default/single.html | 2 +- layouts/partials/head.html | 4 ++-- layouts/partials/scripts.html | 4 ++++ layouts/post/single.html | 2 +- layouts/robots.txt | 11 +++++++++++ 8 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/scripts.html create mode 100644 layouts/robots.txt (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html index e69de29..1a739ff 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -0,0 +1,7 @@ +{{ define "main" }} +
+
+

Go Home

+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6ed81b9..bb27232 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,6 +2,7 @@ {{- partial "head.html" . -}} + {{- partial "header.html" . -}}
{{- partial "footer.html" . -}} + {{- partial "scripts.html" . -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index a86ef3a..38ef025 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,9 @@ {{ define "main" }} -
+

{{ .Title }}

+ {{ if .Content }} +

{{ .Content }}

+ {{ end }}
{{ range sort (.Paginator 3).Pages "Date" "desc" }}
{{ .Render "summary" }}
@@ -11,7 +14,9 @@ {{ if .HasPrev }} prev {{ end }} -

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

+ {{ if (or (.HasPrev) (.HasNext)) }} +

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

+ {{ end }} {{ if .HasNext }} next {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1564845..996ad9e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,7 @@

{{- .Title -}}

-
+
{{- .Content -}}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d7b2381..2106ef3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,8 +1,8 @@ {{ .Title }} - {{ with resources.Get "css/pico.min.css" }} + {{ with resources.Get "css/main.css" }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..152c32b --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,4 @@ +{{ $scripts := resources.Match "js/*.js" }} +{{ range $script := $scripts }} + +{{ end }} \ No newline at end of file diff --git a/layouts/post/single.html b/layouts/post/single.html index 432b9df..f2a333e 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -4,7 +4,7 @@

{{ .Title }}

{{ .Date | time.Format ":date_full" }}
-
+
{{- .Content -}}
diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 0000000..45a37d1 --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,11 @@ +User-agent: Googlebot +Allow: / + +User-agent: ChatGPT-User +Disallow: / + +User-agent: GPTBot +Disallow: / + +User-agent: * +Disallow: / \ No newline at end of file -- cgit v1.1 From 4e30ae95eaf52a7f427bdf020d118f40e00ab291 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Mon, 9 Oct 2023 13:41:04 -0400 Subject: add some homemade svg, wpartials, and darkmode --- layouts/_default/baseof.html | 2 +- layouts/partials/func/GetSvg.html | 5 +++++ layouts/partials/head.html | 4 ++-- layouts/partials/scripts.html | 3 ++- layouts/partials/site-actions.html | 12 ++++++++++++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 layouts/partials/func/GetSvg.html create mode 100644 layouts/partials/site-actions.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index bb27232..cceaa25 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,7 +2,7 @@ {{- partial "head.html" . -}} - + {{- partial "site-actions" . -}} {{- partial "header.html" . -}}
{{ .Title }} - + {{ end }} {{ with resources.Get "css/main.css" }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 152c32b..f7c95bd 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,4 +1,5 @@ {{ $scripts := resources.Match "js/*.js" }} {{ range $script := $scripts }} + {{ $script := $script | minify | fingerprint }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/site-actions.html b/layouts/partials/site-actions.html new file mode 100644 index 0000000..b9afa66 --- /dev/null +++ b/layouts/partials/site-actions.html @@ -0,0 +1,12 @@ +
+ + +
\ No newline at end of file -- cgit v1.1 From d0e7f43601e90229b95191a1cdc85039e233b622 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Mon, 9 Oct 2023 21:08:24 -0400 Subject: add icons, refine styles, update layouts --- layouts/_default/list.html | 2 +- layouts/_default/summary.html | 3 +++ layouts/book/list.html | 33 +++++++++++++++++++++++++++++++++ layouts/book/single.html | 15 ++++++++++++++- layouts/partials/site-actions.html | 18 ++++++++++++------ 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 layouts/book/list.html (limited to 'layouts') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 38ef025..c265f91 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,5 +1,5 @@ {{ define "main" }} -
+

{{ .Title }}

{{ if .Content }}

{{ .Content }}

diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 0753995..5e4ac4b 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -4,6 +4,9 @@ {{ .Title }} + {{ if isset .Params "rating" }} + {{ .Params.rating }} + {{ end }}

{{ .Date | time.Format ":date_full" }} diff --git a/layouts/book/list.html b/layouts/book/list.html new file mode 100644 index 0000000..628d8b8 --- /dev/null +++ b/layouts/book/list.html @@ -0,0 +1,33 @@ +{{ 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 }} +
{{ .Render "summary" }}
+ {{ end }} + {{ end }} +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/book/single.html b/layouts/book/single.html index 3ffb236..0bbd265 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -4,7 +4,20 @@

{{ .Params.author }}

{{ .Date | time.Format ":date_full" }}
{{ if isset .Params "image" }} - Book cover of the book {{ .Title }} + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + Book cover of the book {{ .Title }} + {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} {{ end }} {{ if isset .Params "amazon" }}

diff --git a/layouts/partials/site-actions.html b/layouts/partials/site-actions.html index b9afa66..ac9013a 100644 --- a/layouts/partials/site-actions.html +++ b/layouts/partials/site-actions.html @@ -1,12 +1,18 @@

- +
\ No newline at end of file -- cgit v1.1 From 6e6412e4a693ddc2da5e4611363fb882ad6497be Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Thu, 12 Oct 2023 08:08:37 -0400 Subject: Switch to light theme. remove articles. --- layouts/_default/baseof.html | 2 +- layouts/_default/list.html | 44 +++++++++++++------------- layouts/_default/single.html | 15 +++++---- layouts/_default/summary.html | 9 +++--- layouts/book/list.html | 2 +- layouts/book/single.html | 61 ++++++++++++++++++------------------- layouts/index.html | 4 --- layouts/partials/updated_posts.html | 17 +++++++++++ layouts/post/single.html | 5 ++- 9 files changed, 84 insertions(+), 75 deletions(-) create mode 100644 layouts/partials/updated_posts.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cceaa25..acb6c6a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + {{- partial "head.html" . -}} {{- partial "site-actions" . -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c265f91..065f708 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,28 +1,26 @@ {{ define "main" }} -
-

{{ .Title }}

- {{ if .Content }} -

{{ .Content }}

+

{{ .Title }}

+ {{ if .Content }} +

{{ .Content }}

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

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

- {{ end }} - {{ if .HasNext }} - next - {{ end }} -
-
+ {{ if (or (.HasPrev) (.HasNext)) }} +

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

+ {{ end }} + {{ if .HasNext }} + next {{ end }} -
-
+
+
+ {{ end }} + {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 996ad9e..49137fb 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,10 +1,9 @@ {{ define "main" }} -
-
-

{{- .Title -}}

-
-
- {{- .Content -}} -
-
+
+

{{- .Title -}}

+

Some dude on the internet with—like—opinions and stuff

+
+
+ {{- .Content -}} +
{{ end }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 5e4ac4b..4512b16 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -9,10 +9,11 @@ {{ end }}

- {{ .Date | time.Format ":date_full" }} + {{ .WordCount }} words + {{ .ReadingTime }} min read

-
- {{ .Summary | markdownify }} -
+

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

+
{{ .Summary | markdownify }}
diff --git a/layouts/book/list.html b/layouts/book/list.html index 628d8b8..346a918 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -2,7 +2,7 @@

{{ .Title }}

{{ if .Content }} -

{{- .Content -}}

+

{{- .Content -}}

{{ end }}
{{ if .IsSection }} diff --git a/layouts/book/single.html b/layouts/book/single.html index 0bbd265..66456e1 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -1,39 +1,38 @@ {{ define "main" }} -
+

{{ .Title }}

-

{{ .Params.author }}

{{ .Date | time.Format ":date_full" }}
- {{ if isset .Params "image" }} - {{ with resources.GetRemote .Params.image }} - {{ with .Err }} - {{ errorf "%s" . }} - {{ else }} - Book cover of the book {{ .Title }} - {{ end }} +
+ {{ if isset .Params "image" }} + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} {{ else }} - {{ errorf "unable to get remote resource %q" .Params.image }} + Book cover of the book {{ .Title }} {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} + {{ end }} + {{ if isset .Params "amazon" }} +

+ amazon +

+ {{ end }} +
+

Rating:

+ {{ if isset .Params "rating" }} + {{ $rating := .Params.rating }} + {{ range $i, $num := (seq $rating) }} + ⭐ {{ end }} - {{ if isset .Params "amazon" }} -

- amazon -

+ {{ else }} +

N/A

{{ end }} -
-

Rating:

- {{ if isset .Params "rating" }} - {{ $rating := .Params.rating }} - {{ range $i, $num := (seq $rating) }} - ⭐ - {{ end }} - {{ else }} -

N/A

- {{ end }} -
-
+ {{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 2f86fca..7d9bf2a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,3 @@ {{ define "main" }} -
-
{{- .Content -}} -
-
{{ end }} diff --git a/layouts/partials/updated_posts.html b/layouts/partials/updated_posts.html new file mode 100644 index 0000000..7010a5b --- /dev/null +++ b/layouts/partials/updated_posts.html @@ -0,0 +1,17 @@ +{{ $lastBuildTime := time "2021-09-08T12:51:38-0400" }} +{{ $updatedPosts := slice }} + +{{ range .Site.Pages }} + {{ if .Lastmod.After $lastBuildTime }} +
  • {{ .Title }} - {{ .Lastmod }}
  • + {{ end }} +{{ end }} + +

    Updated Posts:

    +
      + {{ range $updatedPosts }} +
    • {{ . }}
    • + {{ end }} +
    + +{{ $currentTime := now.UTC }} diff --git a/layouts/post/single.html b/layouts/post/single.html index f2a333e..166ecd6 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,9 +1,8 @@ {{ define "main" }} -
    -
    +

    {{ .Title }}

    {{ .Date | time.Format ":date_full" }}
    -
    +
    {{- .Content -}}
    -- cgit v1.1 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 --- 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 +++- 6 files changed, 64 insertions(+), 98 deletions(-) create mode 100644 layouts/partials/disclaimer.html (limited to 'layouts') 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 @@
    -

    {{ .Site.Title }}

    -
    -
    -
    -

    Contact Info

    -

    Phone: {{ .Site.Params.phone }}

    -

    Email: {{ .Site.Params.email }}

    -
    -
    +
    +
    +

    {{ .Site.Title | upper }}

    +

    {{ .Site.Params.description }}

    +

    Connect

      {{ range $key, $value := .Site.Social }} -
    • - {{ partial "social.html" (dict "social" $key "username" $value) }} -
    • +
    • + {{ partial "social.html" (dict "social" $key "username" $value) }} +
    • {{ end }}
    -
    -
    - {{ with .Site.Params.friends }} -
    -

    Friends

    +
    + +
    +

    Get Around

    - {{ end }} -
    -

    Navigation

    -
      - {{ range .Site.Menus.main }} -
    • {{ .Name }}
    • - {{ end }} -
    -
    +
    +
    +
    Powered by Hugo & Blackbear (v{{.Site.Params.themeVersion }})
    +
    + v{{.Site.Params.siteVersion}}
    +
    © Copyright {{ now.Format "2006" }} | All Rights Reserved
    +
    -
    - Powered by Hugo & Blackbear -
    - -
    + \ 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 From cf6c17546bc40d41c169279ad7b8f60bf0888ab3 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Fri, 13 Oct 2023 21:26:24 -0400 Subject: new templates, and refinements --- layouts/post/single.html | 11 ++++++++++- layouts/shortcodes/projects.html | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/projects.html (limited to 'layouts') diff --git a/layouts/post/single.html b/layouts/post/single.html index 25bfc23..2c4c23e 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -2,10 +2,19 @@ {{ if not .Params.dontDisclaim }} {{ partial "disclaimer" . }} {{ end }} + {{ with .GetTerms "categories" }} + {{ (index . 0).RelPermalink }} + {{ end }}

    {{ .Title }}

    {{ .Date | time.Format ":date_full" }}
    -
    {{ .Lastmod | time.Format ":date_full" }}
    + {{ with .Params.categories }} +
    + {{ range $value := . }} + {{ $value }} + {{ end }} +
    + {{ end }}
    {{- .Content -}} diff --git a/layouts/shortcodes/projects.html b/layouts/shortcodes/projects.html new file mode 100644 index 0000000..b9cf8b5 --- /dev/null +++ b/layouts/shortcodes/projects.html @@ -0,0 +1,12 @@ +{{ $projects := where .Site.RegularPages "Params.categories" "intersect" (slice "projects") }} + +
      +{{ range $projects }} +
    • + {{ .Title }} + {{ with .Description }} + — {{ . }} + {{ end }} +
    • +{{ end }} +
    \ No newline at end of file -- cgit v1.1 From 6bfd84ae2c7aad006c3bc84cdce9aebf894cbe62 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 20 Oct 2023 22:49:31 -0400 Subject: add summary for books --- layouts/book/list.html | 2 +- layouts/book/single.html | 14 ++++++++------ layouts/book/summary.html | 29 +++++++++++++++++++++++++++++ layouts/partials/header.html | 8 ++++---- layouts/post/single.html | 3 --- 5 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 layouts/book/summary.html (limited to 'layouts') diff --git a/layouts/book/list.html b/layouts/book/list.html index d1d1263..25976dd 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -5,7 +5,7 @@ {{ end }}
    {{ if .IsSection }} - {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ range sort .Pages "Date" "desc" }} {{ if ne .Layout "list" }}
    {{ .Render "summary" }}
    {{ end }} diff --git a/layouts/book/single.html b/layouts/book/single.html index 66456e1..baedf32 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -8,12 +8,14 @@ {{ with .Err }} {{ errorf "%s" . }} {{ else }} - Book cover of the book {{ .Title }} + {{ $image := . }} + {{ $image := $image.Resize "250x" }} + Book cover of the book {{ .Title }} {{ end }} {{ else }} {{ errorf "unable to get remote resource %q" .Params.image }} diff --git a/layouts/book/summary.html b/layouts/book/summary.html new file mode 100644 index 0000000..900fb87 --- /dev/null +++ b/layouts/book/summary.html @@ -0,0 +1,29 @@ +
    + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $image := . }} + {{ $image := $image.Resize "150x" }} + Book cover of the book {{ .Title }} + {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} +
    +

    + + {{ .Title }} + +

    +

    Rating: {{ .Params.rating }} / 5

    + {{ with .Params.last_read }} +

    Last Read: {{ . | time.Format ":date_full" }}

    + {{ end }} +
    +
    diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 28d3734..0137db1 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,9 +1,9 @@
    -