From bc2b82c370be7a5554cd886033b3e3e0d21bdea2 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 25 Oct 2020 12:15:51 +0530 Subject: [PATCH] author(partial): init, with support for multiple authors * usage: author: ["me", "you"] --- layouts/partials/author.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 layouts/partials/author.html diff --git a/layouts/partials/author.html b/layouts/partials/author.html new file mode 100644 index 0000000..f91a116 --- /dev/null +++ b/layouts/partials/author.html @@ -0,0 +1,9 @@ +{{- if or .Params.author .Site.Params.author }} +{{- $author := (.Params.author | default .Site.Params.author)}} +{{- $author_type := (printf "%T" $author) }} +{{- if (eq $author_type "[]string") }} +{{- (delimit $author ", " ) }} +{{- else }} +{{- $author }} +{{- end }} +{{- end -}}