initales commit Northside Studio Page
This commit is contained in:
37
nss/themes/hello-friend-ng/layouts/partials/javascript.html
Normal file
37
nss/themes/hello-friend-ng/layouts/partials/javascript.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{{ $main := resources.Get "js/main.js" }}
|
||||
{{ $menu := resources.Get "js/menu.js" }}
|
||||
{{ $prism := resources.Get "js/prism.js" }}
|
||||
{{ $secureJS := slice $main $menu $prism | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||
|
||||
{{ range $val := $.Site.Params.customJS }}
|
||||
{{ if gt (len $val) 0 }}
|
||||
<script src="{{ $val }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs";
|
||||
const settings = localStorage.getItem("theme") === "dark" ?
|
||||
{
|
||||
startOnLoad: true,
|
||||
theme: "dark",
|
||||
darkMode: true,
|
||||
themeVariables: {
|
||||
tertiaryColor: "#dee3ed"
|
||||
}
|
||||
}
|
||||
:
|
||||
{
|
||||
startOnLoad: true,
|
||||
theme: "base",
|
||||
darkMode: false,
|
||||
themeVariables: {
|
||||
tertiaryColor: "#dee3ed"
|
||||
}
|
||||
}
|
||||
;
|
||||
mermaid.initialize(settings);
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user