WIP: blog: expose tags more regularly to encourage use for searching for content

This commit is contained in:
Benjamin A. Petersen 2023-08-15 15:21:44 -04:00
parent 2891da25f5
commit 02fbce8f27
No known key found for this signature in database
GPG Key ID: EF6EF83523A4BE46
3 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,7 @@
<h2>{{ .Title }}</h2>
{{ partial "authors" .}}
<p class="date">{{ dateFormat "Jan 2, 2006" .Date }}</p>
{{ partial "tags-list" . }}
{{ .Content }}
</div>
{{ $related := (where (.Site.RegularPages.Related .) "Type" "posts") | first 3 }}

View File

@ -6,5 +6,6 @@
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<time>{{ .Date.Format "January 2, 2006" }}</time>
<p>{{ .Params.Excerpt }}</p>
{{ partial "tags-list" . }}
</div>
</div>

View File

@ -0,0 +1,10 @@
<p style="background-color: #eee; padding-left: 5px; padding-right: 5px">
{{ $tagsCount := .Params.Tags | len }}
{{ $commaCount := sub $tagsCount 2 }}
{{ range $i, $tag := .Params.Tags }}
<span>
<a style="font-size: 10px"
href="{{ "/tags/" | relLangURL }}{{ $tag | urlize }}">{{ . }}</a>{{ if le $i $commaCount }},{{ end }}
</span>
{{ end }}
</p>