diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6cbb28e..2a05088 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,18 +9,5 @@ {{ partial "footer.html" . }} - + {{ block "scripts" . }}{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa311a9..41cb050 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -35,3 +35,7 @@ {{ end }} {{ end }} + +{{ define "scripts" }} +{{ partial "single_scripts.html" . }} +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2bd6d0b..d2f68ac 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -46,21 +46,6 @@ {{ end }} - {{ if and .IsPage (.Page.Scratch.Get "includes_railroad_diagram") }} - - - {{ end }} - - {{ if and .IsPage (.Page.Scratch.Get "includes_p5_sketch") }} - - - {{ end }} - - {{ range $script := .Resources.Match "*.js" }} - {{ $isModule := default true $script.Params.is_module }} - - {{ end }} - {{ if or hugo.IsProduction (eq site.Params.env "production") }} diff --git a/layouts/partials/single_scripts.html b/layouts/partials/single_scripts.html new file mode 100644 index 0000000..b3853da --- /dev/null +++ b/layouts/partials/single_scripts.html @@ -0,0 +1,12 @@ +{{ if .Page.Scratch.Get "includes_railroad_diagram" }} + + +{{ end }} +{{ if .Page.Scratch.Get "includes_p5_sketch" }} + + +{{ end }} +{{ range $script := .Resources.Match "*.js" }} + {{ $isModule := default true $script.Params.is_module }} + +{{ end }}