My layout file looks like this:
{{ define "main" }}
...
{{ end }}
And my base_of.html looks like:
<!DOCTYPE html>
<html lang="{{ site.LanguageCode | default `en-US` }}">
...
</head>
<body>
...
<!-- cache partial only in production -->
{{ if hugo.IsProduction }}
{{ partialCached "script.html" . }}
{{ partialCached "footer.html" . }}
{{ else }}
{{ partial "script.html" . }}
{{ partial "footer.html" . }}
{{ end }}
</body>
</html>
In the scripts.html file, I load the JS files that all pages will use. However, on a specific layout page, I want to load an additional JS file, but it must be loaded after all of my other site-wide JS files have been loaded.
From within the scope of the layout page, I do not seem to be able to set a boolean variable that the scripts.html partial can reference, so that it knows to load that additional script.
Is there a way to do this with Hugo at all?