mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
feat: add million router for SPA functionality\n\nNOTE: currently breaks interactive graph
This commit is contained in:
parent
f7027e7ecd
commit
e87cab0707
@ -1,29 +1,42 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- Meta tags -->
|
<!-- Meta tags -->
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="description" content="{{if .IsHome}}{{$.Site.Data.config.description}}{{else}}{{.Summary}}{{end}}">
|
<meta
|
||||||
<title>{{ if .Title }}{{ .Title }}{{ else }}{{ $.Site.Data.config.page_title }}{{ end }}</title>
|
name="description"
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
content="{{if .IsHome}}{{$.Site.Data.config.description}}{{else}}{{.Summary}}{{end}}"
|
||||||
<link rel="shortcut icon" type="image/png" href="{{$.Site.BaseURL}}/icon.png" />
|
/>
|
||||||
|
<title>
|
||||||
|
{{ if .Title }}{{ .Title }}{{ else }}{{ $.Site.Data.config.page_title }}{{
|
||||||
|
end }}
|
||||||
|
</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link
|
||||||
|
rel="shortcut icon"
|
||||||
|
type="image/png"
|
||||||
|
href="{{$.Site.BaseURL}}/icon.png"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- CSS Stylesheets and Fonts -->
|
<!-- CSS Stylesheets and Fonts -->
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Source+Sans+Pro:wght@400;600;700&family=Fira+Code:wght@400;700&display=swap" rel="stylesheet">
|
<link
|
||||||
{{$sass := resources.Match "styles/[!_]*.scss" }}
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Source+Sans+Pro:wght@400;600;700&family=Fira+Code:wght@400;700&display=swap"
|
||||||
{{$css := slice }}
|
rel="stylesheet"
|
||||||
{{range $sass}}
|
/>
|
||||||
{{$scss := . | resources.ToCSS (dict "outputStyle" "compressed") }}
|
{{$sass := resources.Match "styles/[!_]*.scss" }} {{$css := slice }} {{range
|
||||||
{{$css = $css | append $scss}}
|
$sass}} {{$scss := . | resources.ToCSS (dict "outputStyle" "compressed") }}
|
||||||
{{end}}
|
{{$css = $css | append $scss}} {{end}} {{$finalCss := $css | resources.Concat
|
||||||
{{$finalCss := $css | resources.Concat "styles.css" | resources.Fingerprint "md5" | resources.Minify }}
|
"styles.css" | resources.Fingerprint "md5" | resources.Minify }}
|
||||||
<link href="{{$finalCss.Permalink}}" rel="stylesheet">
|
<link href="{{$finalCss.Permalink}}" rel="stylesheet" />
|
||||||
|
|
||||||
{{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" | resources.Minify }}
|
{{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" |
|
||||||
|
resources.Minify }}
|
||||||
<script src="{{$darkMode.Permalink}}"></script>
|
<script src="{{$darkMode.Permalink}}"></script>
|
||||||
{{partial "katex.html" .}}
|
{{partial "katex.html" .}}
|
||||||
|
|
||||||
<!-- Preload page vars -->
|
<!-- Preload page vars -->
|
||||||
{{$linkIndex := resources.Get "indices/linkIndex.json" | resources.Fingerprint "md5" | resources.Minify | }}
|
{{$linkIndex := resources.Get "indices/linkIndex.json" | resources.Fingerprint
|
||||||
{{$contentIndex := resources.Get "indices/contentIndex.json" | resources.Fingerprint "md5" | resources.Minify }}
|
"md5" | resources.Minify | }} {{$contentIndex := resources.Get
|
||||||
|
"indices/contentIndex.json" | resources.Fingerprint "md5" | resources.Minify
|
||||||
|
}}
|
||||||
<script>
|
<script>
|
||||||
const BASE_URL = {{.Site.BaseURL}}
|
const BASE_URL = {{.Site.BaseURL}}
|
||||||
const fetchData = Promise.all([
|
const fetchData = Promise.all([
|
||||||
@ -42,5 +55,9 @@
|
|||||||
content,
|
content,
|
||||||
}))
|
}))
|
||||||
</script>
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
import { router } from 'https://unpkg.com/million/dist/router.mjs';
|
||||||
|
router();
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
{{ template "_internal/google_analytics.html" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user