summaryrefslogtreecommitdiffstats
path: root/layouts/partials/schema.org/article.html
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-16 23:34:02 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-16 23:34:02 +0200
commit1210306d64fdc7b05e06c6fdb8158f8473d589f7 (patch)
treecf54c656971723cca1ae314fabcc90826f5040af /layouts/partials/schema.org/article.html
parenta516af25e13783b622dd54e1fd6ef149eacf2988 (diff)
downloadgohugo-theme-ed-1210306d64fdc7b05e06c6fdb8158f8473d589f7.tar.gz
Provide ContactPage for Schema.org
Diffstat (limited to 'layouts/partials/schema.org/article.html')
-rw-r--r--layouts/partials/schema.org/article.html20
1 files changed, 13 insertions, 7 deletions
diff --git a/layouts/partials/schema.org/article.html b/layouts/partials/schema.org/article.html
index b193acb..7fa3762 100644
--- a/layouts/partials/schema.org/article.html
+++ b/layouts/partials/schema.org/article.html
@@ -1,7 +1,9 @@
{{- /* Get schema type. */}}
{{- $schemaType := "Article" -}}
-{{- if (eq .Params.semanticType "about") -}}
+{{- if (eq .Params.semanticType "contact") -}}
+ {{- $schemaType = "ContactPage" -}}
+{{- else if (eq .Params.semanticType "about") -}}
{{- $schemaType = "AboutPage" -}}
{{- else if or (eq .Type "post") (eq .Type "posts") -}}
{{- $schemaType = "BlogPosting" -}}
@@ -19,11 +21,16 @@
"@type": "WebPage",
"@id": {{ .Permalink }}
},
- "headline": {{ partial "title.html" . | htmlUnescape }},{{ if .Params.featuredImage }}
+ "url": {{ .Permalink }},
+ "headline": {{ partial "title.html" . | htmlUnescape }},
+ "description": {{ partial "description.html" . }},{{ if .Params.featuredImage }}
{{ $image := .Resources.GetMatch .Params.featuredImage -}}
- "image": [
- {{ $image.Permalink }}
- ],{{ end }}
+ "image": {
+ "@type": "ImageObject",
+ "url": {{ $image.Permalink }},
+ "width": "{{ $image.Width }}",
+ "height": "{{ $image.Height }}"
+ },{{ end }}
"keywords": {{ partial "keywords.html" . }},
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
@@ -59,7 +66,6 @@
"@type": "ImageObject",
"url": {{ $logo.Permalink | absURL }}
}
- },
- "description": {{ partial "description.html" . }}
+ }
}
</script>