Skip to content

Commit 52c0fe7

Browse files
committed
2 parents 8199b8d + cd13ce3 commit 52c0fe7

File tree

110 files changed

+5096
-1373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5096
-1373
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build Preview Deployment
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-preview:
10+
if: ${{ github.repository == 'jackyzha0/quartz' }}
11+
runs-on: ubuntu-latest
12+
name: Build Preview
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
23+
- name: Cache dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-
30+
31+
- run: npm ci
32+
33+
- name: Check types and style
34+
run: npm run check
35+
36+
- name: Build Quartz
37+
run: npx quartz build -d docs -v
38+
39+
- name: Upload build artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: preview-build
43+
path: public

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Node
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 20
29+
node-version: 22
3030

3131
- name: Cache dependencies
3232
uses: actions/cache@v4
@@ -59,7 +59,7 @@ jobs:
5959
- name: Setup Node
6060
uses: actions/setup-node@v4
6161
with:
62-
node-version: 20
62+
node-version: 22
6363
- name: Get package version
6464
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
6565
- name: Create release tag
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Upload Preview Deployment
2+
on:
3+
workflow_run:
4+
workflows: ["Build Preview Deployment"]
5+
types:
6+
- completed
7+
8+
permissions:
9+
actions: read
10+
deployments: write
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
deploy-preview:
16+
if: ${{ github.repository == 'jackyzha0/quartz' && github.event.workflow_run.conclusion == 'success' }}
17+
runs-on: ubuntu-latest
18+
name: Deploy Preview to Cloudflare Pages
19+
steps:
20+
- name: Download build artifact
21+
uses: actions/download-artifact@v4
22+
id: preview-build-artifact
23+
with:
24+
name: preview-build
25+
path: build
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
run-id: ${{ github.event.workflow_run.id }}
28+
29+
- name: Deploy to Cloudflare Pages
30+
uses: AdrianGonz97/refined-cf-pages-action@v1
31+
with:
32+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
33+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
34+
githubToken: ${{ secrets.GITHUB_TOKEN }}
35+
projectName: quartz
36+
deploymentName: Branch Preview
37+
directory: ${{ steps.preview-build-artifact.outputs.download-path }}

.github/workflows/docker-build-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
fetch-depth: 1
2727
- name: Inject slug/short variables
28-
uses: rlespinasse/github-slug-action@v5.0.0
28+
uses: rlespinasse/github-slug-action@v5.1.0
2929
- name: Set up QEMU
3030
uses: docker/setup-qemu-action@v3
3131
- name: Set up Docker Buildx
@@ -37,7 +37,7 @@ jobs:
3737
network=host
3838
- name: Install cosign
3939
if: github.event_name != 'pull_request'
40-
uses: sigstore/[email protected].1
40+
uses: sigstore/[email protected].2
4141
- name: Login to GitHub Container Registry
4242
uses: docker/login-action@v3
4343
if: github.event_name != 'pull_request'

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.9.0
1+
v22.16.0

docs/configuration.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This part of the configuration concerns anything that can affect the whole site.
2727
- `analytics`: what to use for analytics on your site. Values can be
2828
- `null`: don't use analytics;
2929
- `{ provider: 'google', tagId: '<your-google-tag>' }`: use Google Analytics;
30-
- `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: '<your-plausible-host>' }` (self-hosted): use [Plausible](https://plausible.io/);
30+
- `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: 'https://<your-plausible-host>' }` (self-hosted, make sure to include the `https://` protocol prefix): use [Plausible](https://plausible.io/);
3131
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>' }`: use [Umami](https://umami.is/);
3232
- `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com);
3333
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/);
@@ -41,11 +41,12 @@ This part of the configuration concerns anything that can affect the whole site.
4141
- `ignorePatterns`: a list of [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) patterns that Quartz should ignore and not search through when looking for files inside the `content` folder. See [[private pages]] for more details.
4242
- `defaultDateType`: whether to use created, modified, or published as the default date to display on pages and page listings.
4343
- `theme`: configure how the site looks.
44-
- `cdnCaching`: If `true` (default), use Google CDN to cache the fonts. This will generally will be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
44+
- `cdnCaching`: if `true` (default), use Google CDN to cache the fonts. This will generally be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
4545
- `typography`: what fonts to use. Any font available on [Google Fonts](https://fonts.google.com/) works here.
46-
- `header`: Font to use for headers
47-
- `code`: Font for inline and block quotes.
48-
- `body`: Font for everything
46+
- `title`: font for the title of the site (optional, same as `header` by default)
47+
- `header`: font to use for headers
48+
- `code`: font for inline and block quotes
49+
- `body`: font for everything
4950
- `colors`: controls the theming of the site.
5051
- `light`: page background
5152
- `lightgray`: borders

docs/features/breadcrumbs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Component.Breadcrumbs({
1919
spacerSymbol: "", // symbol between crumbs
2020
rootName: "Home", // name of first/root element
2121
resolveFrontmatterTitle: true, // whether to resolve folder names through frontmatter titles
22-
hideOnRoot: true, // whether to hide breadcrumbs on root `index.md` page
2322
showCurrentPage: true, // whether to display the current page in the breadcrumbs
2423
})
2524
```

docs/features/explorer.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ Want to customize it even more?
4343
- Removing explorer: remove `Component.Explorer()` from `quartz.layout.ts`
4444
- (optional): After removing the explorer component, you can move the [[table of contents | Table of Contents]] component back to the `left` part of the layout
4545
- Changing `sort`, `filter` and `map` behavior: explained in [[#Advanced customization]]
46-
- Component:
47-
- Wrapper (Outer component, generates file tree, etc): `quartz/components/Explorer.tsx`
48-
- Explorer node (recursive, either a folder or a file): `quartz/components/ExplorerNode.tsx`
46+
- Component: `quartz/components/Explorer.tsx`
4947
- Style: `quartz/components/styles/explorer.scss`
5048
- Script: `quartz/components/scripts/explorer.inline.ts`
5149

@@ -131,7 +129,8 @@ Using this example, the display names of all `FileNodes` (folders + files) will
131129
```ts title="quartz.layout.ts"
132130
Component.Explorer({
133131
mapFn: (node) => {
134-
return (node.displayName = node.displayName.toUpperCase())
132+
node.displayName = node.displayName.toUpperCase()
133+
return node
135134
},
136135
})
137136
```
@@ -145,8 +144,12 @@ Note that this example filters on the title but you can also do it via slug or a
145144
Component.Explorer({
146145
filterFn: (node) => {
147146
// set containing names of everything you want to filter out
148-
const omit = new Set(["authoring content", "tags", "hosting"])
149-
return !omit.has(node.data.title.toLowerCase())
147+
const omit = new Set(["authoring content", "tags", "advanced"])
148+
149+
// can also use node.slug or by anything on node.data
150+
// note that node.data is only present for files that exist on disk
151+
// (e.g. implicit folder nodes that have no associated index.md)
152+
return !omit.has(node.displayName.toLowerCase())
150153
},
151154
})
152155
```
@@ -159,7 +162,7 @@ You can access the tags of a file by `node.data.tags`.
159162
Component.Explorer({
160163
filterFn: (node) => {
161164
// exclude files with the tag "explorerexclude"
162-
return node.data.tags.includes("explorerexclude") !== true
165+
return node.data.tags?.includes("explorerexclude") !== true
163166
},
164167
})
165168
```
@@ -183,7 +186,7 @@ Component.Explorer({
183186
> and passing it in.
184187
>
185188
> ```ts title="quartz.layout.ts"
186-
> import { Options } from "./quartz/components/ExplorerNode"
189+
> import { Options } from "./quartz/components/Explorer"
187190
>
188191
> export const mapFn: Options["mapFn"] = (node) => {
189192
> // implement your function here

docs/features/private pages.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ There may be some notes you want to avoid publishing as a website. Quartz suppor
1313
If you'd like to only publish a select number of notes, you can instead use [[ExplicitPublish]] which will filter out all notes except for any that have `publish: true` in the frontmatter.
1414

1515
> [!warning]
16-
> Regardless of the filter plugin used, **all non-markdown files will be emitted and available publically in the final build.** This includes files such as images, voice recordings, PDFs, etc. One way to prevent this and still be able to embed local images is to create a folder specifically for public media and add the following two patterns to the ignorePatterns array.
17-
>
18-
> `"!(PublicMedia)**/!(*.md)", "!(*.md)"`
16+
> Regardless of the filter plugin used, **all non-markdown files will be emitted and available publically in the final build.** This includes files such as images, voice recordings, PDFs, etc.
1917
2018
## `ignorePatterns`
2119

@@ -28,7 +26,7 @@ Common examples include:
2826

2927
- `some/folder`: exclude the entire of `some/folder`
3028
- `*.md`: exclude all files with a `.md` extension
31-
- `!*.md` exclude all files that _don't_ have a `.md` extension
29+
- `!(*.md)` exclude all files that _don't_ have a `.md` extension. Note that negations _must_ parenthesize the rest of the pattern!
3230
- `**/private`: exclude any files or folders named `private` at any level of nesting
3331

3432
> [!warning]

docs/features/reader mode.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Reader Mode
3+
tags:
4+
- component
5+
---
6+
7+
Reader Mode is a feature that allows users to focus on the content by hiding the sidebars and other UI elements. When enabled, it provides a clean, distraction-free reading experience.
8+
9+
## Configuration
10+
11+
Reader Mode is enabled by default. To disable it, you can remove the component from your layout configuration in `quartz.layout.ts`:
12+
13+
```ts
14+
// Remove or comment out this line
15+
Component.ReaderMode(),
16+
```
17+
18+
## Usage
19+
20+
The Reader Mode toggle appears as a button with a book icon. When clicked:
21+
22+
- Sidebars are hidden
23+
- Hovering over the content area reveals the sidebars temporarily
24+
25+
Unlike Dark Mode, Reader Mode state is not persisted between page reloads but is maintained during SPA navigation within the site.
26+
27+
## Customization
28+
29+
You can customize the appearance of Reader Mode through CSS variables and styles. The component uses the following classes:
30+
31+
- `.readermode`: The toggle button
32+
- `.readerIcon`: The book icon
33+
- `[reader-mode="on"]`: Applied to the root element when Reader Mode is active
34+
35+
Example customization in your custom CSS:
36+
37+
```scss
38+
.readermode {
39+
// Customize the button
40+
svg {
41+
stroke: var(--custom-color);
42+
}
43+
}
44+
```

0 commit comments

Comments
 (0)