blob: 1ddd06ce64f786bc506c2f1f239056b9ab4dd109 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
{{- /*
This partial is used to get the site author information.
In Hugo v0.124.0, the site.Author variable was deprecated. Instead, it is recommended to use
the "author" parameters in the site configuration file.
This partial checks for the presence of author information in both site.Author and site.Params.author.
If both are present, preference is given to site.Params.author.
The result is stored in the $siteAuthor variable and returned by the partial.
Usage:
{{ $siteAuthor := partial "site-author.html" . }}
{{ with $siteAuthor.name }} {{ . }} {{ end }}
{{ with $siteAuthor.email }} {{ . }} {{ end }}
{{ with $siteAuthor.github }} {{ . }} {{ end }}
{{ with $siteAuthor.twitter }} {{ . }} {{ end }}
{{ with $siteAuthor.location }} {{ . }} {{ end }}
For more information, see: https://github.com/gohugoio/hugo/releases/tag/v0.124.0
*/ -}}
{{- $siteAuthor := dict "name" "" "email" "" "github" "" "twitter" "" "location" "" -}}
{{- if site.Params.author -}}
{{- $siteAuthor = merge $siteAuthor site.Params.author -}}
{{- else if site.Author -}}
{{- $siteAuthor = merge $siteAuthor site.Author -}}
{{- end -}}
{{- return $siteAuthor -}}
|