-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v4' of https://github.com/jackyzha0/quartz into v4
- Loading branch information
Showing
118 changed files
with
3,152 additions
and
1,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- v4 | ||
push: | ||
branches: | ||
- v4 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
if: ${{ github.repository == 'jackyzha0/quartz' }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm ci | ||
|
||
- name: Check types and style | ||
run: npm run check | ||
|
||
- name: Test | ||
run: npm test | ||
|
||
- name: Ensure Quartz builds, check bundle info | ||
run: npx quartz build --bundleInfo | ||
|
||
publish-tag: | ||
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v4' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Get package version | ||
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV | ||
- name: Create release tag | ||
uses: pkgdeps/git-tag-action@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_repo: ${{ github.repository }} | ||
version: ${{ env.PACKAGE_VERSION }} | ||
git_commit_sha: ${{ github.sha }} | ||
git_tag_prefix: "v" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "Roam Research Compatibility" | ||
tags: | ||
- feature/transformer | ||
--- | ||
|
||
[Roam Research](https://roamresearch.com) is a note-taking tool that organizes your knowledge graph in a unique and interconnected way. | ||
|
||
Quartz supports transforming the special Markdown syntax from Roam Research (like `{{[[components]]}}` and other formatting) into | ||
regular Markdown via the [[RoamFlavoredMarkdown]] plugin. | ||
|
||
```typescript title="quartz.config.ts" | ||
plugins: { | ||
transformers: [ | ||
// ... | ||
Plugin.RoamFlavoredMarkdown(), | ||
Plugin.ObsidianFlavoredMarkdown(), | ||
// ... | ||
], | ||
}, | ||
``` | ||
|
||
> [!warning] | ||
> As seen above placement of `Plugin.RoamFlavoredMarkdown()` within `quartz.config.ts` is very important. It must come before `Plugin.ObsidianFlavoredMarkdown()`. | ||
## Customization | ||
|
||
This functionality is provided by the [[RoamFlavoredMarkdown]] plugin. See the plugin page for customization options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: Comments | ||
tags: | ||
- component | ||
--- | ||
|
||
Quartz also has the ability to hook into various providers to enable readers to leave comments on your site. | ||
|
||
![[giscus-example.png]] | ||
|
||
As of today, only [Giscus](https://giscus.app/) is supported out of the box but PRs to support other providers are welcome! | ||
|
||
## Providers | ||
|
||
### Giscus | ||
|
||
First, make sure that the [[setting up your GitHub repository|GitHub]] repository you are using for your Quartz meets the following requirements: | ||
|
||
1. The **repository is [public](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/setting-repository-visibility#making-a-repository-public)**, otherwise visitors will not be able to view the discussion. | ||
2. The **[giscus](https://github.com/apps/giscus) app is installed**, otherwise visitors will not be able to comment and react. | ||
3. The **Discussions feature is turned on** by [enabling it for your repository](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/enabling-or-disabling-github-discussions-for-a-repository). | ||
|
||
Then, use the [Giscus site](https://giscus.app/#repository) to figure out what your `repoId` and `categoryId` should be. Make sure you select `Announcements` for the Discussion category. | ||
|
||
![[giscus-repo.png]] | ||
|
||
![[giscus-discussion.png]] | ||
|
||
After entering both your repository and selecting the discussion category, Giscus will compute some IDs that you'll need to provide back to Quartz. You won't need to manually add the script yourself as Quartz will handle that part for you but will need these values in the next step! | ||
|
||
![[giscus-results.png]] | ||
|
||
Finally, in `quartz.layout.ts`, edit the `afterBody` field of `sharedPageComponents` to include the following options but with the values you got from above: | ||
|
||
```ts title="quartz.layout.ts" | ||
afterBody: [ | ||
Component.Comments({ | ||
provider: 'giscus', | ||
options: { | ||
// from data-repo | ||
repo: 'jackyzha0/quartz', | ||
// from data-repo-id | ||
repoId: 'MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg', | ||
// from data-category | ||
category: 'Announcements', | ||
// from data-category-id | ||
categoryId: 'DIC_kwDOFxRnmM4B-Xg6', | ||
} | ||
}), | ||
], | ||
``` | ||
|
||
### Customization | ||
|
||
Quartz also exposes a few of the other Giscus options as well and you can provide them the same way `repo`, `repoId`, `category`, and `categoryId` are provided. | ||
|
||
```ts | ||
type Options = { | ||
provider: "giscus" | ||
options: { | ||
repo: `${string}/${string}` | ||
repoId: string | ||
category: string | ||
categoryId: string | ||
|
||
// how to map pages -> discussions | ||
// defaults to 'url' | ||
mapping?: "url" | "title" | "og:title" | "specific" | "number" | "pathname" | ||
|
||
// use strict title matching | ||
// defaults to true | ||
strict?: boolean | ||
|
||
// whether to enable reactions for the main post | ||
// defaults to true | ||
reactionsEnabled?: boolean | ||
|
||
// where to put the comment input box relative to the comments | ||
// defaults to 'bottom' | ||
inputPosition?: "top" | "bottom" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.