diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 8ee0401515..4290e751b1 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,3 +1,4 @@ +{{- /* based on Hugo 0.125.3 rss.xml */}} {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} {{- $authorEmail := "" }} @@ -29,15 +30,15 @@ {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{ . }}{{end}}{{ with $authorEmail }} + Hugo + {{ site.Language.LanguageCode }}{{ with $authorEmail }} {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} {{ . }}{{ end }}{{ if not .Date.IsZero }} {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "rss" }} {{ printf "" ( partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true)) .MediaType | safeHTML }} - {{- end -}} + {{- end }} {{- range $pages }} {{- $relearnIsHiddenFrom := index ($page.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- if and .Permalink .Title (or (not $relearnIsHiddenFrom) (ne .Site.Params.disableSeoHiddenPages true) ) }} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 064136d3c3..cfcb7feb26 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -1,8 +1,9 @@ +{{- /* based on Hugo 0.125.3 sitemap.xml */}} {{- partialCached "page-meta.hugo" . .RelPermalink }} {{- printf "" | safeHTML }} {{- range where .Pages "Sitemap.Disable" "ne" true }} -{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} + {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} {{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}{{ if not .Lastmod.IsZero }} {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} @@ -11,6 +12,6 @@ {{ end }} {{ end }}{{ end }} -{{- end -}} + {{- end -}} {{- end }} diff --git a/layouts/alias.html b/layouts/alias.html index 2b3db29811..8aac34ecfa 100644 --- a/layouts/alias.html +++ b/layouts/alias.html @@ -1,3 +1,4 @@ +{{- /* based on Hugo 0.125.3 alias.html */}} @@ -22,9 +23,9 @@ - {{- $link := "" }} + {{- $link := "" }} {{ $url }} - {{ (printf $link $url "canonical" "text/html" ($url | htmlEscape)) | safeHTML }} + {{ (printf $link $url "canonical" ($url | htmlEscape)) | safeHTML }} diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html index 9dba98d359..2bfc469062 100644 --- a/layouts/partials/opengraph.html +++ b/layouts/partials/opengraph.html @@ -1,4 +1,4 @@ -{{- /* based on Hugo 0.125.0 _internal/opengraph.html but with modified title */}} +{{- /* based on Hugo 0.125.3 opengraph.html */}} {{- $format := partial "get-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} @@ -74,23 +74,14 @@ {{- end }} {{- end }} -{{- $facebookAdmin := "" }} -{{- with site.Params.social.facebook_admin }} - {{- $facebookAdmin = . }} -{{- else }} - {{- with site.Social.facebook_admin }} - {{- $facebookAdmin = . }} - {{- $hugoVersion := "0.120.0" }} - {{- if ge hugo.Version $hugoVersion }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} - {{- end }} - {{- end }} -{{- end }} - -{{- with $facebookApp }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- with .facebook_app_id }} -{{- else }} - {{- with $facebookAdmin }} + {{- else }} + {{- with .facebook_admin }} + {{- end }} + {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/image.html b/layouts/partials/shortcodes/image.html index 253486336a..8e5b4da999 100644 --- a/layouts/partials/shortcodes/image.html +++ b/layouts/partials/shortcodes/image.html @@ -1,3 +1,4 @@ +{{- /* based on Hugo 0.125.3 render-image.html */}} {{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} @@ -77,7 +78,7 @@ {{- $classes = $classes | append $c }} {{- end }} {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $page) .id }} -{{- $attributes = merge $attributes (dict "alt" $alt "src" $url "title" $title) }} +{{- $attributes = merge $attributes (dict "alt" $alt "src" $url "title" ($title | transform.HTMLEscape)) }} {{- if $effects.lazy }} {{- $attributes = merge $attributes (dict "loading" "lazy") }} {{- end }} diff --git a/layouts/partials/shortcodes/link.html b/layouts/partials/shortcodes/link.html index eaca03d73a..73429a2e99 100644 --- a/layouts/partials/shortcodes/link.html +++ b/layouts/partials/shortcodes/link.html @@ -1,3 +1,4 @@ +{{- /* based on Hugo 0.125.3 render-link.html */}} {{- $page := .page }} {{- if and (not $page) .context }} {{- $page = .context }} @@ -10,7 +11,7 @@ {{- $attributes := dict }} {{- $title := .title | default "" }} {{- $title = trim $title " " }} -{{- $attributes = $attributes | merge (dict "title" $title) }} +{{- $attributes = $attributes | merge (dict "title" ($title | transform.HTMLEscape)) }} {{- $content := .content }} {{- $target := .target | default "" }} {{- $u := urls.Parse $url }} diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index 2e464fffe2..f6c0c514aa 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -1,4 +1,4 @@ -{{- /* based on Hugo 0.125.0 _internal/twitter_cardss.html but with modified title */}} +{{- /* based on Hugo 0.125.3 twitter_cards.html */}} {{- $images := partial "_funcs/get-page-images" . }} {{- with index $images 0 }} @@ -10,22 +10,14 @@ {{- $twitterSite := "" }} -{{- with site.Params.social.twitter }} - {{- $twitterSite = . }} -{{- else }} - {{- with site.Social.twitter }} - {{- $twitterSite = . }} - {{- $hugoVersion := "0.120.0" }} - {{- if ge hugo.Version $hugoVersion }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- with .twitter }} + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" . }} + {{- end }} + {{- end }} {{- end }} -{{- end }} - -{{- with $twitterSite }} - {{- $content := . }} - {{- if not (strings.HasPrefix . "@") }} - {{- $content = printf "@%v" . }} - {{- end }} - {{- end }} \ No newline at end of file