Change categories, tags from pills to text

This commit is contained in:
Will Faught
2024-05-28 18:57:00 -07:00
parent 1d09c50d17
commit a1ec679931
2 changed files with 55 additions and 51 deletions

View File

@@ -25,61 +25,63 @@
<p class="lead text-center" id="paige-description">{{ . }}</p>
{{ end }}
{{ if or $categories $tags }}
<p class="text-center" id="paige-keywords">
{{ $terms := slice }}
{{ 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 sort $terms "name" }}
{{ $name := .name }}
{{ with site.GetPage .url }}
{{ $name = .Title }}
{{ end }}
<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .url | safeURL }}">{{ $name }}</a>
{{ end }}
</p>
{{ end }}
{{ if or $authors $date $readingtime $series }}
{{ if or $authors $categories $date $readingtime $series $tags }}
<div class="mb-3">
{{ if or $categories $tags }}
<p class="mb-0 text-center text-secondary" id="paige-keywords">
{{ $terms := slice }}
{{ 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 $i, $term := sort $terms "name" -}}
{{- if gt $i 0 }}, {{ end -}}
{{- $title := $term.name -}}
{{- with (site.GetPage $term.url).Title -}}
{{- $title = . -}}
{{- end -}}
<a class="link-secondary" href="{{ .url | safeURL }}">{{ $title }}</a>
{{- end }}
</p>
{{ end }}
{{ with $series }}
<p class="mb-0 text-center text-secondary" id="paige-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) -}}
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title | default $name }}</a>
{{ else }}
{{ $name }}
{{ end }}
{{ end }}
{{- else -}}
{{- $name -}}
{{- end -}}
{{- end }}
</p>
{{ end }}
{{ with $authors }}
<p class="mb-0 text-center text-secondary" id="paige-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/" .) -}}
<a class="link-secondary" href="{{ .RelPermalink }}">{{ .Title | default $author.name }}</a>
{{ else }}
{{ $author.name }}
{{ end }}
{{ else }}
{{ $author.name }}
{{ end }}
{{ end }}
{{- else -}}
{{- $author.name -}}
{{- end -}}
{{- else -}}
{{- $author.name -}}
{{- end -}}
{{- end }}
</p>
{{ end }}