diff options
author | Dillon <dillonzq@outlook.com> | 2020-05-06 16:31:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 16:31:37 +0300 |
commit | f4c9fe750de9ad242d68906b728efa0fb4b2c407 (patch) | |
tree | 5b56c8d78492d381483b2a40a61cf830be9f1d20 /layouts/shortcodes | |
parent | 9bb56fd87f6a525565e51657ab110d544991be2f (diff) |
fix(shortcode): style shortcode scss file path (#327)
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/style.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/shortcodes/style.html b/layouts/shortcodes/style.html index 3e1e999..4ac5f60 100644 --- a/layouts/shortcodes/style.html +++ b/layouts/shortcodes/style.html @@ -4,7 +4,8 @@ {{- printf `<%s id="%s">%s</%s>` $tag $id $content $tag | safeHTML -}} {{- $style := .Get 0 | printf "#%s{%s}" $id -}} -{{- $res := resources.FromString (printf "stype/%s.scss" $id) $style -}} -{{- $res = $res | toCSS (dict "targetPath" (printf "stype/%s.css" $id)) -}} +{{- $path := printf "style/%s/%s" (md5 .Page.RelPermalink) $id -}} +{{- $res := resources.FromString (printf "%s.scss" $path) $style -}} +{{- $res = $res | toCSS (dict "targetPath" (printf "%s.css" $path)) -}} {{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}} {{- $styleArr | append $res.Content | .Page.Scratch.SetInMap "this" "styleArr" -}} |