Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-02-07 16:47:32 +0300
committerGitHub <noreply@github.com>2022-02-07 16:47:32 +0300
commit87fdde4808d612a7a91accd7308c0815184ef9f6 (patch)
treeb30b90e44553d85c631fa6e1ff04aab534fd6a31
parentcd9ab9e48ef48b0435431d771aa0a155ae3126fa (diff)
fix: use safeHTML for description in metadata (#334)v0.26.1
-rw-r--r--layouts/partials/head/meta.html2
-rw-r--r--layouts/partials/microformats/opengraph.html2
-rw-r--r--layouts/partials/microformats/schema.html4
-rw-r--r--layouts/partials/microformats/twitter_cards.html2
4 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html
index 761fe1c..4cc4ddb 100644
--- a/layouts/partials/head/meta.html
+++ b/layouts/partials/head/meta.html
@@ -7,7 +7,7 @@
{{ $keywords := default .Site.Params.Keywords .Keywords }}
{{- with partial "utils/description" . }}
- <meta name="description" content="{{ trim (. | plainify) "\n" }}" />
+ <meta name="description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
{{- end }}
{{- with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}" />
diff --git a/layouts/partials/microformats/opengraph.html b/layouts/partials/microformats/opengraph.html
index 1065cb9..bd4b5a9 100644
--- a/layouts/partials/microformats/opengraph.html
+++ b/layouts/partials/microformats/opengraph.html
@@ -5,7 +5,7 @@
<meta property="og:site_name" content="{{ . }}" />
{{- end }}
{{- with partial "utils/description" . }}
- <meta property="og:description" content="{{ trim (. | plainify) "\n" }}" />
+ <meta property="og:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
{{- end }}
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html
index c610c70..9175cef 100644
--- a/layouts/partials/microformats/schema.html
+++ b/layouts/partials/microformats/schema.html
@@ -8,7 +8,7 @@
"name": "{{ .Site.Title }}",
"url": "{{ .Site.BaseURL }}",
{{- with partial "utils/description" . }}
- "description": "{{ trim (. | plainify) "\n" }}",
+ "description": "{{ trim (. | plainify) "\n" | safeHTML }}",
{{- end }}
"thumbnailUrl": "{{ $thumbnail }}"
{{- with .Site.Params.GeekdocContentLicense }},
@@ -26,7 +26,7 @@
"headline": "{{ (partial "utils/title" .) | safeJS }}",
"alternativeHeadline": "{{ .Params.lead }}",
{{- with partial "utils/description" . }}
- "description": "{{ trim (. | plainify) "\n" }}",
+ "description": "{{ trim (. | plainify) "\n" | safeHTML }}",
{{- end }}
"inLanguage": {{ .Site.Language.Lang }},
"isFamilyFriendly": "true",
diff --git a/layouts/partials/microformats/twitter_cards.html b/layouts/partials/microformats/twitter_cards.html
index 55097be..86f96d4 100644
--- a/layouts/partials/microformats/twitter_cards.html
+++ b/layouts/partials/microformats/twitter_cards.html
@@ -21,7 +21,7 @@
{{- end }}
<meta name="twitter:title" content="{{ partial "utils/title" . }}" />
{{- with partial "utils/description" . }}
- <meta name="twitter:description" content="{{ trim (. | plainify) "\n" }}" />
+ <meta name="twitter:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
{{- end }}
{{- with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}" />