diff --git a/layouts/_partials/post_meta.html b/layouts/_partials/post_meta.html index c7c2635d..30da9696 100644 --- a/layouts/_partials/post_meta.html +++ b/layouts/_partials/post_meta.html @@ -1,25 +1,25 @@ -{{- $scratch := newScratch }} +{{- $meta := slice }} {{- if not .Date.IsZero -}} - {{- $scratch.Add "meta" (slice (printf "%s" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }} + {{- $meta = $meta | append (printf "%s" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat))) }} {{- end }} {{- if (.Param "ShowReadingTime") -}} - {{- $scratch.Add "meta" (slice (printf "%s" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }} + {{- $meta = $meta | append (printf "%s" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} {{- end }} {{- if (.Param "ShowWordCount") -}} - {{- $scratch.Add "meta" (slice (printf "%s" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }} + {{- $meta = $meta | append (printf "%s" (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- end }} {{- if not (.Param "hideAuthor") -}} {{- with (partial "author.html" .) }} - {{- $scratch.Add "meta" (slice (printf "%s" .)) }} + {{- $meta = $meta | append (printf "%s" .) }} {{- end }} {{- end }} {{/* Combine all meta information into a single string with separators and render it as HTML.*/}} -{{- with ($scratch.Get "meta") }} +{{- with $meta }} {{- delimit . " ยท " | safeHTML -}} {{- end -}} diff --git a/layouts/_partials/share_icons.html b/layouts/_partials/share_icons.html index 910ba7f1..dff6bbb3 100644 --- a/layouts/_partials/share_icons.html +++ b/layouts/_partials/share_icons.html @@ -1,12 +1,12 @@ {{- $pageurl := .Permalink }} {{- $title := .Title }} -{{- $.Scratch.Set "tags" ""}} +{{- $tags := ""}} {{- with .Params.Tags }} -{{- $hashtags := newScratch}} -{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} -{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- $hashtags := slice }} +{{- range . }}{{ $hashtags = $hashtags | append (replaceRE "(\\s)" "" . ) }}{{end}} +{{- $tags = delimit $hashtags "," }} {{- end -}} {{- $custom := false }} @@ -17,7 +17,7 @@ {{- if (or (cond ($custom) (in $ShareButtons "x") (true)) (cond ($custom) (in $ShareButtons "twitter") (true))) }}