erynwells.me/layouts/_default/single.html

43 lines
1.5 KiB
HTML

{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{ partial "single_main.html" . }}
{{ end }}
{{ define "styles" }}
{{- if .HasShortcode "figures/railroad" -}}
<link rel="preload stylesheet" as="style" href="{{ `styles/railroad.css` | absURL }}">
{{- end -}}
<link rel="preload stylesheet" as="style" href="{{ `styles/monokai.css` | absURL }}">
{{ end }}
{{ define "scripts" }}
{{- if .HasShortcode "figures/railroad" -}}
{{- with partial "secure_asset.html" "scripts/lib/railroad.js" -}}
<script defer type="module" src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
{{- end -}}
{{- with resources.Get "scripts/railroad-utils.js" -}}
<script defer type="module" src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
{{- end -}}
{{- end -}}
{{- if .HasShortcode "figures/p5" -}}
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
{{- end -}}
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
<script defer src="{{ .Secure.Permalink }}" integrity="{{ .Secure.Data.Integrity }}"></script>
{{- end -}}
{{- 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 -}}
{{ end }}
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}