Closed matt-dray closed 5 years ago
To hardcode the author name for all posts (and bring the reading time onto the same line), change themes/hugo-lithium-theme/layouts/_default/single.html
to something like this:
{{ partial "header.html" . }}
<main class="content" role="main">
<h1 class="article-title">{{ .Title }}</h1>
{{ if eq .Section "post" }}
<span class="article-date">Matt Dray / {{ .Date.Format "02 Jan 2006" }} / {{ .ReadingTime }} min read</span>
{{ end }}
<div class="article-content">
{{ .Content }}
</div>
</article>
{{ partial "disqus.html" .}}
</main>
{{ partial "footer.html" . }}
Could also be nice to then do .article-date { color: #1e8016; }
in the CSS at themes/hugo-lithium-theme/static/css/main.css
. Results in this:
Aha: {{ .Params.author }}
is what I was after.
Cmd+F 'author' here: https://bookdown.org/yihui/blogdown/templates.html#fnref28
Must be able to add the author YAML metadata to the post automatically. The date gets there; why not author?