summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-06-06 08:34:47 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-06-06 08:34:47 +0200
commit50c7ac012e9b9019ad9f91ea4395f7297274d1fa (patch)
tree40e80fa803c0fd681e4f742e873b2cb0ace19714 /layouts/partials
parent85f856482994db67d3d4e853e88e197da1c745ea (diff)
downloadgohugo-theme-ed-50c7ac012e9b9019ad9f91ea4395f7297274d1fa.tar.gz
Add `keywords` to schema.org metadata
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/keywords.html2
-rw-r--r--layouts/partials/schema.org/article.html1
-rw-r--r--layouts/partials/schema.org/website.html3
4 files changed, 5 insertions, 3 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 0b480fd..0c9329d 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -6,7 +6,7 @@
<title>{{ block "title" . }}{{- partial "title.html" . -}}{{ end }}</title>
<meta name="description" content="{{ partial "description.html" . }}">
- <meta name="keywords" content="{{ partial "keywords.html" . }}">
+ <meta name="keywords" content="{{ delimit (partial "keywords.html" .) ", " }}">
<meta name="author" content="{{ partial "author.html" . }}">
{{ hugo.Generator }}
diff --git a/layouts/partials/keywords.html b/layouts/partials/keywords.html
index ab0dd2b..37521ff 100644
--- a/layouts/partials/keywords.html
+++ b/layouts/partials/keywords.html
@@ -10,4 +10,4 @@
{{- end -}}
{{- end -}}
-{{- delimit $keywords ", " -}}
+{{- return $keywords -}}
diff --git a/layouts/partials/schema.org/article.html b/layouts/partials/schema.org/article.html
index 9c45065..821a1c8 100644
--- a/layouts/partials/schema.org/article.html
+++ b/layouts/partials/schema.org/article.html
@@ -21,6 +21,7 @@
"image": [
{{ $image.Permalink }}
],{{ end }}
+ "keywords": {{ partial "keywords.html" . }},
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
{{- if .Params.author }}
diff --git a/layouts/partials/schema.org/website.html b/layouts/partials/schema.org/website.html
index ef6609e..a84d110 100644
--- a/layouts/partials/schema.org/website.html
+++ b/layouts/partials/schema.org/website.html
@@ -3,7 +3,8 @@
"@context": "https://schema.org",
"@type": "WebSite",
"name": {{ partial "title.html" . }},
- "url": {{ site.BaseURL }}
+ "url": {{ site.BaseURL }},
+ "keywords": {{ partial "keywords.html" . }}
}
</script>
{{- /* TODO: Add "potentialAction" with search.