Jacky Zhao
2023-09-20 6a9e6352e88aa9ff18e5b33cf2de442a250bd960
Revert "feat: Making Quartz available offline by making it a PWA (#465)"

This reverts commit d6301fae90d9f922618bf0f413e273156731eef7.
4 files deleted
9 files modified
241 ■■■■■ changed files
docs/configuration.md 2 ●●●●● patch | view | raw | blame | history
docs/features/offline access.md 31 ●●●●● patch | view | raw | blame | history
docs/index.md 2 ●●● patch | view | raw | blame | history
package-lock.json 9 ●●●●● patch | view | raw | blame | history
package.json 2 ●●● patch | view | raw | blame | history
quartz.config.ts 1 ●●●● patch | view | raw | blame | history
quartz/cfg.ts 1 ●●●● patch | view | raw | blame | history
quartz/components/Head.tsx 4 ●●●● patch | view | raw | blame | history
quartz/components/pages/OfflineFallbackPage.tsx 12 ●●●●● patch | view | raw | blame | history
quartz/plugins/emitters/componentResources.ts 5 ●●●●● patch | view | raw | blame | history
quartz/plugins/emitters/index.ts 1 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/offline.ts 97 ●●●●● patch | view | raw | blame | history
quartz/static/icon.svg 74 ●●●●● patch | view | raw | blame | history
docs/configuration.md
@@ -21,12 +21,10 @@
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.
docs/features/offline access.md
File was deleted
docs/index.md
@@ -30,7 +30,7 @@
## ðŸ”§ Features
- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], [[offline access]] and [many more](./features) right out of the box
- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], and [many more](./features) right out of the box
- Hot-reload for both configuration and content
- Simple JSX layouts and [[creating components|page components]]
- [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes
package-lock.json
@@ -73,7 +73,7 @@
        "@types/flexsearch": "^0.7.3",
        "@types/hast": "^2.3.4",
        "@types/js-yaml": "^4.0.5",
        "@types/node": "^20.6.2",
        "@types/node": "^20.1.2",
        "@types/pretty-time": "^1.1.2",
        "@types/source-map-support": "^0.5.6",
        "@types/workerpool": "^6.4.0",
@@ -113,7 +113,6 @@
    },
    "node_modules/@clack/prompts/node_modules/is-unicode-supported": {
      "version": "1.3.0",
      "extraneous": true,
      "inBundle": true,
      "license": "MIT",
      "engines": {
@@ -1464,9 +1463,9 @@
      }
    },
    "node_modules/@types/node": {
      "version": "20.6.2",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz",
      "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==",
      "version": "20.3.3",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz",
      "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==",
      "dev": true
    },
    "node_modules/@types/parse5": {
package.json
@@ -94,7 +94,7 @@
    "@types/flexsearch": "^0.7.3",
    "@types/hast": "^2.3.4",
    "@types/js-yaml": "^4.0.5",
    "@types/node": "^20.6.2",
    "@types/node": "^20.1.2",
    "@types/pretty-time": "^1.1.2",
    "@types/source-map-support": "^0.5.6",
    "@types/workerpool": "^6.4.0",
quartz.config.ts
@@ -4,7 +4,6 @@
const config: QuartzConfig = {
  configuration: {
    pageTitle: "🪴 Quartz 4.0",
    description: "Quartz Documentation Page and Demo",
    enableSPA: true,
    enablePopovers: true,
    analytics: {
quartz/cfg.ts
@@ -19,7 +19,6 @@
export interface GlobalConfiguration {
  pageTitle: string
  description: string
  /** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */
  enableSPA: boolean
  /** Whether to display Wikipedia-style popovers when hovering over links */
quartz/components/Head.tsx
@@ -14,8 +14,6 @@
    const iconPath = joinSegments(baseDir, "static/icon.png")
    const ogImagePath = `https://${cfg.baseUrl}/static/og-image.png`
    const manifest =
      cfg.baseUrl == undefined ? "/manifest.json" : `https://${cfg.baseUrl}/manifest.json`
    return (
      <head>
@@ -27,9 +25,7 @@
        {cfg.baseUrl && <meta property="og:image" content={ogImagePath} />}
        <meta property="og:width" content="1200" />
        <meta property="og:height" content="675" />
        <meta name="theme-color" content="#faf8f8" />
        <link rel="icon" href={iconPath} />
        <link rel="manifest" href={manifest} />
        <meta name="description" content={description} />
        <meta name="generator" content="Quartz" />
        <link rel="preconnect" href="https://fonts.googleapis.com" />
quartz/components/pages/OfflineFallbackPage.tsx
File was deleted
quartz/plugins/emitters/componentResources.ts
@@ -116,11 +116,6 @@
        document.dispatchEvent(event)`)
  }
  componentResources.afterDOMLoaded.push(`
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('/sw.js');
  }`)
  let wsUrl = `ws://localhost:${ctx.argv.wsPort}`
  if (ctx.argv.remoteDevHost) {
quartz/plugins/emitters/index.ts
@@ -7,4 +7,3 @@
export { Static } from "./static"
export { ComponentResources } from "./componentResources"
export { NotFoundPage } from "./404"
export { Offline } from "./offline"
quartz/plugins/emitters/offline.ts
File was deleted
quartz/static/icon.svg
File was deleted