Adam Brangenberg
2023-09-20 d6301fae90d9f922618bf0f413e273156731eef7
refs
author Adam Brangenberg <adambrangenberg@proton.me>
Wednesday, September 20, 2023 18:38 +0000
committer GitHub <noreply@github.com>
Wednesday, September 20, 2023 18:38 +0000
commitd6301fae90d9f922618bf0f413e273156731eef7
tree a14ac2f969d839e0981cd936a457139dadb87d28 tree | zip | gz
parent 27a6087dd5a25dd5031b86b9917adde6ef4b211a view | diff
feat: Making Quartz available offline by making it a PWA (#465)

* Adding PWA and chaching for offline aviability

* renamed workbox config to fit Quartz' scheme

* Documenting new configuration

* Added missig umami documentation

* Fixed formatting so the build passes, thank you prettier :)

* specified caching strategies to improve performance

* formatting...

* fixing "404 manifest.json not found" on subdirectories by adding a / to manifestpath

* turning it into a plugin

* Removed Workbox-cli and updated @types/node

* Added Serviceworkercode to offline.ts

* formatting

* Removing workbox from docs

* applied suggestions

* Removed path.join for sw path

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Removed path.join for manifest path

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Removing path module import

* Added absolute path to manifests start_url and manifest "import" using baseUrl

* Adding protocol to baseurl

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Adding protocol to start_url too then

* formatting...

* Adding fallback page

* Documenting offline plugin

* formatting...

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* merge suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* formatting...

* Fixing manifest path, all these nits hiding the actual issues .-.

* Offline fallback page through plugins, most things taken from 404 Plugin

* adding Offline Plugin to config

* formatting...

* Turned offline off as default and removed offline.md

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
4 files added
9 files modified
241 ■■■■■ changed files
docs/configuration.md 2 ●●●●● diff | view | raw | blame | history
docs/features/offline access.md 31 ●●●●● diff | view | raw | blame | history
docs/index.md 2 ●●● diff | view | raw | blame | history
package-lock.json 9 ●●●●● diff | view | raw | blame | history
package.json 2 ●●● diff | view | raw | blame | history
quartz.config.ts 1 ●●●● diff | view | raw | blame | history
quartz/cfg.ts 1 ●●●● diff | view | raw | blame | history
quartz/components/Head.tsx 4 ●●●● diff | view | raw | blame | history
quartz/components/pages/OfflineFallbackPage.tsx 12 ●●●●● diff | view | raw | blame | history
quartz/plugins/emitters/componentResources.ts 5 ●●●●● diff | view | raw | blame | history
quartz/plugins/emitters/index.ts 1 ●●●● diff | view | raw | blame | history
quartz/plugins/emitters/offline.ts 97 ●●●●● diff | view | raw | blame | history
quartz/static/icon.svg 74 ●●●●● diff | view | raw | blame | history