diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-25 12:49:58 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-25 12:49:58 +0530 |
| commit | 44bc299ca3b21600d2ed1bd01e83ca2ab83bc7ca (patch) | |
| tree | e6174c8fc40b2e327c7516edfdca1c0c354baec9 /layouts/partials/templates/schema_json.html | |
| parent | 5b9eaac1306044922f0a9ec3806a786a0cdd036f (diff) | |
json-schema: add support for multiple authors
Diffstat (limited to 'layouts/partials/templates/schema_json.html')
| -rw-r--r-- | layouts/partials/templates/schema_json.html | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/layouts/partials/templates/schema_json.html b/layouts/partials/templates/schema_json.html index a186603..ff84c97 100644 --- a/layouts/partials/templates/schema_json.html +++ b/layouts/partials/templates/schema_json.html @@ -41,13 +41,26 @@ {{- else -}} {{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}, {{- end}} - {{- end}} + {{- end -}} "datePublished": {{ .PublishDate }}, "dateModified": {{ .Lastmod }}, - "author": { + {{- with (.Params.author | default .Site.Params.author) }} + "author": + {{- if (eq (printf "%T" .) "[]string") -}} + [{{- range $i, $v := . -}} + {{- if $i }}, {{end -}} + { "@type": "Person", - "name": {{ .Params.author | default .Site.Params.author }} + "name": {{ $v }} + } + {{- end }}], + {{- else -}} + { + "@type": "Person", + "name": {{ . }} }, + {{- end -}} + {{- end }} "mainEntityOfPage": { "@type": "WebPage", "@id": {{ .Permalink | safeHTML }} |
