mirror of
https://github.com/falsycat/ar.falsy.cat.git
synced 2024-12-26 00:14:51 +00:00
cfg: make SPA optional
This commit is contained in:
parent
fc89ff2680
commit
24d08d580d
@ -35,6 +35,7 @@ const removeMarkdown = (
|
|||||||
.replace(/<[^>]*>/g, '')
|
.replace(/<[^>]*>/g, '')
|
||||||
.replace(/^[=\-]{2,}\s*$/g, '')
|
.replace(/^[=\-]{2,}\s*$/g, '')
|
||||||
.replace(/\[\^.+?\](\: .*?$)?/g, '')
|
.replace(/\[\^.+?\](\: .*?$)?/g, '')
|
||||||
|
.replace(/(#{1,6})\s+(.+)\1?/g, '<b>$2</b>')
|
||||||
.replace(/\s{0,2}\[.*?\]: .*?$/g, '')
|
.replace(/\s{0,2}\[.*?\]: .*?$/g, '')
|
||||||
.replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? '$1' : '')
|
.replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? '$1' : '')
|
||||||
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
||||||
@ -143,7 +144,7 @@ const removeMarkdown = (
|
|||||||
// SPA navigation
|
// SPA navigation
|
||||||
window.navigate(
|
window.navigate(
|
||||||
new URL(
|
new URL(
|
||||||
`${BASE_URL.slice(0, -1)}${id}#:~:text=${encodeURIComponent(term)}/`
|
`${BASE_URL}${id}#:~:text=${encodeURIComponent(term)}/`
|
||||||
),
|
),
|
||||||
'.singlePage'
|
'.singlePage'
|
||||||
)
|
)
|
||||||
|
@ -3,6 +3,7 @@ enableToc: true
|
|||||||
openToc: false
|
openToc: false
|
||||||
enableLinkPreview: true
|
enableLinkPreview: true
|
||||||
enableLatex: true
|
enableLatex: true
|
||||||
|
enableSPA: false
|
||||||
description:
|
description:
|
||||||
Host your second brain and digital garden for free. Quartz features extremely fast full-text search,
|
Host your second brain and digital garden for free. Quartz features extremely fast full-text search,
|
||||||
Wikilink support, backlinks, local graph, tags, and link previews.
|
Wikilink support, backlinks, local graph, tags, and link previews.
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
||||||
{{- range $cleanedInbound | uniq -}}
|
{{- range $cleanedInbound | uniq -}}
|
||||||
{{$l := printf "%s%s/" $host .}}
|
{{$l := printf "%s%s/" $host .}}
|
||||||
|
{{$l = cond (eq $l "//") "/" $l}}
|
||||||
{{with (index $contentTable .)}}
|
{{with (index $contentTable .)}}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{$l}}">{{index (index . "title")}}</a>
|
<a href="{{$l}}">{{index (index . "title")}}</a>
|
||||||
|
@ -16,3 +16,14 @@
|
|||||||
</style>
|
</style>
|
||||||
{{ $js := resources.Get "js/graph.js" | resources.Fingerprint "md5" }}
|
{{ $js := resources.Get "js/graph.js" | resources.Fingerprint "md5" }}
|
||||||
<script src="{{ $js.Permalink }}"></script>
|
<script src="{{ $js.Permalink }}"></script>
|
||||||
|
<script>
|
||||||
|
drawGraph(
|
||||||
|
{{strings.TrimRight "/" .Page.Permalink}},
|
||||||
|
{{strings.TrimRight "/" .Site.BaseURL}},
|
||||||
|
{{$.Site.Data.graphConfig.paths}},
|
||||||
|
{{$.Site.Data.graphConfig.depth}},
|
||||||
|
{{$.Site.Data.graphConfig.enableDrag}},
|
||||||
|
{{$.Site.Data.graphConfig.enableLegend}},
|
||||||
|
{{$.Site.Data.graphConfig.enableZoom}}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
content,
|
content,
|
||||||
}))
|
}))
|
||||||
</script>
|
</script>
|
||||||
|
{{if $.Site.Data.config.enableSPA}}
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { router, navigate } from "https://unpkg.com/million/dist/router.mjs";
|
import { router, navigate } from "https://unpkg.com/million/dist/router.mjs";
|
||||||
// SPA navigation for access later
|
// SPA navigation for access later
|
||||||
@ -89,5 +90,8 @@
|
|||||||
window.addEventListener("million:navigate", callback);
|
window.addEventListener("million:navigate", callback);
|
||||||
window.addEventListener("DOMContentLoaded", callback);
|
window.addEventListener("DOMContentLoaded", callback);
|
||||||
</script>
|
</script>
|
||||||
|
{{else}}
|
||||||
|
<script>window.navigate = (url) => window.location.href = url</script>
|
||||||
|
{{end}}
|
||||||
</head>
|
</head>
|
||||||
{{ template "_internal/google_analytics.html" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
|
Loading…
Reference in New Issue
Block a user