Change categories, tags from pills to text

master
Will Faught 1 year ago
parent 1d09c50d17
commit a1ec679931

@ -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 }}
{{ 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 $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 -}}
<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .url | safeURL }}">{{ $name }}</a>
<a class="link-secondary" href="{{ .url | safeURL }}">{{ $title }}</a>
{{- end }}
</p>
{{ end }}
</p>
{{ end }}
{{ if or $authors $date $readingtime $series }}
<div class="mb-3">
{{ 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 }}

@ -60,7 +60,7 @@
{{ end }}
{{ if or $categories $tags }}
<p class="mb-0 paige-keywords text-center">
<p class="mb-0 paige-keywords text-center text-secondary">
{{ $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 -}}
<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .url | safeURL }}">{{ $name }}</a>
{{ end }}
{{- with (site.GetPage $term.url).Title -}}
{{- $title = . -}}
{{- end -}}
<a class="link-secondary" href="{{ .url | safeURL }}">{{ $title }}</a>
{{- end }}
</p>
{{ end }}

Loading…
Cancel
Save