Move single page scripts to a scripts block

This commit is contained in:
Eryn Wells 2022-09-26 13:21:43 -07:00
parent c47444925c
commit 16201877f4
4 changed files with 17 additions and 29 deletions

View file

@ -46,21 +46,6 @@
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ site.Title }}">
{{ end }}
{{ if and .IsPage (.Page.Scratch.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 and .IsPage (.Page.Scratch.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 }}
{{ range $script := .Resources.Match "*.js" }}
{{ $isModule := default true $script.Params.is_module }}
<script defer {{ if $isModule }}type="module"{{ end }} src="{{ $script.Permalink | relURL }}"></script>
{{ end }}
<!-- Misc -->
{{ if or hugo.IsProduction (eq site.Params.env "production") }}
<!---->