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