feat(content): support complete local resource references (#388)

This commit is contained in:
Dillon
2020-05-28 17:05:37 +08:00
committed by GitHub
parent 0c1f7d0ef8
commit aa48df5edd
93 changed files with 872 additions and 714 deletions

View File

@@ -4,8 +4,5 @@
{{- printf `<%v id="%v">%v</%v>` $tag $id $content $tag | safeHTML -}}
{{- $style := .Get 0 | printf "#%v{%v}" $id -}}
{{- $path := printf "style/%v/%v" (md5 .Page.RelPermalink) $id -}}
{{- $res := resources.FromString (printf "%v.scss" $path) $style -}}
{{- $res = $res | toCSS (dict "targetPath" (printf "%v.css" $path) "outputStyle" "compressed") -}}
{{- $styleArr := (.Page.Scratch.Get "this").styleArr | default slice -}}
{{- $styleArr | append $res.Content | .Page.Scratch.SetInMap "this" "styleArr" -}}
{{- $styleArr | append $style | .Page.Scratch.SetInMap "this" "styleArr" -}}