mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
tpl/opengraph: Use safeHTMLAttr instead of safeHTML for HTML attributes
Fixes #5236
This commit is contained in:
parent
f1a00b2069
commit
4f9c109dc5
2 changed files with 11 additions and 10 deletions
11
tpl/tplimpl/embedded/templates.autogen.go
generated
11
tpl/tplimpl/embedded/templates.autogen.go
generated
|
@ -180,13 +180,13 @@ if (!doNotTrack) {
|
||||||
{{ end }}{{ end }}
|
{{ end }}{{ end }}
|
||||||
|
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
|
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>{{ end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- if not .Date.IsZero }}
|
{{- if not .Date.IsZero }}
|
||||||
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}{{/* .IsPage */}}
|
{{- end }}{{/* .IsPage */}}
|
||||||
|
|
||||||
|
@ -218,7 +218,8 @@ if (!doNotTrack) {
|
||||||
{{- end }}{{ end }}
|
{{- end }}{{ end }}
|
||||||
|
|
||||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||||
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}`},
|
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||||
|
`},
|
||||||
{`pagination.html`, `{{ $pag := $.Paginator }}
|
{`pagination.html`, `{{ $pag := $.Paginator }}
|
||||||
{{ if gt $pag.TotalPages 1 }}
|
{{ if gt $pag.TotalPages 1 }}
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
{{ end }}{{ end }}
|
{{ end }}{{ end }}
|
||||||
|
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
|
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>{{ end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- if not .Date.IsZero }}
|
{{- if not .Date.IsZero }}
|
||||||
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTMLAttr }}"/>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}{{/* .IsPage */}}
|
{{- end }}{{/* .IsPage */}}
|
||||||
|
|
||||||
|
@ -45,4 +45,4 @@
|
||||||
{{- end }}{{ end }}
|
{{- end }}{{ end }}
|
||||||
|
|
||||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||||
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue