summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-10-25 12:49:58 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-10-25 12:49:58 +0530
commit44bc299ca3b21600d2ed1bd01e83ca2ab83bc7ca (patch)
treee6174c8fc40b2e327c7516edfdca1c0c354baec9 /layouts
parent5b9eaac1306044922f0a9ec3806a786a0cdd036f (diff)
json-schema: add support for multiple authors
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/templates/schema_json.html19
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 }}