mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-02 11:42:39 +00:00
🐛 Fix: style and script shortcodes missing values in page Scratch
This commit is contained in:
@@ -260,8 +260,8 @@
|
||||
{{- dict "Source" . "Fingerprint" $fingerprint "Defer" true | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with (.Scratch.Get "this").styleArr -}}
|
||||
{{- $content := delimit . "" -}}
|
||||
{{- with .Store.Get "styleArr" -}}
|
||||
{{- $content := delimit . " " -}}
|
||||
{{- $path := substr (md5 $content) 0 6 | printf "css/%v" -}}
|
||||
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
|
||||
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
|
||||
@@ -289,7 +289,7 @@
|
||||
{{- dict "Source" . "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with (.Scratch.Get "this").scriptArr -}}
|
||||
{{- with .Store.Get "scriptArr" -}}
|
||||
{{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- .Scratch.Set "version" "v0.3.11" -}}
|
||||
{{- .Scratch.Set "version" "v0.3.12-c2bcccc9" -}}
|
||||
{{- .Scratch.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -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