Add authors taxonomy
parent
a66f33962c
commit
062c45579d
@ -0,0 +1,4 @@
|
||||
---
|
||||
description: "Demonstration of an author."
|
||||
title: "Will Faught"
|
||||
---
|
@ -1,33 +1,32 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $result := "" }}
|
||||
{{ $result := slice }}
|
||||
|
||||
{{ if $page.Params.authors }}
|
||||
{{ $names := slice }}
|
||||
|
||||
{{ range $page.Params.authors }}
|
||||
{{ if eq (printf "%T" .) "string" }}
|
||||
{{ $names = $names | append (index site.Params.authors .).name }}
|
||||
{{ else }}
|
||||
{{ $id := "" }}
|
||||
{{ $name := "" }}
|
||||
|
||||
{{ if reflect.IsMap . }}
|
||||
{{ with .author }}
|
||||
{{ $names = $names | append (index site.Params.authors .).name }}
|
||||
{{ $id = . }}
|
||||
{{ $name = (index site.Params.authors .).name }}
|
||||
{{ else }}
|
||||
{{ $names = $names | append .name }}
|
||||
{{ $name = .name }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $id = . }}
|
||||
{{ $name = (index site.Params.authors .).name }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ $result = $result | append (dict "id" $id "name" $name) }}
|
||||
{{ end }}
|
||||
{{ else if site.Params.authors }}
|
||||
{{ $names := slice }}
|
||||
|
||||
{{ range $k, $v := site.Params.authors }}
|
||||
{{ if eq $v.default true }}
|
||||
{{ $names = $names | append $v.name }}
|
||||
{{ $result = $result | append (dict "id" $k "name" $v.name) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $result = delimit $names ", " }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $result }}
|
||||
|
Loading…
Reference in New Issue