forked from jackyzha0/quartz
-
Notifications
You must be signed in to change notification settings - Fork 0
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 jackyzh…
…a0-v4
- Loading branch information
Showing
157 changed files
with
7,709 additions
and
1,680 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
production-dependencies: | ||
applies-to: "version-updates" | ||
patterns: | ||
- "*" |
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,88 @@ | ||
name: Docker build & push image | ||
|
||
on: | ||
push: | ||
branches: [v4] | ||
tags: ["v*"] | ||
pull_request: | ||
branches: [v4] | ||
paths: | ||
- .github/workflows/docker-build-push.yaml | ||
- quartz/** | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.repository == 'jackyzha0/quartz' }} # Comment this out if you want to publish your own images on a fork! | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set lowercase repository owner environment variable | ||
run: | | ||
echo "OWNER_LOWERCASE=${OWNER,,}" >> ${GITHUB_ENV} | ||
env: | ||
OWNER: "${{ github.repository_owner }}" | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
driver-opts: | | ||
image=moby/buildkit:master | ||
network=host | ||
- name: Install cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/[email protected] | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata tags and labels on PRs | ||
if: github.event_name == 'pull_request' | ||
id: meta-pr | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz | ||
tags: | | ||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }} | ||
labels: | | ||
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz" | ||
- name: Extract metadata tags and labels for main, release or tag | ||
if: github.event_name != 'pull_request' | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
flavor: | | ||
latest=auto | ||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }} | ||
labels: | | ||
maintainer=${{ github.repository_owner }} | ||
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz" | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
build-args: | | ||
GIT_SHA=${{ env.GITHUB_SHA }} | ||
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }} | ||
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha |
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
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,116 @@ | ||
--- | ||
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 | ||
|
||
// Url to folder with custom themes | ||
// defaults to 'https://${cfg.baseUrl}/static/giscus' | ||
themeUrl?: string | ||
|
||
// filename for light theme .css file | ||
// defaults to 'light' | ||
lightTheme?: string | ||
|
||
// filename for dark theme .css file | ||
// defaults to 'dark' | ||
darkTheme?: 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" | ||
} | ||
} | ||
``` | ||
#### Custom CSS theme | ||
Quartz supports custom theme for Giscus. To use a custom CSS theme, place the `.css` file inside the `quartz/static` folder and set the configuration values. | ||
For example, if you have a light theme `light-theme.css`, a dark theme `dark-theme.css`, and your Quartz site is hosted at `https://example.com/`: | ||
|
||
```ts | ||
afterBody: [ | ||
Component.Comments({ | ||
provider: 'giscus', | ||
options: { | ||
// Other options | ||
themeUrl: "https://example.com/static/giscus", // corresponds to quartz/static/giscus/ | ||
lightTheme: "light-theme", // corresponds to light-theme.css in quartz/static/giscus/ | ||
darkTheme: "dark-theme", // corresponds to dark-theme.css quartz/static/giscus/ | ||
} | ||
}), | ||
], | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
--- | ||
title: AliasRedirects | ||
tags: | ||
- plugin/emitter | ||
--- | ||
|
||
This plugin emits HTML redirect pages for aliases and permalinks defined in the frontmatter of content files. | ||
|
||
For example, A `foo.md` has the following frontmatter | ||
|
||
```md title="foo.md" | ||
--- | ||
title: "Foo" | ||
alias: | ||
- "bar" | ||
--- | ||
``` | ||
|
||
The target `host.me/bar` will be redirected to `host.me/foo` | ||
|
||
Note that these are permanent redirect. | ||
|
||
The emitter supports the following aliases: | ||
|
||
- `aliases` | ||
- `alias` | ||
|
||
> [!note] | ||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. | ||
This plugin has no configuration options. | ||
|
||
## API | ||
|
||
- Category: Emitter | ||
- Function name: `Plugin.AliasRedirects()`. | ||
- Source: [`quartz/plugins/emitters/aliases.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/aliases.ts). |
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,20 @@ | ||
--- | ||
title: Assets | ||
tags: | ||
- plugin/emitter | ||
--- | ||
|
||
This plugin emits all non-Markdown static assets in your content folder (like images, videos, HTML, etc). The plugin respects the `ignorePatterns` in the global [[configuration]]. | ||
|
||
Note that all static assets will then be accessible through its path on your generated site, i.e: `host.me/path/to/static.pdf` | ||
|
||
> [!note] | ||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. | ||
This plugin has no configuration options. | ||
|
||
## API | ||
|
||
- Category: Emitter | ||
- Function name: `Plugin.Assets()`. | ||
- Source: [`quartz/plugins/emitters/assets.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/assets.ts). |
Oops, something went wrong.