Include the p5.js script when is_p5js_sketch is set in the front matter

This commit is contained in:
Eryn Wells 2022-03-24 23:15:24 -07:00
parent f21a558a8d
commit 8e5c9ebb3a
2 changed files with 12 additions and 7 deletions

View file

@ -4,7 +4,9 @@
<h1>{{ .Title }}{{ partial "development/draft_tag.html" . }}</h1>
<span class="post-date"><time>{{ .Date | time.Format "Jan 2, 2006" }}</time></p>
</header>
<section class="post-content">{{ .Content }}</section>
<section class="post-content">
{{ .Content }}
</section>
<!-- Post Tags -->
{{ if .Params.tags }}

View file

@ -11,7 +11,7 @@
<meta name="description" content="{{ .Summary }}" />
<meta name="author" content="{{ .Params.Author | default site.Author.name }}">
{{ else }}
<meta name="description" content="{{ site.Params.description }}">
<meta name="description" content="{{ .Params.description }}">
<meta name="author" content="{{ site.Author.name }}">
{{ end }}
@ -28,11 +28,14 @@
{{ if and .IsPage (not site.Params.disableHLJS) }}
<link rel="preload stylesheet" as="style" href="{{ `styles/an-old-hope.min.css` | absURL }}">
<script
defer
src="{{ `scripts/highlight.min.js` | absURL }}"
onload="hljs.initHighlightingOnLoad();"
></script>
<script defer src="{{ `scripts/highlight.min.js` | absURL }}" onload="hljs.initHighlightingOnLoad();"></script>
{{ end }}
{{ if and .IsPage .Params.is_p5js_sketch }}
<script src="{{ `scripts/p5-1.4.1.min.js` | absURL }}"></script>
{{ with .Resources.GetMatch "sketch.js" }}
<script src="{{ .RelPermalink }}"></script>"
{{ end }}
{{ end }}
{{ range $.Scratch.Get "social-list" }}