2020-03-02 09:47:28 +01:00
|
|
|
{{- $content := .Inner | .Page.RenderString -}}
|
2020-05-15 11:43:04 +02:00
|
|
|
{{- $id := dict "scratch" .Page.Scratch | partial "function/id.html" -}}
|
2020-03-02 09:47:28 +01:00
|
|
|
{{- $tag := .Get 1 | default "div" -}}
|
2020-04-28 20:34:28 +02:00
|
|
|
{{- printf `<%s id="%s">%s</%s>` $tag $id $content $tag | safeHTML -}}
|
|
|
|
|
2020-04-26 19:19:23 +02:00
|
|
|
{{- $style := .Get 0 | printf "#%s{%s}" $id -}}
|
2020-05-06 15:31:37 +02:00
|
|
|
{{- $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)) -}}
|
2020-04-28 20:34:28 +02:00
|
|
|
{{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}}
|
|
|
|
{{- $styleArr | append $res.Content | .Page.Scratch.SetInMap "this" "styleArr" -}}
|