hugo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit c9145df04fef621e5dd21f5edd3d445b73f6b7e4
parent 16ab71f763977862d10d67d78e8e7eb3ced2d7e5
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon, 11 Jul 2022 11:31:08 -0400

taglist in separate file

Diffstat:
Mlayouts/partials/footer.html | 14+-------------
Alayouts/partials/taglist.html | 13+++++++++++++
Mstatic/style.css | 2++
3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -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> diff --git a/layouts/partials/taglist.html b/layouts/partials/taglist.html @@ -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 }} diff --git a/static/style.css b/static/style.css @@ -26,8 +26,10 @@ header h1 { footer { text-align: center ; + clear: both ; } .taglist { text-align: center ; + clear: both ; }