blog: add multiple author support for posts

This commit is contained in:
Benjamin A. Petersen 2023-08-14 13:07:04 -04:00
parent e5e8c13f23
commit 820c565d21
No known key found for this signature in database
GPG Key ID: EF6EF83523A4BE46
4 changed files with 13 additions and 5 deletions

View File

@ -8,7 +8,7 @@ authors:
- Benjamin A. Petersen
image: https://images.unsplash.com/photo-1618075254460-429d47b887c7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2148&q=80
excerpt: "With v0.25.0 you get external certificate management for the impersonation proxy, easier scheduling of the kube-cert-agent, and more"
tags: ['Joshua T. Casey','Ryan Richard', 'Benjamin Petersen', 'release', 'kubernetes', 'pki', 'pinniped', 'tls', 'mtls', 'kind', 'contour', 'cert-manager']
tags: ['Joshua T. Casey','Ryan Richard', 'Benjamin A. Petersen', 'release', 'kubernetes', 'pki', 'pinniped', 'tls', 'mtls', 'kind', 'contour', 'cert-manager']
---
![Friendly seal](https://images.unsplash.com/photo-1618075254460-429d47b887c7?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2148&q=80)

View File

@ -9,9 +9,7 @@
<div class="wrapper blog">
<div class="blog-post">
<h2>{{ .Title }}</h2>
<p class="author">
<a href="/tags/{{ .Params.author | urlize }}">{{ .Params.author }}</a>
</p>
{{ partial "authors" .}}
<p class="date">{{ dateFormat "Jan 2, 2006" .Date }}</p>
{{ .Content }}
</div>

View File

@ -0,0 +1,11 @@
<p class="author">
{{ if (isset .Params "authors") }}
{{ $authsCount := .Params.authors | len }}
{{ $commaCount := sub $authsCount 2 }}
{{ range $i, $author := .Params.authors -}}
<a href="/tags/{{ $author | urlize }}">{{ $author }}</a>{{ if le $i $commaCount }},{{ end }}
{{ end }}
{{ else }}
<a href="/tags/{{ .Params.author | urlize }}">{{ .Params.author }}</a>
{{ end }}
</p>

View File

@ -5,7 +5,6 @@
<div class="content">
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
<time>{{ .Date.Format "January 2, 2006" }}</time>
<p class="no-margin">{{ .Params.author }}</p>
<p>{{ .Params.Excerpt }}</p>
</div>
</div>