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:
@@ -57,7 +57,7 @@
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{/* Schema */}}
|
||||
{{ template "_internal/schema.html" . }}
|
||||
{{ partial "schema.html" . }}
|
||||
{{/* Generator */}}
|
||||
{{ if .Site.Params.attribution | default true }}
|
||||
{{ hugo.Generator }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ if .Site.Params.homepage.showRecent | default false }}
|
||||
<h2 class="mt-8 text-2xl font-extrabold">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
|
||||
{{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.homepage.mainSections)).Pages }}
|
||||
{{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -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