fix(head): prevent Go template from escaping HTML entities in meta description (#973)
This commit is contained in:
parent
04bf1956b9
commit
0b9f6c36ad
@ -2,7 +2,7 @@
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
<meta name='description' content='{{ $description }}'>
|
||||
<meta name='description' {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
{{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }}
|
||||
|
||||
{{- $title := partial "data/title" . -}}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{{- $title := partialCached "data/title" . .RelPermalink -}}
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
|
||||
<meta property='og:title' content='{{ $title }}'>
|
||||
<meta property='og:description' content='{{ $description }}'>
|
||||
<meta property='og:title' {{ printf "content=%q" $title | safeHTMLAttr }}>
|
||||
<meta property='og:description' {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
<meta property='og:url' content='{{ .Permalink }}'>
|
||||
<meta property='og:site_name' content='{{ .Site.Title }}'>
|
||||
<meta property='og:type' content='
|
||||
|
@ -6,8 +6,8 @@
|
||||
{{- $title := partialCached "data/title" . .RelPermalink -}}
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
|
||||
<meta name="twitter:title" content="{{ $title }}">
|
||||
<meta name="twitter:description" content="{{ $description }}">
|
||||
<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}>
|
||||
<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
|
||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
|
||||
{{- if $image.exists -}}
|
||||
|
Loading…
Reference in New Issue
Block a user