diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d3aa6a1..dfaae82 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,19 +7,19 @@ {{ end }} {{ define "styles" }} - {{- if .Page.Scratch.Get "includes_railroad_diagram" -}} + {{- if .HasShortcode "figures/railroad" -}} {{- end -}} {{ end }} {{ define "scripts" }} - {{- if .Page.Store.Get "includes_railroad_diagram" -}} + {{- if .HasShortcode "figures/railroad" -}} {{- end -}} - {{- if .Page.Store.Get "includes_p5_sketch" -}} + {{- if .HasShortcode "figures/p5" -}} {{- end -}} diff --git a/layouts/shortcodes/figures/p5.html b/layouts/shortcodes/figures/p5.html index 1cd1c08..bef42b9 100644 --- a/layouts/shortcodes/figures/p5.html +++ b/layouts/shortcodes/figures/p5.html @@ -1,5 +1,4 @@ -{{ $id := .Get "id" }} -{{ .Page.Store.Set "includes_p5_sketch" true }} +{{- $id := .Get "id" -}}
diff --git a/layouts/shortcodes/figures/railroad.html b/layouts/shortcodes/figures/railroad.html index a20d813..617ba83 100644 --- a/layouts/shortcodes/figures/railroad.html +++ b/layouts/shortcodes/figures/railroad.html @@ -1,4 +1,3 @@ {{- $id := .Get "id" -}} -{{- .Page.Store.Set "includes_railroad_diagram" true -}}
{{ .Inner }}