Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Making Quartz available offline by making it a PWA #465

Merged
merged 43 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0ae3b31
Adding PWA and chaching for offline aviability
adambrangenberg Sep 10, 2023
6154f6a
renamed workbox config to fit Quartz' scheme
adambrangenberg Sep 10, 2023
3c5486b
Documenting new configuration
adambrangenberg Sep 10, 2023
03198b6
Added missig umami documentation
adambrangenberg Sep 10, 2023
9c3c05e
Fixed formatting so the build passes, thank you prettier :)
adambrangenberg Sep 10, 2023
d4fc581
specified caching strategies to improve performance
adambrangenberg Sep 11, 2023
d8a8635
formatting...
adambrangenberg Sep 11, 2023
5b7fd51
fixing "404 manifest.json not found" on subdirectories by adding a / …
adambrangenberg Sep 11, 2023
b5c8413
turning it into a plugin
adambrangenberg Sep 17, 2023
4cadd09
Removed Workbox-cli and updated @types/node
adambrangenberg Sep 18, 2023
06e3413
Added Serviceworkercode to offline.ts
adambrangenberg Sep 18, 2023
e112398
formatting
adambrangenberg Sep 18, 2023
6375229
Merge pull request #1 from jackyzha0/v4
adambrangenberg Sep 18, 2023
70404aa
Removing workbox from docs
adambrangenberg Sep 18, 2023
6ee800c
applied suggestions
adambrangenberg Sep 18, 2023
b6b9a72
Removed path.join for sw path
adambrangenberg Sep 19, 2023
0378500
Removed path.join for manifest path
adambrangenberg Sep 19, 2023
2aabdff
Removing path module import
adambrangenberg Sep 19, 2023
2a50a94
Added absolute path to manifests start_url and manifest "import" usin…
adambrangenberg Sep 19, 2023
6822944
Adding protocol to baseurl
adambrangenberg Sep 19, 2023
623a6b9
Adding protocol to start_url too then
adambrangenberg Sep 19, 2023
12197c6
formatting...
adambrangenberg Sep 19, 2023
c55a101
Adding fallback page
adambrangenberg Sep 19, 2023
dc113cb
Documenting offline plugin
adambrangenberg Sep 19, 2023
f169f1e
formatting...
adambrangenberg Sep 19, 2023
45c0e96
merge suggestion
adambrangenberg Sep 19, 2023
5cde360
merge suggestion
adambrangenberg Sep 19, 2023
ef222e2
merge suggestion
adambrangenberg Sep 19, 2023
14219a0
merge suggestion
adambrangenberg Sep 19, 2023
36a5493
merge suggestion
adambrangenberg Sep 19, 2023
bbbd706
merge suggestion
adambrangenberg Sep 19, 2023
55c7b8b
merge suggestion
adambrangenberg Sep 19, 2023
5ce4306
merge suggestion
adambrangenberg Sep 19, 2023
e2024b2
merge suggestion
adambrangenberg Sep 19, 2023
2e03a57
merge suggestion
adambrangenberg Sep 19, 2023
5ce138f
merge suggestion
adambrangenberg Sep 19, 2023
14e2509
merge suggestion
adambrangenberg Sep 19, 2023
cdf6e05
formatting...
adambrangenberg Sep 19, 2023
dbef507
Fixing manifest path, all these nits hiding the actual issues .-.
adambrangenberg Sep 19, 2023
199d4c9
Offline fallback page through plugins, most things taken from 404 Plugin
adambrangenberg Sep 19, 2023
5f1d19d
adding Offline Plugin to config
adambrangenberg Sep 19, 2023
c0cc626
formatting...
adambrangenberg Sep 19, 2023
78e15de
Turned offline off as default and removed offline.md
adambrangenberg Sep 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Configuration
---

Quartz is meant to be extremely configurable, even if you don't know any coding. Most of the configuration you should need can be done by just editing `quartz.config.ts` or changing [[layout|the layout]] in `quartz.layout.ts`.
Quartz is meant to be extremely configurable, even if you don't know any coding. Most of the configuration you should need can be done by just editing `quartz.config.ts`, changing [[layout|the layout]] in `quartz.layout.ts` or adjusting cachine in `workbox.config.ts`.

> [!tip]
> If you edit Quartz configuration using a text-editor that has TypeScript language support like VSCode, it will warn you when you you've made an error in your configuration, helping you avoid configuration mistakes!
Expand All @@ -21,10 +21,12 @@ const config: QuartzConfig = {
This part of the configuration concerns anything that can affect the whole site. The following is a list breaking down all the things you can configure:

- `pageTitle`: title of the site. This is also used when generating the [[RSS Feed]] for your site.
- `description`: description of the site. This will be used when someone installs your site as an App.
- `enableSPA`: whether to enable [[SPA Routing]] on your site.
- `enablePopovers`: whether to enable [[popover previews]] on your site.
- `analytics`: what to use for analytics on your site. Values can be
- `null`: don't use analytics;
- `{ provider: "umami", websiteId: <your-umami-id> }`: easy, privacy-friendly, open source, GDPR Compliant analytics;
- `{ provider: 'plausible' }`: use [Plausible](https://plausible.io/), a privacy-friendly alternative to Google Analytics; or
- `{ provider: 'google', tagId: <your-google-tag> }`: use Google Analytics
- `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes.
Expand Down Expand Up @@ -79,4 +81,13 @@ transformers: [
]
```

## Caching

<!-- I'm not sure how to explain it in an easy way, this would do for the beginning? -->

In the `workbox.config.ts` you can adjust how caching behaves. This describes what Quartz should save on the persons computer.

The `globPatterns` property defines what kind of files should be cached using Regex.
Further documentation about this file can be found [here](https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-GenerateSWOptions)

If you'd like to make your own plugins, read the guide on [[making plugins]] for more information.
Loading