Merge pull request #169 from myml/authors

feat: Support to show the authors of the article
This commit is contained in:
Dmitry Kolosov 2023-04-24 20:17:05 +02:00 committed by GitHub
commit b53b8dea2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 8 deletions

View file

@ -20,14 +20,22 @@
<li><a href="{{ $cat.Permalink }}">{{ $cat.Title | default $cat_name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ if .Params.tags }}
<ul class="post-tags">
{{ range $tag_name := .Params.tags }}
{{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name)) }}
<li><a href="{{ $tag.Permalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ if .Params.tags }}
<ul class="post-tags">
{{ range $tag_name := .Params.tags }}
{{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name)) }}
<li><a href="{{ $tag.Permalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ if .Params.authors }}
<ul class="post-authors">
{{ range $author_name := .Params.authors }}
{{ $author := ($.Site.GetPage (printf "/authors/%s" $author_name)) }}
<li><a href="{{ $author.Permalink }}">@{{ $author_name }}</a></li>
{{ end }}
</ul>
{{ end }}
</div>
</div>