From a1ec679931c8bc6256ce1c2f89e7605a49499e36 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Tue, 28 May 2024 18:57:00 -0700 Subject: [PATCH] Change categories, tags from pills to text --- layouts/partials/paige/metadata.html | 76 ++++++++++++++-------------- layouts/partials/paige/page.html | 18 ++++--- 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index 4fa4f5b7..5183f4ba 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -25,61 +25,63 @@

{{ . }}

{{ end }} - {{ if or $categories $tags }} -

- {{ $terms := slice }} + {{ if or $authors $categories $date $readingtime $series $tags }} +

+ {{ if or $categories $tags }} +

+ {{ $terms := slice }} - {{ range $categories }} - {{ $terms = $terms | append (dict "name" . "url" (printf "categories/%v/" . | relLangURL | string)) }} - {{ end }} + {{ range $categories }} + {{ $terms = $terms | append (dict "name" . "url" (printf "categories/%v/" . | relLangURL | string)) }} + {{ end }} - {{ range $tags }} - {{ $terms = $terms | append (dict "name" . "url" (printf "tags/%v/" . | relLangURL | string)) }} - {{ end }} + {{ range $tags }} + {{ $terms = $terms | append (dict "name" . "url" (printf "tags/%v/" . | relLangURL | string)) }} + {{ end }} + + {{ range $i, $term := sort $terms "name" -}} + {{- if gt $i 0 }}, {{ end -}} - {{ range sort $terms "name" }} - {{ $name := .name }} + {{- $title := $term.name -}} - {{ with site.GetPage .url }} - {{ $name = .Title }} - {{ end }} + {{- with (site.GetPage $term.url).Title -}} + {{- $title = . -}} + {{- end -}} - {{ $name }} + {{ $title }} + {{- end }} +

{{ end }} -

- {{ end }} - {{ if or $authors $date $readingtime $series }} -
{{ with $series }}

- {{ range $i, $name := . }} - {{ if gt $i 0 }}, {{ end }} + {{ range $i, $name := . -}} + {{- if gt $i 0 }}, {{ end -}} - {{ with site.GetPage (print "series/" $name) }} + {{- with site.GetPage (print "series/" $name) -}} {{ .Title | default $name }} - {{ else }} - {{ $name }} - {{ end }} - {{ end }} + {{- else -}} + {{- $name -}} + {{- end -}} + {{- end }}

{{ end }} {{ with $authors }}

- {{ range $i, $author := . }} - {{ if gt $i 0 }}, {{ end }} + {{ range $i, $author := . -}} + {{- if gt $i 0 }}, {{ end -}} - {{ with $author.id }} - {{ with site.GetPage (print "authors/" .) }} + {{- with $author.id -}} + {{- with site.GetPage (print "authors/" .) -}} {{ .Title | default $author.name }} - {{ else }} - {{ $author.name }} - {{ end }} - {{ else }} - {{ $author.name }} - {{ end }} - {{ end }} + {{- else -}} + {{- $author.name -}} + {{- end -}} + {{- else -}} + {{- $author.name -}} + {{- end -}} + {{- end }}

{{ end }} diff --git a/layouts/partials/paige/page.html b/layouts/partials/paige/page.html index 5a6765e8..9d8ba4d7 100644 --- a/layouts/partials/paige/page.html +++ b/layouts/partials/paige/page.html @@ -60,7 +60,7 @@ {{ end }} {{ if or $categories $tags }} -

+

{{ $terms := slice }} {{ range $categories }} @@ -71,15 +71,17 @@ {{ $terms = $terms | append (dict "name" . "url" (printf "tags/%v/" . | relLangURL | string)) }} {{ end }} - {{ range sort $terms "name" }} - {{ $name := .name }} + {{ range $i, $term := sort $terms "name" -}} + {{- if gt $i 0 }}, {{ end -}} - {{ with site.GetPage .url }} - {{ $name = .Title }} - {{ end }} + {{- $title := $term.name -}} - {{ $name }} - {{ end }} + {{- with (site.GetPage $term.url).Title -}} + {{- $title = . -}} + {{- end -}} + + {{ $title }} + {{- end }}

{{ end }}