Add geenrated resources to be pre-cached by service worker

This commit is contained in:
Alex Shpak
2025-09-21 19:53:13 +02:00
parent c8238fd893
commit d08e17457f
6 changed files with 19 additions and 10 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}
(function () {
const searchDataURL = '{{ $searchData.RelPermalink }}';
const searchDataURL = '{{ partial "docs/links/resource-precache" $searchData }}';
const indexConfig = Object.assign({{ $searchConfig }}, {
includeScore: true,
useExtendedSearch: true,
+3
View File
@@ -4,6 +4,9 @@ const pages = [
{{ range .Site.AllPages -}}
"{{ .RelPermalink }}",
{{ end -}}
{{ range $permalink, $ok := site.Store.Get "book-sw-precache" -}}
"{{ $permalink }}",
{{ end -}}
{{ end }}
];