Add keyword_style config

master
Will Faught 1 year ago
parent 08642dacc2
commit 36ee22527c

@ -176,6 +176,7 @@ There is a single parameter object with sensible defaults that can be overridden
color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows
color_scheme = "auto" # Must be "auto", "dark", or "light" color_scheme = "auto" # Must be "auto", "dark", or "light"
external_link_new_tab = false # Open external links in new tabs external_link_new_tab = false # Open external links in new tabs
keyword_style = "text" # Must be "text" or "pills"
math = false # Enable math typesetting math = false # Enable math typesetting
site_title = "" # Appears above the menu, above the site description, if set site_title = "" # Appears above the menu, above the site description, if set
site_description = "" # Appears above the menu, below the site title, if set site_description = "" # Appears above the menu, below the site title, if set

@ -10,6 +10,7 @@
{{ $readingtime := $page.ReadingTime }} {{ $readingtime := $page.ReadingTime }}
{{ $series := $page.GetTerms "series" }} {{ $series := $page.GetTerms "series" }}
{{ $tags := $page.GetTerms "tags" }} {{ $tags := $page.GetTerms "tags" }}
{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify }} {{ $title := $page.Title | markdownify }}
{{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }} {{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }}
@ -28,11 +29,17 @@
{{ if or $authors $categories $date $readingtime $series $tags }} {{ if or $authors $categories $date $readingtime $series $tags }}
<div class="mb-3"> <div class="mb-3">
{{ if or $categories $tags }} {{ 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" -}} {{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}}
{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 }} {{- end }}
</p> </p>
{{ end }} {{ end }}

@ -16,6 +16,7 @@
{{ $series := $page.GetTerms "series" }} {{ $series := $page.GetTerms "series" }}
{{ $summary := $page.Summary | markdownify | plainify | htmlUnescape }} {{ $summary := $page.Summary | markdownify | plainify | htmlUnescape }}
{{ $tags := $page.GetTerms "tags" }} {{ $tags := $page.GetTerms "tags" }}
{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
{{ $title := $page.Title | markdownify | plainify | htmlUnescape }} {{ $title := $page.Title | markdownify | plainify | htmlUnescape }}
{{ $titlelink := $page.RelPermalink }} {{ $titlelink := $page.RelPermalink }}
@ -62,9 +63,15 @@
{{ if or $categories $tags }} {{ if or $categories $tags }}
<p class="mb-0 paige-keywords text-center text-secondary"> <p class="mb-0 paige-keywords text-center text-secondary">
{{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}} {{ range $i, $term := sort (append $categories $tags) "LinkTitle" -}}
{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}} {{- 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 }} {{- end }}
</p> </p>
{{ end }} {{ end }}

Loading…
Cancel
Save