Last active
September 28, 2017 20:09
-
-
Save eddturtle/7c0a5f8c1d23c104ac6eac9db3732889 to your computer and use it in GitHub Desktop.
Hugo ld+json example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{{ if .IsPage }}{ | |
"@context": "http://schema.org", | |
"@type": "BlogPosting", | |
"headline": "{{ .Title }}", | |
"genre": "{{ range .Params.categories }}{{ . }}{{ end }}", | |
"url": "{{ .Permalink }}", | |
"datePublished": "{{ (time .Date).Format "2006-01-02T15:04:05-0700" | safeHTML }}", | |
"description": "{{ .Summary }}", | |
"author": { | |
"@type": "Person", | |
"name": "{{ .Site.Params.author }}" | |
} | |
}{{ else }}{ | |
"@context": "http://schema.org", | |
"@type": "WebSite", | |
"url": "{{ .Permalink }}", | |
"name": "{{ .Site.Title }}", | |
"author": { | |
"@type": "Person", | |
"name": "{{ .Site.Params.author }}" | |
}, | |
"description": "{{ .Site.Params.description }}", | |
}{{ end }} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment