diff --git a/layouts/_default/home.json b/layouts/_default/home.json index 4cbc541c..a2f52680 100644 --- a/layouts/_default/home.json +++ b/layouts/_default/home.json @@ -5,11 +5,11 @@ {{- $page.Scratch.Add "paige_index" (dict "categories" .Params.categories "date" .PublishDate - "description" (.Description | markdownify | plainify | htmlUnescape) + "description" (.Description | markdownify | plainify | htmlUnescape | safeHTML) "keywords" .Params.keywords "link" .RelPermalink "tags" .Params.tags - "text" (strings.TrimRight " " (replace (.Plain | htmlUnescape) "\n" " ")) - "title" (.Title | markdownify | plainify | htmlUnescape)) -}} + "text" (strings.TrimRight " " (replace (.Plain | htmlUnescape | safeHTML) "\n" " ")) + "title" (.Title | markdownify | plainify | htmlUnescape | safeHTML)) -}} {{- end -}} {{- $page.Scratch.Get "paige_index" | jsonify -}} diff --git a/layouts/_default/paige/cloud.html b/layouts/_default/paige/cloud.html index f7ee027c..c73f726c 100644 --- a/layouts/_default/paige/cloud.html +++ b/layouts/_default/paige/cloud.html @@ -8,7 +8,7 @@
{{ . }}
{{ end }} diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index d9d13994..46567a17 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -5,12 +5,12 @@ {{ $commiturl := "" }} {{ $date := $page.PublishDate }} {{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }} -{{ $description := $page.Description | markdownify }} +{{ $description := $page.Description | markdownify | safeHTML }} {{ $link := $page.Params.link }} {{ $readingtime := $page.ReadingTime }} {{ $series := $page.Params.series }} {{ $tags := $page.Params.tags | default slice | uniq }} -{{ $title := $page.Title | markdownify }} +{{ $title := $page.Title | markdownify | safeHTML }} {{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }} {{ $commiturl = printf ($page.Param "paige.git.commit_url") $page.GitInfo.Hash }} diff --git a/layouts/partials/paige/page.html b/layouts/partials/paige/page.html index dd12ec7c..035ec83e 100644 --- a/layouts/partials/paige/page.html +++ b/layouts/partials/paige/page.html @@ -5,7 +5,7 @@ {{ $commiturl := "" }} {{ $date := $page.PublishDate }} {{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }} -{{ $description := $page.Description | markdownify }} +{{ $description := $page.Description | markdownify | safeHTML }} {{ $draft := $page.Draft }} {{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }} {{ $flags := slice }} @@ -14,9 +14,9 @@ {{ $pinned := $page.Params.paige.pin }} {{ $readingtime := $page.ReadingTime }} {{ $series := $page.Params.series }} -{{ $summary := $page.Summary | htmlUnescape | plainify }} +{{ $summary := $page.Summary | plainify | htmlUnescape | safeHTML }} {{ $tags := $page.Params.tags | default slice | uniq }} -{{ $title := $page.Title | markdownify }} +{{ $title := $page.Title | markdownify | safeHTML }} {{ $titlelink := $page.RelPermalink }} {{ if and (.Param "paige.git.commit_url") .GitInfo }} diff --git a/layouts/partials/paige/title.html b/layouts/partials/paige/title.html index ef44bbf8..b3fe2ed5 100644 --- a/layouts/partials/paige/title.html +++ b/layouts/partials/paige/title.html @@ -1,8 +1,8 @@ {{ $page := . }} -{{ $pagetitle := $page.Title | markdownify | plainify | htmlUnescape }} +{{ $pagetitle := $page.Title | markdownify | plainify | htmlUnescape | safeHTML }} {{ $result := "" }} -{{ $sitetitle := site.Title | markdownify | plainify | htmlUnescape }} +{{ $sitetitle := site.Title | markdownify | plainify | htmlUnescape | safeHTML }} {{ if and $pagetitle $sitetitle }} {{ if .IsHome }} diff --git a/layouts/shortcodes/paige/figure.html b/layouts/shortcodes/paige/figure.html index f1c1d299..48e26ef5 100644 --- a/layouts/shortcodes/paige/figure.html +++ b/layouts/shortcodes/paige/figure.html @@ -1,5 +1,5 @@ -{{ $caption := .Get 0 | default (.Get "caption") | markdownify }} -{{ $content := .Inner | markdownify }} +{{ $caption := .Get 0 | default (.Get "caption") | markdownify | safeHTML }} +{{ $content := .Inner | markdownify | safeHTML }} {{ $float := .Get "float" }} {{ $horizontal := .Get "horizontal" | default "center" }} {{ $maxwidth := .Get "maxwidth" }} diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index 525fd1c9..edb3ac9a 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -1,5 +1,5 @@ {{ $cite := .Get 0 | default (.Get "cite") }} -{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }} +{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify | safeHTML }} {{ if not $content }} {{ errorf "layouts/shortcodes/paige/quote.html: no content" }}