Add keyword_style config

This commit is contained in:
Will Faught
2024-05-30 21:38:21 -07:00
parent 08642dacc2
commit 36ee22527c
3 changed files with 20 additions and 5 deletions

View File

@@ -10,6 +10,7 @@
{{ $readingtime := $page.ReadingTime }}
{{ $series := $page.GetTerms "series" }}
{{ $tags := $page.GetTerms "tags" }}
{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify }}
{{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }}
@@ -28,11 +29,17 @@
{{ 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">
<p class="{{ if $textkeywords }} mb-0 {{ end }} text-center {{ if $textkeywords }} text-secondary {{ end }}" id="paige-keywords">
{{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}}
{{- if gt $i 0 }} · {{ end -}}
{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}}
<a class="link-secondary" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="link-secondary" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- else -}}
{{- if gt $i 0 }} {{ end -}}
<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- end -}}
{{- end }}
</p>
{{ end }}