Improve the JSON-LD output and add it to sections and front page as well.
This commit is contained in:
parent
b72dca040b
commit
f25ad69da2
1 changed files with 40 additions and 3 deletions
26
layouts/partials/section_json_ld.html
Executable file
26
layouts/partials/section_json_ld.html
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url" : "{{ .Permalink }}",
|
||||
"name": {{ .Title | jsonify }},
|
||||
"description": {{ $.Param "description" | jsonify }},
|
||||
{{ with $.Param "image" -}}
|
||||
"image" : "{{ . | absURL }}",
|
||||
{{ end -}}
|
||||
{{ with $.Param "author" -}}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": {{ . | jsonify }}
|
||||
},
|
||||
{{ end -}}
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Site.BaseURL }}"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": {{ .Site.Title | jsonify }},
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in a new issue