Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(shortcode): style shortcode scss file path (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq authored May 6, 2020
1 parent 9bb56fd commit f4c9fe7
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
5 changes: 3 additions & 2 deletions layouts/shortcodes/style.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/06219b515bd3039bce88e4417e803b29/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#id-1 img {
height: 1.25rem; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/2d4250d7b4edf7b7647e94cfdc183b86/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#id-1 {
text-align: right; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/2f6a44c07cd36aed63db163b9f515d63/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#id-1 {
text-align: right; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/387e497be0b7dbdc903468dec88ce042/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/409594da26069e6252388311312abfd5/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/7857d7858fcfb859deeb60f29672cffc/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#id-1 {
text-align: right; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/c17d91e847fcfcd8e30a3c3f56b6af46/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#id-1 img {
height: 1.25rem; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/f34bb62f734d1cecaa4de6a8b8efab52/id-1.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#id-1 {
text-align: right; }
#id-1 strong {
color: #00b1ff; }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"style/fb3ada7a67e15e6dfbcd8e86e0e7fb61/id-1.css","MediaType":"text/css","Data":{}}

This file was deleted.

0 comments on commit f4c9fe7

Please sign in to comment.