diff --git a/layouts/shortcodes/readfile.html b/layouts/shortcodes/readfile.html index f97541c598..7d27caa35a 100644 --- a/layouts/shortcodes/readfile.html +++ b/layouts/shortcodes/readfile.html @@ -1,3 +1,8 @@ +{{/* Store ordinal, to be retrieved by parent element */}} +{{ if ge hugo.Version "0.93.0" }} + {{ .Page.Store.Add "Ordinal" 1 }} +{{ end }} + {{/* Handle the "file" named parameter or a single unnamed parameter as the file path */}} {{ if .IsNamedParams }} @@ -24,10 +29,10 @@ {{ if fileExists ($.Scratch.Get "filepath") }} {{ if eq (.Get "code") "true" }} - {{- highlight ($.Scratch.Get "filepath" | readFile | htmlUnescape | + {{- highlight ($.Scratch.Get "filepath" | readFile | htmlUnescape | safeHTML ) (.Get "lang") "" -}} {{ else }} - {{- $.Scratch.Get "filepath" | readFile | .Page.RenderString | htmlUnescape | safeHTML -}} + {{- $.Scratch.Get "filepath" | os.ReadFile | .Page.RenderString | htmlUnescape | safeHTML -}} {{ end }} {{ else }} diff --git a/layouts/shortcodes/tabpane.html b/layouts/shortcodes/tabpane.html index de644ea076..1c38affdc7 100644 --- a/layouts/shortcodes/tabpane.html +++ b/layouts/shortcodes/tabpane.html @@ -38,7 +38,14 @@ {{ $duplicate := false -}} {{ $duplicateLang := "" -}} -