Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvvveiii <cntrump@gmail.com>2020-05-03 14:19:39 +0300
committervvveiii <cntrump@gmail.com>2020-05-03 14:19:39 +0300
commit5f51eabf63a042adadb95b85208dcc13eac2c4e7 (patch)
tree51a25590f7f7bd2a3bcfdeb2c261d7508c368363
parent02e8c066dca3dd35915f472e8c2ff59b72e76c9a (diff)
Support setting author in front matter
-rw-r--r--layouts/partials/article-author.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/partials/article-author.html b/layouts/partials/article-author.html
index 5584927..8564819 100644
--- a/layouts/partials/article-author.html
+++ b/layouts/partials/article-author.html
@@ -1,4 +1,9 @@
-{{- with site.Params.author -}}
+{{- $author := .Params.author -}}
+{{- if not $author -}}
+ {{- $author = site.Params.author -}}
+{{- end -}}
+
+{{- with $author -}}
{{- if .enable -}}
<section class="article author">
{{- with .avatar -}}<img class="avatar" src="{{- . | relURL -}}" alt>{{- end -}}