feature: 作者名を表示

This commit is contained in:
Nakaya 2022-11-17 00:18:25 +09:00
parent 196116f20d
commit 6e63590ddd
2 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,7 @@
} }
.article-time, .article-time,
.article-author,
.article-translations { .article-translations {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -48,6 +48,19 @@
</footer> </footer>
{{ end }} {{ end }}
{{ if (isset .Params "author") }}
{{ $filename := .Params.author }}
<div class="article-author">
{{ partial "helper/icon" "user" }}
{{ with (index $.Site.Data.authors $filename) }}
{{ $author := index $.Site.Data.authors $filename }}
{{ with (index $author "name") }}
<a href="/author/{{index $author "id"}}">{{ index $author "name" }}</a>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ if .IsTranslated }} {{ if .IsTranslated }}
<footer class="article-translations"> <footer class="article-translations">
{{ partial "helper/icon" "language" }} {{ partial "helper/icon" "language" }}