cleanup and variablization

This commit is contained in:
Luke Smith
2022-06-28 19:06:38 -04:00
parent f729985265
commit d3a6b31e4a
8 changed files with 40 additions and 55 deletions

View File

@@ -1,17 +1,20 @@
{{ if isset .Params "tags" }}
{{ $tagsLen := len .Params.tags }}
{{ if gt $tagsLen 0 }}
{{- if isset .Params "tags" -}}
{{- $tagsLen := len .Params.tags -}}
{{- if gt $tagsLen 0 -}}
<div class=taglist>
See related:<br>
{{ range $k, $v := .Params.tags }}
{{ $url := printf "tags/%s" (. | urlize | lower) }}
<a href="{{ $url | absURL }}">{{ . | title }}</a>
{{ if lt $k (sub $tagsLen 1) }}&middot;{{ end }}
{{ end }}
{{ with .Site.Params.relatedtext }}{{ . }}<br>{{ end }}
{{- range $k, $v := .Params.tags -}}
{{- $url := printf "tags/%s" (. | urlize | lower) -}}
<a id="tag_{{ . }}" href="{{ $url | absURL }}">{{ . | title }}</a>
{{- if lt $k (sub $tagsLen 1) }}&middot;{{ end -}}
{{- end -}}
</div>
{{ end }}
{{ end }}
</main>
<footer><a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a></footer>
{{- end -}}
{{- end -}}
</main>
<footer>
<a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a></br>
<a href="/index.xml"><img src="/pix/rss.svg" style="max-height:.9em;display:inline" alt=""> Subscribe via RSS for Updates.</a></footer>
</footer>
</body>
</html>