summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/schema.org/article.html20
-rw-r--r--layouts/partials/schema.org/website.html24
2 files changed, 35 insertions, 9 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>
diff --git a/layouts/partials/schema.org/website.html b/layouts/partials/schema.org/website.html
index c06bd76..cde04ed 100644
--- a/layouts/partials/schema.org/website.html
+++ b/layouts/partials/schema.org/website.html
@@ -7,5 +7,25 @@
"keywords": {{ partial "keywords.html" . }}
}
</script>
-{{- /* TODO: Add "potentialAction" with search.
- For more see: https://developers.google.com/structured-data/slsb-overview */ -}}
+
+{{- /*
+TODO: Add "potentialAction" with a search entrypoint (now we have a search)
+
+For more see:
+- https://developers.google.com/search/docs/advanced/structured-data/sitelinks-searchbox
+
+Example:
+{
+ "@context": "https://schema.org",
+ "@type": "WebSite",
+ "url": "https://www.example.com/",
+ "potentialAction": {
+ "@type": "SearchAction",
+ "target": {
+ "@type": "EntryPoint",
+ "urlTemplate": "https://query.example.com/search?q={search_term_string}"
+ },
+ "query-input": "required name=search_term_string"
+ }
+}
+*/ -}}