mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-19 17:13:02 -04:00
✨ Add JSON-LD structured metadata
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{{ if .IsHome -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": "{{ .Site.Title | safeJS }}",
|
||||
"url": "{{ .Site.BaseURL | safeURL }}",
|
||||
"description": "{{ .Site.Params.description | safeJS }}"
|
||||
}
|
||||
</script>
|
||||
{{ else if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"articleSection": "{{ (site.GetPage .Section).Title }}",
|
||||
"name": "{{ .Title | safeJS }}",
|
||||
"headline": "{{ .Title | safeJS }}",
|
||||
"description": "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}",
|
||||
{{ with .Site.LanguageCode }}"inLanguage": {{ . }},{{ end }}
|
||||
"author" : {
|
||||
"@type": "Person",
|
||||
"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 }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}
|
||||
{{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
|
||||
{{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
|
||||
"url" : "{{ .Permalink }}",
|
||||
"wordCount": "{{ .WordCount }}",
|
||||
"keywords": [{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}]
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user