Overhaul the look of tags; integrate a category and a cute little triangle

This commit is contained in:
Eryn Wells 2022-10-14 14:30:35 -07:00
parent bb4b2cd4e9
commit d5f9f2a765
3 changed files with 65 additions and 21 deletions

View file

@ -14,11 +14,25 @@
</section>
<footer>
{{- if .Params.tags -}}
{{- if or .Params.categories .Params.tags -}}
<ul class="tags">
{{- range (.GetTerms "tags") -}}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- if .Params.categories -}}
{{- $categories := .GetTerms "categories" -}}
{{- if gt (len $categories) 1 -}}
{{- errorf "More than one category for %q" .Path -}}
{{- end -}}
{{- with index (.GetTerms "categories") 0 -}}
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
{{- if and .Params.categories .Params.tags -}}
<li class="chevron noselect"></li>
{{- end -}}
{{- if .Params.tags -}}
{{- range .GetTerms "tags" -}}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}