cfg: make SPA optional

This commit is contained in:
Jacky Zhao
2022-05-03 10:43:22 -04:00
parent fc89ff2680
commit 24d08d580d
5 changed files with 19 additions and 1 deletions

View File

@ -58,6 +58,7 @@
content,
}))
</script>
{{if $.Site.Data.config.enableSPA}}
<script type="module">
import { router, navigate } from "https://unpkg.com/million/dist/router.mjs";
// SPA navigation for access later
@ -89,5 +90,8 @@
window.addEventListener("million:navigate", callback);
window.addEventListener("DOMContentLoaded", callback);
</script>
{{else}}
<script>window.navigate = (url) => window.location.href = url</script>
{{end}}
</head>
{{ template "_internal/google_analytics.html" . }}