mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 20:22:41 +00:00
🐛 Fix: style and script shortcodes missing values in page Scratch
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
{{- $scriptArr := (.Page.Scratch.Get "this").scriptArr | default slice -}}
|
||||
{{- $scriptArr | append (trim (partial "function/dos2unix.html" .Inner) "\n") | .Page.Scratch.SetInMap "this" "scriptArr" -}}
|
||||
{{- $scriptArr := .Page.Store.Get "scriptArr" | default slice -}}
|
||||
{{- $content := trim (partial "function/dos2unix.html" .Inner) "\n" -}}
|
||||
{{- if not (in $scriptArr $content) -}}
|
||||
{{- $scriptArr | append $content | .Page.Store.Set "scriptArr" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
{{- printf `<%v id="%v">%v</%v>` $tag $id $content $tag | safeHTML -}}
|
||||
|
||||
{{- $style := .Get 0 | printf "#%v{%v}" $id -}}
|
||||
{{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}}
|
||||
{{- $styleArr | append $style | .Page.Scratch.SetInMap "this" "styleArr" -}}
|
||||
{{- $styleArr := .Page.Store.Get "styleArr" | default slice -}}
|
||||
{{- if not (in $styleArr $style) -}}
|
||||
{{- $styleArr | append $style | .Page.Store.Set "styleArr" -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user