taglist in separate file

This commit is contained in:
Luke Smith 2022-07-11 11:31:08 -04:00
parent 16ab71f763
commit c9145df04f
3 changed files with 16 additions and 13 deletions

View File

@ -1,16 +1,4 @@
{{- if isset .Params "tags" -}}
{{- $tagsLen := len .Params.tags -}}
{{- if gt $tagsLen 0 -}}
<div class=taglist>
{{- with .Site.Params.relatedtext }}{{ . }}<br>{{ end -}}
{{- range $k, $v := .Params.tags -}}
{{- $url := printf "tags/%s" (. | urlize | lower) -}}
<a id="tag_{{ . | lower }}" href="{{ $url | absURL }}">{{ . | title }}</a>
{{- if lt $k (sub $tagsLen 1) }} &middot; {{ end -}}
{{- end -}}
</div>
{{- end -}}
{{- end }}
{{ partial "taglist.html" . }}
</main>
<footer>
<a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a><br><br>

View File

@ -0,0 +1,13 @@
{{- if isset .Params "tags" -}}
{{- $tagsLen := len .Params.tags -}}
{{- if gt $tagsLen 0 -}}
<div style="clear:both" class=taglist>
{{- with .Site.Params.relatedtext }}{{ . }}<br>{{ end -}}
{{- range $k, $v := .Params.tags -}}
{{- $url := printf "tags/%s" (. | urlize | lower) -}}
<a id="tag_{{ . | lower }}" href="{{ $url | absURL }}">{{ . | title }}</a>
{{- if lt $k (sub $tagsLen 1) }} &middot; {{ end -}}
{{- end -}}
</div>
{{- end -}}
{{- end }}

View File

@ -26,8 +26,10 @@ header h1 {
footer {
text-align: center ;
clear: both ;
}
.taglist {
text-align: center ;
clear: both ;
}