Include p5 scripts if includes_p5_sketch is set in the page's .Scratch

Update the p5_sketch shortcode to set that value in .Scratch
This commit is contained in:
Eryn Wells 2022-08-16 09:15:35 -07:00
parent 14babf16eb
commit b495d84c64
2 changed files with 7 additions and 1 deletions

View file

@ -1,2 +1,3 @@
{{ $id := .Get "id" }}
<figure class="p5-sketch" id="{{ $id }}"></figure>
{{ .Page.Scratch.Set "includes_p5_sketch" true }}
<figure class="p5-sketch {{ with .Get "bordered" }}bordered{{ end }}" id="{{ $id }}"></figure>