From ef30578a36d44dd37f85070c0ec6ec6141b44406 Mon Sep 17 00:00:00 2001 From: weru Date: Fri, 17 Nov 2023 10:30:53 +0300 Subject: [PATCH] refactor template --- layouts/partials/authorbox.html | 13 +++++++------ layouts/partials/post_meta/author.html | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/layouts/partials/authorbox.html b/layouts/partials/authorbox.html index 20d6dfe..f965d09 100644 --- a/layouts/partials/authorbox.html +++ b/layouts/partials/authorbox.html @@ -1,23 +1,24 @@ {{- if .Param "authorbox" }} +{{ $author := site.Params.author }}
- {{- if and (not .Site.Author.avatar) (not .Site.Author.name) (not .Site.Author.bio) }} + {{- if and (not $author.avatar) (not $author.name) (not $author.bio) }}

WARNING: Authorbox is activated, but [Author] parameters are not specified.

{{- end }} - {{- with .Site.Author.avatar }} + {{- with $author.avatar }}
- {{ $.Site.Author.name }} avatar + {{ $author.name }} avatar
{{- end }} - {{- with .Site.Author.name }} + {{- with $author.name }}
{{ T "authorbox_name" (dict "Name" .) }}
{{- end }} - {{- with .Site.Author.bio }} + {{- with $author.bio }}
- {{ . | markdownify }} + {{ markdownify . }}
{{- end }}
diff --git a/layouts/partials/post_meta/author.html b/layouts/partials/post_meta/author.html index 0ee0fc9..cd40789 100644 --- a/layouts/partials/post_meta/author.html +++ b/layouts/partials/post_meta/author.html @@ -1,6 +1,7 @@ -{{- if .Site.Author.name -}} +{{ $author := site.Params.author }} +{{- if $author.name -}}
{{ partial "svg/author.svg" (dict "class" "meta__icon") -}} - {{ .Site.Author.name }} + {{ $author.name }}
{{- end -}} \ No newline at end of file