Merge pull request #1 from crowd4u/create-author-elem

feature: 作者名を表示
This commit is contained in:
Nakaya 2022-11-23 15:44:43 +09:00 committed by GitHub
commit e1efb10181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

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

View File

@ -48,6 +48,19 @@
</footer>
{{ 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 }}
<footer class="article-translations">
{{ partial "helper/icon" "language" }}