Use .Page.Store instead of .Page.Scratch for conditional includes of support JS

I saw this on one of the Hugo documentation pages, so I copied it. I am not sure what the difference is.
This commit is contained in:
Eryn Wells 2022-10-30 11:39:33 -07:00
parent 5920625753
commit acb1cf3c35
3 changed files with 4 additions and 4 deletions

View file

@ -14,12 +14,12 @@
{{ end }}
{{ define "scripts" }}
{{- if .Page.Scratch.Get "includes_railroad_diagram" -}}
{{- if .Page.Store.Get "includes_railroad_diagram" -}}
<script defer type="module" src="{{ `scripts/railroad.js` | absURL }}"></script>
<script defer type="module" src="{{ `scripts/railroad-utils.js` | absURL }}"></script>
{{- end -}}
{{- if .Page.Scratch.Get "includes_p5_sketch" -}}
{{- if .Page.Store.Get "includes_p5_sketch" -}}
<script defer src="{{ `scripts/p5-1.4.1.min.js` | absURL }}"></script>
<script defer src="{{ `scripts/sketch-utils.js` | absURL }}"></script>
{{- end -}}