diff options
author | uPagge <upagge@mail.ru> | 2020-12-03 13:19:38 +0300 |
---|---|---|
committer | uPagge <upagge@mail.ru> | 2020-12-03 13:19:38 +0300 |
commit | f647eedb31806ddd523af47302573291f289ceed (patch) | |
tree | 214cb67cdcfbea79941680c3c528ed26ce5d8042 /layouts/_default/summary.html | |
parent | 89a1fe7058ebb16e946a188c8104fdde73645ff6 (diff) |
New approach to the author. Added support of many authors
Diffstat (limited to 'layouts/_default/summary.html')
-rw-r--r-- | layouts/_default/summary.html | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index edd042e..82461eb 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -24,12 +24,15 @@ {{- /* Meta */ -}} <div class="post-meta"> - {{- $author := $params.author | default .Site.Author.name | default (T "author") -}} - {{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}} + {{- $authorName := $params.author | default .Site.Author.name | default " " -}} + {{- if not (eq $authorName " ") -}} + {{ $author := index .Site.Data.authors $authorName }} + {{- $authorLink := $author.link | default .Site.Home.RelPermalink -}} <span class="post-author"> - {{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}} + {{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author.nickname -}} {{- partial "plugin/link.html" $options -}} - </span> + </span> + {{- end -}} {{- with .Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format -}} · <span class="post-publish"><i class="far fa-clock fa-fw"></i> |