aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/themes/hugo-xmag/layouts/partials/author.html
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-08-02 13:23:35 +0800
committer简律纯 <i@jyunko.cn>2024-08-02 13:23:35 +0800
commite03422873a1788137f120d9c8f34b2be079f0aee (patch)
treef52775951aed0c594a6b1ca4c9432f3bba74ecac /themes/hugo-xmag/layouts/partials/author.html
parent2b8db24f956ad99305860c2f8f4cd3a331a76dc6 (diff)
downloadjournal-e03422873a1788137f120d9c8f34b2be079f0aee.tar.gz
journal-e03422873a1788137f120d9c8f34b2be079f0aee.zip
docs: build with hugo
Diffstat (limited to 'themes/hugo-xmag/layouts/partials/author.html')
-rw-r--r--themes/hugo-xmag/layouts/partials/author.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/themes/hugo-xmag/layouts/partials/author.html b/themes/hugo-xmag/layouts/partials/author.html
new file mode 100644
index 0000000..c4977ab
--- /dev/null
+++ b/themes/hugo-xmag/layouts/partials/author.html
@@ -0,0 +1,25 @@
+{{ with .Params.author }}
+{{ if eq (substr (jsonify .) 0 1) "["}}
+{{ $.Scratch.Set "page_author" .}}
+{{ else }}
+{{ $.Scratch.Set "page_author" (slice .) }}
+{{ end }}
+
+{{ $.Scratch.Set "author_info" slice }}
+{{ if $.Site.Data.authors }}
+{{ range $.Scratch.Get "page_author" }}
+{{ with (index $.Site.Data.authors .) }}
+{{ $.Scratch.Add "author_info" . }}
+{{ end }}
+{{ end }}
+{{ end }}
+{{ if $.Scratch.Get "author_info" }}
+<section class="article-meta article-footer">
+ <h3>{{ default "About the Author" $.Site.Params.text.about_author }}</h3>
+ {{ range $.Scratch.Get "author_info" }}
+ <p>{{ . | markdownify }}</p>
+ {{ end }}
+</section>
+{{ end }}
+
+{{ end }}