mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
fix: use safeHTML for description in metadata (#202)
This commit is contained in:
parent
9f49819aa8
commit
063c116bb5
@ -5,9 +5,9 @@
|
|||||||
{{- if not (eq .Kind "home") }}
|
{{- if not (eq .Kind "home") }}
|
||||||
{{- $title = printf `%s on %s` (partial "utils/title" .) $title -}}
|
{{- $title = printf `%s on %s` (partial "utils/title" .) $title -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<title>{{ trim ($title | plainify) "\n" }}</title>
|
<title>{{ trim ($title | plainify) "\n" | safeHTML }}</title>
|
||||||
{{- with .Site.Params.subtitle }}
|
{{- with .Site.Params.subtitle }}
|
||||||
<subtitle>{{ trim (. | plainify) "\n" }}</subtitle>
|
<subtitle>{{ trim (. | plainify) "\n" | safeHTML }}</subtitle>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $output_formats := .OutputFormats -}}
|
{{- $output_formats := .OutputFormats -}}
|
||||||
{{- range $output_formats -}}
|
{{- range $output_formats -}}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- range $page := $pages }}
|
{{- range $page := $pages }}
|
||||||
<entry>
|
<entry>
|
||||||
<title>{{ trim (partial "utils/title" . | plainify) "\n" }}</title>
|
<title>{{ trim (partial "utils/title" . | plainify) "\n" | safeHTML }}</title>
|
||||||
<link href="{{ .Permalink }}" rel="alternate" type="text/html" {{ with .Site.Language.Lang }} hreflang="{{ . }}"{{ end }} />
|
<link href="{{ .Permalink }}" rel="alternate" type="text/html" {{ with .Site.Language.Lang }} hreflang="{{ . }}"{{ end }} />
|
||||||
<id>{{ .Permalink }}</id>
|
<id>{{ .Permalink }}</id>
|
||||||
{{- with .Params.authors }}
|
{{- with .Params.authors }}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}}
|
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}}
|
||||||
|
|
||||||
{{- with partial "utils/description" . }}
|
{{- with partial "utils/description" . }}
|
||||||
<meta name="description" content="{{ trim (. | plainify) "\n" }}" />
|
<meta name="description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $keywords }}
|
{{- with $keywords }}
|
||||||
<meta name="keywords" content="{{ delimit . "," }}" />
|
<meta name="keywords" content="{{ delimit . "," }}" />
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta property="og:site_name" content="{{ . }}" />
|
<meta property="og:site_name" content="{{ . }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with partial "utils/description" . }}
|
{{- with partial "utils/description" . }}
|
||||||
<meta property="og:description" content="{{ trim (. | plainify) "\n" }}" />
|
<meta property="og:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||||
<meta property="og:url" content="{{ .Permalink }}" />
|
<meta property="og:url" content="{{ .Permalink }}" />
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"name": "{{ .Site.Title }}",
|
"name": "{{ .Site.Title }}",
|
||||||
"url": "{{ .Site.BaseURL }}",
|
"url": "{{ .Site.BaseURL }}",
|
||||||
{{- with partial "utils/description" . }}
|
{{- with partial "utils/description" . }}
|
||||||
"description": "{{ trim (. | plainify) "\n" }}",
|
"description": "{{ trim (. | plainify) "\n" | safeHTML }}",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
"thumbnailUrl": "{{ $thumbnail }}"
|
"thumbnailUrl": "{{ $thumbnail }}"
|
||||||
{{- with .Site.Params.GeekblogContentLicense }},
|
{{- with .Site.Params.GeekblogContentLicense }},
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"alternativeHeadline": "{{ . }}",
|
"alternativeHeadline": "{{ . }}",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with partial "utils/description" . }}
|
{{- with partial "utils/description" . }}
|
||||||
"description": "{{ trim (. | plainify) "\n" }}",
|
"description": "{{ trim (. | plainify) "\n" | safeHTML }}",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
"inLanguage": {{ .Site.Language.Lang }},
|
"inLanguage": {{ .Site.Language.Lang }},
|
||||||
"isFamilyFriendly": "true",
|
"isFamilyFriendly": "true",
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
<meta name="twitter:title" content="{{ partial "utils/title" . }}" />
|
<meta name="twitter:title" content="{{ partial "utils/title" . }}" />
|
||||||
{{- with partial "utils/description" . }}
|
{{- with partial "utils/description" . }}
|
||||||
<meta name="twitter:description" content="{{ trim (. | plainify) "\n" }}" />
|
<meta name="twitter:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Site.Social.twitter -}}
|
{{- with .Site.Social.twitter -}}
|
||||||
<meta name="twitter:site" content="@{{ . }}" />
|
<meta name="twitter:site" content="@{{ . }}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user