Move scripts to the bottom of the body
This commit is contained in:
parent
fbacdb6694
commit
6f21bae492
2 changed files with 15 additions and 15 deletions
|
@ -10,6 +10,21 @@
|
|||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
|
||||
{{ 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 }}
|
||||
|
||||
<script>
|
||||
const bodyClasses = document.body.classList;
|
||||
const systemDarkModeMatch = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue