fix(shortcode): style shortcode scss file path (#327)

This commit is contained in:
Dillon 2020-05-06 21:31:37 +08:00 committed by GitHub
parent 9bb56fd87f
commit f4c9fe750d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 35 additions and 4 deletions

View file

@ -10,7 +10,7 @@
{{- end -}}
{{- $params := .Params | merge .Site.Params.page -}}
{{- .Scratch.Set "version" "0.2.5" -}}
{{- .Scratch.Set "version" "0.2.6" -}}
{{- if eq hugo.Environment "production" -}}
{{- .Scratch.Set "cdn" .Site.Params.cdn -}}

View file

@ -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" -}}

View file

@ -0,0 +1 @@
{"Target":"style/06219b515bd3039bce88e4417e803b29/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1 @@
{"Target":"style/2d4250d7b4edf7b7647e94cfdc183b86/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1 @@
{"Target":"style/2f6a44c07cd36aed63db163b9f515d63/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1 @@
{"Target":"style/387e497be0b7dbdc903468dec88ce042/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }

View file

@ -0,0 +1 @@
{"Target":"style/409594da26069e6252388311312abfd5/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }

View file

@ -0,0 +1 @@
{"Target":"style/7857d7858fcfb859deeb60f29672cffc/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1 @@
{"Target":"style/c17d91e847fcfcd8e30a3c3f56b6af46/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1 @@
{"Target":"style/f34bb62f734d1cecaa4de6a8b8efab52/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }

View file

@ -0,0 +1 @@
{"Target":"style/fb3ada7a67e15e6dfbcd8e86e0e7fb61/id-1.css","MediaType":"text/css","Data":{}}

View file

@ -1 +0,0 @@
{"Target":"stype/id-1.css","MediaType":"text/css","Data":{}}