mirror of https://github.com/jpanther/congo.git
🔍 Add more detail to JSON-LD structured data
parent
ad495ca9ef
commit
ace158ed42
|
@ -19,12 +19,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Upgrade to Tailwind v3.0.13
|
- Upgrade to Tailwind v3.0.15
|
||||||
- Upgrade to KaTeX v0.15.2
|
- Upgrade to KaTeX v0.15.2
|
||||||
- Inline Javascript moved to external files
|
- Inline Javascript moved to external files
|
||||||
- Author images are now Hugo assets
|
- Author images are now Hugo assets
|
||||||
- Required Hugo version is now 0.87.0 or later
|
- Required Hugo version is now 0.87.0 or later
|
||||||
- Overhauled `figure` shortcode which now resizes images
|
- Overhauled `figure` shortcode which now resizes images
|
||||||
|
- Improved JSON-LD structured data
|
||||||
- Minor style and layout improvements
|
- Minor style and layout improvements
|
||||||
|
|
||||||
## [1.6.2] - 2022-01-07
|
## [1.6.2] - 2022-01-07
|
||||||
|
|
|
@ -3,38 +3,73 @@
|
||||||
{
|
{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebSite",
|
"@type": "WebSite",
|
||||||
|
"@id": "{{ (site.GetPage "/").Permalink | safeURL }}",
|
||||||
"name": "{{ .Site.Title | safeJS }}",
|
"name": "{{ .Site.Title | safeJS }}",
|
||||||
|
{{ with .Site.Params.description }}"description": "{{ . | safeJS }}",{{ end }}
|
||||||
|
{{ with .Site.LanguageCode }}"inLanguage": "{{ . }}",{{ end }}
|
||||||
"url": "{{ (site.GetPage "/").Permalink | safeURL }}",
|
"url": "{{ (site.GetPage "/").Permalink | safeURL }}",
|
||||||
"description": "{{ .Site.Params.description | safeJS }}"
|
"publisher" : {
|
||||||
|
"@type": "Person",
|
||||||
|
"name": "{{ .Site.Author.name | safeJS }}",
|
||||||
|
},
|
||||||
|
{{ with .Site.Params.keywords }}"keywords": {{ . }},{{ end }}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{{ else if .IsPage }}
|
{{ else if .IsPage }}
|
||||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
|
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||||
|
{{ $.Scratch.Delete "path" }}
|
||||||
|
{{ $.Scratch.Add "path" .Site.BaseURL }}
|
||||||
|
{{ $count := len (split $url "/") }}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
[{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "BlogPosting",
|
"@type": "Article",
|
||||||
"articleSection": "{{ (site.GetPage .Section).Title }}",
|
"articleSection": "{{ (site.GetPage .Section).Title | safeJS }}",
|
||||||
"name": "{{ .Title | safeJS }}",
|
"name": "{{ .Title | safeJS }}",
|
||||||
"headline": "{{ .Title | safeJS }}",
|
"headline": "{{ .Title | safeJS }}",
|
||||||
"description": "{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}",
|
{{ with .Description }}"description": "{{ . | safeJS }}",{{ end }}
|
||||||
{{ with .Site.LanguageCode }}"inLanguage": {{ . }},{{ end }}
|
{{ with .Summary }}"abstract": "{{ . | safeJS }}",{{ end }}
|
||||||
|
{{ with .Site.LanguageCode }}"inLanguage": "{{ . }}",{{ end }}
|
||||||
|
"url" : "{{ .Permalink }}",
|
||||||
"author" : {
|
"author" : {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": "{{ .Site.Author.name | safeJS }}"
|
"name": "{{ .Site.Author.name | safeJS }}"
|
||||||
},
|
},
|
||||||
"creator" : {
|
|
||||||
"@type": "Person",
|
|
||||||
"name": "{{ .Site.Author.name | safeJS }}"
|
|
||||||
},
|
|
||||||
"copyrightHolder": "{{ .Site.Author.name | safeJS }}",
|
|
||||||
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
|
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
|
||||||
{{ with .PublishDate }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}
|
{{ with .Date }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}
|
||||||
{{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
|
{{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
|
||||||
|
{{ with .ExpiryDate }}"expires": "{{ .Format $iso8601 }}",{{ end }}
|
||||||
{{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
|
{{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
|
||||||
"url" : "{{ .Permalink }}",
|
{{ if .Keywords }}
|
||||||
|
{{ with .Keywords }}"keywords": {{ . }},{{ end }}
|
||||||
|
{{ else }}
|
||||||
{{ with .Params.tags }}"keywords": {{ . }},{{ end }}
|
{{ with .Params.tags }}"keywords": {{ . }},{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
"mainEntityOfPage": "true",
|
||||||
"wordCount": "{{ .WordCount }}"
|
"wordCount": "{{ .WordCount }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@context": "http://schema.org",
|
||||||
|
"@type": "BreadcrumbList",
|
||||||
|
"itemListElement":
|
||||||
|
[{
|
||||||
|
"@type": "ListItem",
|
||||||
|
"position": 1,
|
||||||
|
"item": {
|
||||||
|
"@id": "{{ .Site.BaseURL }}",
|
||||||
|
"name": "Home"
|
||||||
}
|
}
|
||||||
|
},{{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}
|
||||||
|
{
|
||||||
|
"@type": "ListItem",
|
||||||
|
"position": {{ add $index 2 }},
|
||||||
|
"item": {
|
||||||
|
"@id": "{{ $.Scratch.Get "path" }}",
|
||||||
|
"name": "{{ humanize . }}"
|
||||||
|
}
|
||||||
|
}{{ if not (eq $index (sub $count 2)) }}, {{ end }}{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}
|
||||||
|
]
|
||||||
|
}]
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue