Skip to content

Commit

Permalink
feat(jsonld): add publisher to article metadata
Browse files Browse the repository at this point in the history
Forms part of the transition from Microdata to JSON-LD.

Close academicpages#413
  • Loading branch information
gcushen committed Sep 11, 2019
1 parent c163931 commit 874a013
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions layouts/partials/jsonld/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
{{ $author = .Params.name | default .Title }}
{{ end }}

{{ $publisher := site.Params.org_name | default site.Title }}
{{ $logo_url := printf "img/%s" (site.Params.logo | default "icon-512.png") | absURL }}

<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand All @@ -44,6 +47,14 @@
"name": {{.}}
},
{{end}}
"publisher": {
"@type": "Organization",
"name": {{$publisher}},
"logo": {
"@type": "ImageObject",
"url": {{$logo_url}}
}
},
"description": {{$summary}}
}
</script>

0 comments on commit 874a013

Please sign in to comment.