- Add partials in the resources folder for each of the major resources of my site - Consolidate .css and .js files via resources.Concat where possible
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
{{ define "header" }}
|
|
{{ partial "header.html" . }}
|
|
{{ end }}
|
|
|
|
{{ define "main" }}
|
|
{{ partial "single_main.html" . }}
|
|
{{ end }}
|
|
|
|
{{ define "scripts" }}
|
|
{{- if .HasShortcode "figures/railroad" -}}
|
|
{{- with partial "resources/railroad_utils.html" . -}}
|
|
<script defer type="module" src="{{ .RelPermalink }}" integrity="{{ .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 }}
|