diff --git a/hugo.yml b/hugo.yml index 72428d3..66219cc 100644 --- a/hugo.yml +++ b/hugo.yml @@ -5,6 +5,7 @@ theme: PaperMod params: author: 'Robin Freyler' + # authorURL: 'https://github.com/robbepop' homeInfoParams: Title: 'Wasmi - WebAssembly Interpreter' Content: 'News and information about the Wasmi WebAssembly interpreter' diff --git a/layouts/partials/author.html b/layouts/partials/author.html new file mode 100644 index 0000000..394d3c3 --- /dev/null +++ b/layouts/partials/author.html @@ -0,0 +1,20 @@ +{{- if or .Params.author site.Params.author }} + {{- $author := (.Params.author | default site.Params.author) }} + {{- $authorURL := (.Params.authorURL | default site.Params.authorURL) }} + {{- $author_type := (printf "%T" $author) }} + {{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }} + {{- if $authorURL }} + {{- range $index, $element := $author }} + {{ $element }}{{ if ne (add $index 1) (len $author) }}, {{ end }} + {{- end }} + {{- else }} + {{- delimit $author ", " }} + {{- end }} + {{- else }} + {{- if $authorURL }} + {{ $author }} + {{- else }} + {{- $author }} + {{- end }} + {{- end }} +{{- end }}