Change inline page authors from strings to maps
This commit is contained in:
@@ -249,8 +249,9 @@ Optional page parameters:
|
||||
|
||||
```yaml
|
||||
authors: [
|
||||
"Michael Bluth", # Credit this name exactly
|
||||
"george_bluth" # Credit the corresponding author name in the site parameters
|
||||
"michael_bluth", # Credit the corresponding author name in the site parameters
|
||||
{"author": "michael_bluth"}, # Credit the corresponding author name in the site parameters
|
||||
{"name": "Lucille Bluth"} # Credit this author name
|
||||
]
|
||||
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
|
||||
paige:
|
||||
|
@@ -2,7 +2,15 @@
|
||||
{{ if .Params.authors }}
|
||||
{{ $names := slice }}
|
||||
{{ range .Params.authors }}
|
||||
{{ $names = $names | append (index site.Params.authors . "name" | default .) }}
|
||||
{{ if eq (printf "%T" .) "string" }}
|
||||
{{ $names = $names | append (index site.Params.authors .).name }}
|
||||
{{ else }}
|
||||
{{ with .author }}
|
||||
{{ $names = $names | append (index site.Params.authors .).name }}
|
||||
{{ else }}
|
||||
{{ $names = $names | append .name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ else if .Site.Params.authors }}
|
||||
|
Reference in New Issue
Block a user