pnpm run format

This commit is contained in:
semanticdata 2024-03-14 12:28:44 -05:00
parent bea7d9fccc
commit 75d6af9422
234 changed files with 11896 additions and 12550 deletions

View File

@ -6,22 +6,18 @@ labels: bug
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**Describe the bug** A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
**To Reproduce** Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Expected behavior** A clear and concise description of what you expected to happen.
**Screenshots and Source**
If applicable, add screenshots to help explain your problem.
**Screenshots and Source** If applicable, add screenshots to help explain your problem.
You can help speed up fixing the problem by either
@ -36,5 +32,4 @@ You can help speed up fixing the problem by either
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
**Additional context**
Add any other context about the problem here.
**Additional context** Add any other context about the problem here.

View File

@ -6,14 +6,10 @@ labels: enhancement
assignees: ""
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe the solution you'd like** A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
**Additional context** Add any other context or screenshots about the feature request here.

View File

@ -1,10 +1,6 @@
# 🌱 Forgetful Notes
![code size](https://img.shields.io/github/languages/code-size/semanticdata/forgetful-notes)
![repository size](https://img.shields.io/github/repo-size/semanticdata/forgetful-notes)
![commits](https://img.shields.io/github/commit-activity/t/semanticdata/forgetful-notes)
![last commit](https://img.shields.io/github/last-commit/semanticdata/forgetful-notes)
![is website up?](https://img.shields.io/website/https/forgetfulnotes.com.svg)
![code size](https://img.shields.io/github/languages/code-size/semanticdata/forgetful-notes) ![repository size](https://img.shields.io/github/repo-size/semanticdata/forgetful-notes) ![commits](https://img.shields.io/github/commit-activity/t/semanticdata/forgetful-notes) ![last commit](https://img.shields.io/github/last-commit/semanticdata/forgetful-notes) ![is website up?](https://img.shields.io/website/https/forgetfulnotes.com.svg)
This repository holds the source code for [Forgetful Notes](https://forgetfulnotes.com)—my digital garden of knowledge. It serves as a platform for my learning and creative endeavours. A space for thinking through, building upon, and coming back to.
@ -107,7 +103,7 @@ You can add custom CSS code within `/quartz/styles/custom.scss`. You will then n
### Fonts
| Used in: | Font Family | Previous Font |
| -------- | :------------------------------------------------------: | :----------------------------------------------------------------------: |
| --- | :-: | :-: |
| Headers | [Bitter](https://fonts.google.com/specimen/Bitter) | [Schibsted Grotesk](https://fonts.google.com/specimen/Schibsted+Grotesk) |
| Body | [Bitter](https://fonts.google.com/specimen/Bitter) | [Source Sans Pro](https://fonts.google.com/specimen/Source+Sans+3) |
| Code | [Fira Mono](https://fonts.google.com/specimen/Fira+Mono) | [IBM Plex Mono](https://fonts.google.com/specimen/IBM+Plex+Mono) |

View File

@ -27,7 +27,7 @@ Here are some places you can find me on the web. You'll probably be able to find
### Past Titles and Roles
| Title | Description |
| :------------------------------------- | :-------------------------------------------------------------------------------------------------- |
| :-- | :-- |
| Civil Engineering Technician | Work under Engineers and Architects providing daily site visits and technical design assistance. |
| Crew Lead | Lead small construction crew throughout mountain road culverts installation. |
| Construction Materials Technician | Materials Lab - Asphalt, Concrete, and Soil testing. Nuclear gauge certified. |

View File

@ -13,8 +13,7 @@ They can be connected to another atomic note or idea in some way. By breaking do
## Example Atomic Note
Title: Atomic Note: Importance of Exercise
Tags: #exercise #health #wellness
Title: Atomic Note: Importance of Exercise Tags: #exercise #health #wellness
Regular exercise confers numerous health benefits, including:

View File

@ -64,8 +64,7 @@ Below are maps showing the most southern extent of where aurora might be observa
### July 12th, 2023
![NOAA Space Weather Prediction Center - G-Kp](https://www.swpc.noaa.gov/sites/default/files/images/u2/Aurora_Kp_MapNorthAm.png)
G is NOAA Geomagnetic Storm Index (05)
![NOAA Space Weather Prediction Center - G-Kp](https://www.swpc.noaa.gov/sites/default/files/images/u2/Aurora_Kp_MapNorthAm.png) G is NOAA Geomagnetic Storm Index (05)
Kp is Planetary K Index (09)
### September 18th, 2023

View File

@ -32,8 +32,7 @@ The MV Derbyshire was a British ore-bulk-oil combination carrier built in 1976.
## Rogue Waves
Rogue waves are unusually large, unpredictable, and suddenly appearing surface waves that can be extremely dangerous to ships, even to large ones.
In oceanography, rogue waves are more precisely defined as waves whose height is more than twice the significant wave height (Hs or SWH), which is itself defined as the mean of the largest third of waves in a wave record. Therefore, rogue waves are not necessarily the biggest waves found on the water; they are, rather, unusually large waves for a given sea state.
Rogue waves are unusually large, unpredictable, and suddenly appearing surface waves that can be extremely dangerous to ships, even to large ones. In oceanography, rogue waves are more precisely defined as waves whose height is more than twice the significant wave height (Hs or SWH), which is itself defined as the mean of the largest third of waves in a wave record. Therefore, rogue waves are not necessarily the biggest waves found on the water; they are, rather, unusually large waves for a given sea state.
[Source](https://en.wikipedia.org/wiki/Rogue_wave)
## Sea Sickness

View File

@ -15,23 +15,13 @@ When you are looking at a tab, you will see six horizontal lines. These lines re
An [[./Arpeggio|arpeggio]] is a type of [[./Chords|broken chord]] in which the notes that compose a chord are individually sounded in a progressive rising or descending order. Arpeggios on keyboard instruments may be called _rolled chords_.
```md
e|--------2-----------------|
B|------3---3---------------|
G|----2-------2-------------|
D|--0-----------------------|
A|--------------------------|
E|--------------------------|
e|--------2-----------------| B|------3---3---------------| G|----2-------2-------------| D|--0-----------------------| A|--------------------------| E|--------------------------|
```
### Metallica Enter the Sandman (Intro)
```md
e|---------------------|------------------|---------------|--------------------|
B|---------------------|------------------|---------------|--------------------|
G|---------------------|------------------|---------------|--------------------|
D|-------5-------------|----5-------------|----5----------|--------------------|
A|----7-----------7----|-7-----------7----|-7-----------7-|--------------------|
E|-0--------6--5-----0-|-------6--5-----0-|-------6--5----|--------------------|
e|---------------------|------------------|---------------|--------------------| B|---------------------|------------------|---------------|--------------------| G|---------------------|------------------|---------------|--------------------| D|-------5-------------|----5-------------|----5----------|--------------------| A|----7-----------7----|-7-----------7----|-7-----------7-|--------------------| E|-0--------6--5-----0-|-------6--5-----0-|-------6--5----|--------------------|
```
### Pasted

View File

@ -59,8 +59,7 @@ You can [link](https://example.dom/) to external pages. and other internal [[./M
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
> `Markdown.generate();`
> Here's some example code: `Markdown.generate();`
## Lists
@ -140,7 +139,7 @@ In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla e
### Simple Example
| Title 1 | Title 2 | Title 3 | Title 4 |
| --------------------- | --------------------- | --------------------- | --------------------- |
| --- | --- | --- | --- |
| lorem | lorem ipsum | lorem ipsum dolor | lorem ipsum dolor sit |
| lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit |
| lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit |
@ -149,7 +148,7 @@ In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla e
### Longer Example
| Title 1 | Title 2 | Title 3 | Title 4 |
| -------------------------- | -------------------------------------- | -------------------------- | -------------------------------------- |
| --- | --- | --- | --- |
| lorem | lorem ipsum | lorem ipsum dolor | lorem ipsum dolor sit |
| lorem ipsum dolor sit amet | lorem ipsum dolor sit amet consectetur | lorem ipsum dolor sit amet | lorem ipsum dolor sit |
| lorem ipsum dolor | lorem ipsum | lorem | lorem ipsum |
@ -158,7 +157,7 @@ In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla e
### Inline Markdown Within Tables
| Inline    | Markdown    | In    | Table |
| ------------------------ | -------------------------- | ----------------------------------- | ------ |
| --- | --- | --- | --- |
| _italics_ | **bold** | ~~strikethrough~~    | `code` |
## Horizontal Rule

View File

@ -9,8 +9,7 @@ tags: [stub]
Markdown is a lightweight [[./Markup Language|Markup Language]] that you can use to add formatting elements to plaintext text documents. Created by [John Gruber](https://daringfireball.net/projects/markdown/) in 2004, Markdown is now one of the world's most popular markup languages.
> [!Note]
> This website's content is exclusively written in Markdown.
> [!Note] This website's content is exclusively written in Markdown.
## Markdown Flavors

View File

@ -80,7 +80,7 @@ NeoVim is a fork of Vim focused on extensibility and usability. This is my short
## Plugins
| Author/Plugin | Description |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| --- | --- |
| [akinsho/bufferline.nvim](https://github.com/akinsho/bufferline.nvim) | A snazzy bufferline for Neovim. |
| [akinsho/toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim) | A neovim lua plugin to help easily manage multiple terminal windows. |
| [ap/vim-css-color](https://github.com/ap/vim-css-color) | Preview colours in source code while editing. |

View File

@ -22,10 +22,7 @@ Sometimes poetry is most impactful when it's listened to rather than read. Take
> [!quote] The Cold Wind Blows by Kelly Roper
>
> Who knows why the cold wind blows
> Or where it goes, or what it knows.
> It only flows in passionate throes
> Until it finally slows and settles in repose.
> Who knows why the cold wind blows Or where it goes, or what it knows. It only flows in passionate throes Until it finally slows and settles in repose.
Poets create _sound_ in a variety of ways, like alliteration, assonance, and consonance.
@ -41,15 +38,7 @@ Stressed and unstressed syllables aren't the only way you can create rhythm in y
> [!quote] Still I Rise by Maya Angelou
>
> Leaving behind nights of terror and fear
> I rise
> Into a daybreak that's wondrously clear
> I rise
> Bringing the gifts that my ancestors gave,
> I am the dream and the hope of the slave.
> I rise
> I rise
> I rise.
> Leaving behind nights of terror and fear I rise Into a daybreak that's wondrously clear I rise Bringing the gifts that my ancestors gave, I am the dream and the hope of the slave. I rise I rise I rise.
## Time to Rhyme
@ -57,10 +46,7 @@ With poetry, rhythm and rhyme go hand in hand. Both create musicality in the poe
> [!quote] Jabberwocky by Lewis Carrol
>
> One, two! One, two! And through and through
> The vorpal blade went snicker-snack!
> He left it dead, and with its head
> He went galumphing back.
> One, two! One, two! And through and through The vorpal blade went snicker-snack! He left it dead, and with its head He went galumphing back.
## Formatting

View File

@ -39,10 +39,7 @@ compartir: true
## Ashtavakra Gita
> "The wise man knows the Self,
> And he plays the game of life.
> But the fool lives in the world
> Like a beast of burden."
> "The wise man knows the Self, And he plays the game of life. But the fool lives in the world Like a beast of burden."
## Big Mouth
@ -130,8 +127,7 @@ compartir: true
>
> I don't know. The only thing I do know… is that we have to be kind.
>
> Please. Be kind… especially when we don't know what's going on.
> I know you see yourself as a fighter. Well, I see myself as one too. This is how I fight."
> Please. Be kind… especially when we don't know what's going on. I know you see yourself as a fighter. Well, I see myself as one too. This is how I fight."
## Yuval Noah Harari

View File

@ -9,8 +9,7 @@ tags: [stub]
Rhizomatic learning is a variety of pedagogical practices informed by the work of Gilles Deleuze and Félix Guattari. It takes it's name from the rhizome.
> [!Rhizome]
> Underground stem in which various plants asexually reproduce via budding.
> [!Rhizome] Underground stem in which various plants asexually reproduce via budding.
## Background

View File

@ -48,8 +48,7 @@ Let's break it down:
### Price
Based on price per $1.
Selected $0.10 as the baseline after averaging some calculations.
Based on price per $1. Selected $0.10 as the baseline after averaging some calculations.
- 1 point for every $0.01 / GB below $0.10
@ -120,7 +119,7 @@ Selected $0.10 as the baseline after averaging some calculations.
### SSD
| Description | $ / GB | 1 per cent | 1 per GB | Coefficient | Score |
| ------------------------- | :----: | :--------: | :------: | :---------: | :---: |
| --- | :-: | :-: | :-: | :-: | :-: |
| Inland 1TB $50 TLC | 0.050 | 5 | 1000 | 1 | 1005 |
| Inland 512GB $25 TLC | 0.049 | 5.1 | 512 | 1 | 517 |
| Platinum 2TB $80 TLC | 0.040 | 6 | 2000 | 1 | 2006 |

View File

@ -13,6 +13,6 @@ In typography and lettering, a "sans-serif", "sans serif", "gothic", or simply "
```css
font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
"Nimbus Sans L", Roboto, Noto, "Segoe UI", Arial, Helvetica,
"Helvetica Neue", sans-serif;
"Nimbus Sans L", Roboto, Noto, "Segoe UI", Arial, Helvetica, "Helvetica Neue",
sans-serif;
```

View File

@ -14,8 +14,7 @@ compartir: true
### Anodyne (adjective)
1. Capable of soothing or eliminating pain.
2. Not likely to offend or arouse tensions.
Also used as a _noun_ to describe something that soothes, calms, or comforts.
2. Not likely to offend or arouse tensions. Also used as a _noun_ to describe something that soothes, calms, or comforts.
### Arete (noun)

View File

@ -2,8 +2,7 @@
title: Creating your own Quartz components
---
> [!warning]
> This guide assumes you have experience writing JavaScript and are familiar with TypeScript.
> [!warning] This guide assumes you have experience writing JavaScript and are familiar with TypeScript.
Normally on the web, we write layout code using HTML which looks something like the following:
@ -116,8 +115,7 @@ export default (() => {
}) satisfies QuartzComponentConstructor
```
> [!warning]
> Quartz does not use CSS modules so any styles you declare here apply _globally_. If you only want it to apply to your component, make sure you use specific class names and selectors.
> [!warning] Quartz does not use CSS modules so any styles you declare here apply _globally_. If you only want it to apply to your component, make sure you use specific class names and selectors.
### Scripts and Interactivity
@ -142,8 +140,7 @@ export default (() => {
}) satisfies QuartzComponentConstructor
```
> [!hint]
> For those coming from React, Quartz components are different from React components in that it only uses JSX for templating and layout. Hooks like `useEffect`, `useState`, etc. are not rendered and other properties that accept functions like `onClick` handlers will not work. Instead, do it using a regular JS script that modifies the DOM element directly.
> [!hint] For those coming from React, Quartz components are different from React components in that it only uses JSX for templating and layout. Hooks like `useEffect`, `useState`, etc. are not rendered and other properties that accept functions like `onClick` handlers will not work. Instead, do it using a regular JS script that modifies the DOM element directly.
As the names suggest, the `.beforeDOMLoaded` scripts are executed _before_ the page is done loading so it doesn't have access to any elements on the page. This is mostly used to prefetch any critical data.
@ -161,8 +158,7 @@ document.addEventListener("nav", () => {
})
```
It is best practice to track any event handlers via `window.addCleanup` to prevent memory leaks.
This will get called on page navigation.
It is best practice to track any event handlers via `window.addCleanup` to prevent memory leaks. This will get called on page navigation.
#### Importing Code
@ -230,5 +226,4 @@ export default (() => {
}) satisfies QuartzComponentConstructor
```
> [!hint]
> Look in `quartz/components` for more examples of components in Quartz as reference for your own components!
> [!hint] Look in `quartz/components` for more examples of components in Quartz as reference for your own components!

View File

@ -2,8 +2,7 @@
title: Making your own plugins
---
> [!warning]
> This part of the documentation will assume you have working knowledge in TypeScript and will include code snippets that describe the interface of what Quartz plugins should look like.
> [!warning] This part of the documentation will assume you have working knowledge in TypeScript and will include code snippets that describe the interface of what Quartz plugins should look like.
Quartz's plugins are a series of transformations over content. This is illustrated in the diagram of the processing pipeline below:
@ -319,5 +318,4 @@ export const ContentPage: QuartzEmitterPlugin = () => {
Note that it takes in a `FullPageLayout` as the options. It's made by combining a `SharedLayout` and a `PageLayout` both of which are provided through the `quartz.layout.ts` file.
> [!hint]
> Look in `quartz/plugins` for more examples of plugins in Quartz as reference for your own plugins!
> [!hint] Look in `quartz/plugins` for more examples of plugins in Quartz as reference for your own plugins!

View File

@ -36,8 +36,7 @@ Some common frontmatter fields that are natively supported by Quartz:
## Syncing your Content
When your Quartz is at a point you're happy with, you can save your changes to GitHub.
First, make sure you've [[setting up your GitHub repository|already setup your GitHub repository]] and then do `npx quartz sync`.
When your Quartz is at a point you're happy with, you can save your changes to GitHub. First, make sure you've [[setting up your GitHub repository|already setup your GitHub repository]] and then do `npx quartz sync`.
## Customization

View File

@ -10,8 +10,7 @@ npx quartz build --serve
This will start a local web server to run your Quartz on your computer. Open a web browser and visit `http://localhost:8080/` to view it.
> [!hint] Flags and options
> For full help options, you can run `npx quartz build --help`.
> [!hint] Flags and options For full help options, you can run `npx quartz build --help`.
>
> Most of these have sensible defaults but you can override them if you have a custom setup:
>

View File

@ -4,8 +4,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`.
> [!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!
> [!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!
The configuration of Quartz can be broken down into two main parts:
@ -71,8 +70,7 @@ plugins: {
You can customize the behaviour of Quartz by adding, removing and reordering plugins in the `transformers`, `filters` and `emitters` fields.
> [!note]
> Each node is modified by every transformer _in order_. Some transformers are position sensitive, so you may need to pay particular attention to whether they need to come before or after certain other plugins.
> [!note] Each node is modified by every transformer _in order_. Some transformers are position sensitive, so you may need to pay particular attention to whether they need to come before or after certain other plugins.
You should take care to add the plugin to the right entry corresponding to its plugin type. For example, to add the [[ExplicitPublish]] plugin (a [[tags/plugin/filter|Filter]]), you would add the following line:

View File

@ -39,8 +39,7 @@ a & b & c
\end{bmatrix}
$$
> [!warn]
> Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above.
> [!warn] Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above.
### Inline Math
@ -59,8 +58,7 @@ For example:
### Using mhchem
Add the following import to the top of `quartz/plugins/transformers/latex.ts` (before all the other
imports):
Add the following import to the top of `quartz/plugins/transformers/latex.ts` (before all the other imports):
```ts title="quartz/plugins/transformers/latex.ts"
import "katex/contrib/mhchem"

View File

@ -8,8 +8,7 @@ Quartz supports Mermaid which allows you to add diagrams and charts to your note
By default, Quartz will render Mermaid diagrams to match the site theme.
> [!warning]
> Wondering why Mermaid diagrams may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
> [!warning] Wondering why Mermaid diagrams may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
## Syntax

View File

@ -18,8 +18,7 @@ This includes
See [documentation on supported types and syntax here](https://help.obsidian.md/Editing+and+formatting/Callouts).
> [!warning]
> Wondering why callouts may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
> [!warning] Wondering why callouts may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
## Customization
@ -42,13 +41,11 @@ By default, custom callouts are handled by applying the `note` style. To make fa
}
```
> [!warning]
> Don't forget to ensure that the SVG is URL encoded before putting it in the CSS. You can use tools like [this one](https://yoksel.github.io/url-encoder/) to help you do that.
> [!warning] Don't forget to ensure that the SVG is URL encoded before putting it in the CSS. You can use tools like [this one](https://yoksel.github.io/url-encoder/) to help you do that.
## Showcase
> [!info]
> Default title
> [!info] Default title
> [!question]+ Can callouts be _nested_?
>
@ -56,41 +53,28 @@ By default, custom callouts are handled by applying the `note` style. To make fa
> >
> > > [!example] You can even use multiple layers of nesting.
> [!note]
> Aliases: "note"
> [!note] Aliases: "note"
> [!abstract]
> Aliases: "abstract", "summary", "tldr"
> [!abstract] Aliases: "abstract", "summary", "tldr"
> [!info]
> Aliases: "info"
> [!info] Aliases: "info"
> [!todo]
> Aliases: "todo"
> [!todo] Aliases: "todo"
> [!tip]
> Aliases: "tip", "hint", "important"
> [!tip] Aliases: "tip", "hint", "important"
> [!success]
> Aliases: "success", "check", "done"
> [!success] Aliases: "success", "check", "done"
> [!question]
> Aliases: "question", "help", "faq"
> [!question] Aliases: "question", "help", "faq"
> [!warning]
> Aliases: "warning", "attention", "caution"
> [!warning] Aliases: "warning", "attention", "caution"
> [!failure]
> Aliases: "failure", "missing", "fail"
> [!failure] Aliases: "failure", "missing", "fail"
> [!danger]
> Aliases: "danger", "error"
> [!danger] Aliases: "danger", "error"
> [!bug]
> Aliases: "bug"
> [!bug] Aliases: "bug"
> [!example]
> Aliases: "example"
> [!example] Aliases: "example"
> [!quote]
> Aliases: "quote", "cite"
> [!quote] Aliases: "quote", "cite"

View File

@ -10,8 +10,7 @@ By default, it shows all folders and files on your page. To display the explorer
Display names for folders get determined by the `title` frontmatter field in `folder/index.md` (more detail in [[authoring content | Authoring Content]]). If this file does not exist or does not contain frontmatter, the local folder name will be used instead.
> [!info]
> The explorer uses local storage by default to save the state of your explorer. This is done to ensure a smooth experience when navigating to different pages.
> [!info] The explorer uses local storage by default to save the state of your explorer. This is done to ensure a smooth experience when navigating to different pages.
>
> To clear/delete the explorer state from local storage, delete the `fileTree` entry (guide on how to delete a key from local storage in chromium based browsers can be found [here](https://docs.devolutions.net/kb/general-knowledge-base/clear-browser-local-storage/clear-chrome-local-storage/)). You can disable this by passing `useSavedState: false` as an argument.
@ -53,8 +52,7 @@ Want to customize it even more?
## Advanced customization
This component allows you to fully customize all of its behavior. You can pass a custom `sort`, `filter` and `map` function.
All functions you can pass work with the `FileNode` class, which has the following properties:
This component allows you to fully customize all of its behavior. You can pass a custom `sort`, `filter` and `map` function. All functions you can pass work with the `FileNode` class, which has the following properties:
```ts title="quartz/components/ExplorerNode.tsx" {2-5}
export class FileNode {
@ -105,8 +103,7 @@ filterFn: (node: FileNode) => boolean
mapFn: (node: FileNode) => void
```
> [!tip]
> You can check if a `FileNode` is a folder or a file like this:
> [!tip] You can check if a `FileNode` is a folder or a file like this:
>
> ```ts
> if (node.file) {
@ -175,9 +172,7 @@ You can access the frontmatter of a file by `node.file?.frontmatter?`. This allo
Component.Explorer({
filterFn: (node) => {
// exclude files with the tag "explorerexclude"
return (
node.file?.frontmatter?.tags?.includes("explorerexclude") !== true
)
return node.file?.frontmatter?.tags?.includes("explorerexclude") !== true
},
})
```
@ -194,9 +189,7 @@ Component.Explorer({
## Advanced examples
> [!tip]
> When writing more complicated functions, the `layout` file can start to look very cramped.
> You can fix this by defining your functions in another file.
> [!tip] When writing more complicated functions, the `layout` file can start to look very cramped. You can fix this by defining your functions in another file.
>
> ```ts title="functions.ts"
> import {Options} from "./quartz/components/ExplorerNode"

View File

@ -12,8 +12,7 @@ To search content by tags, you can either press `⌘`/`ctrl` + `shift` + `K` or
This component is also keyboard accessible: Tab and Shift+Tab will cycle forward and backward through search results and Enter will navigate to the highlighted result (first result by default). You are also able to navigate search results using `ArrowUp` and `ArrowDown`.
> [!info]
> Search requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
> [!info] Search requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
### Indexing Behaviour

View File

@ -13,8 +13,7 @@ By default, the node radius is proportional to the total number of incoming and
Additionally, similar to how browsers highlight visited links a different colour, the graph view will also show nodes that you have visited in a different colour.
> [!info]
> Graph View requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
> [!info] Graph View requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
## Customization

View File

@ -9,8 +9,7 @@ The locale field generally follows a certain format: `{language}-{REGION}`
- `{language}` is usually a [2-letter lowercase language code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
- `{REGION}` is usually a [2-letter uppercase region code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
> [!tip] Interested in contributing?
> We [gladly welcome translation PRs](https://github.com/jackyzha0/quartz/tree/v4/quartz/i18n/locales)! To contribute a translation, do the following things:
> [!tip] Interested in contributing? We [gladly welcome translation PRs](https://github.com/jackyzha0/quartz/tree/v4/quartz/i18n/locales)! To contribute a translation, do the following things:
>
> 1. In the `quartz/i18n/locales` folder, copy the `en-US.ts` file.
> 2. Rename it to `{language}-{REGION}.ts` so it matches a locale of the format shown above.

View File

@ -12,8 +12,7 @@ There may be some notes you want to avoid publishing as a website. Quartz suppor
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.
> [!warning]
> 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.
> [!warning] 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.
>
> `"!(PublicMedia)**/!(*.md)", "!(*.md)"`
@ -21,8 +20,7 @@ If you'd like to only publish a select number of notes, you can instead use [[Ex
This is a field in `quartz.config.ts` under the main [[configuration]] which allows you to specify a list of patterns to effectively exclude from parsing all together. Any valid [fast-glob](https://github.com/mrmlnc/fast-glob#pattern-syntax) pattern works here.
> [!note]
> Bash's glob syntax is slightly different from fast-glob's and using bash's syntax may lead to unexpected results.
> [!note] Bash's glob syntax is slightly different from fast-glob's and using bash's syntax may lead to unexpected results.
Common examples include:
@ -31,5 +29,4 @@ Common examples include:
- `!*.md` exclude all files that _don't_ have a `.md` extension
- `**/private`: exclude any files or folders named `private` at any level of nesting
> [!warning]
> Marking something as private via either a plugin or through the `ignorePatterns` pattern will only prevent a page from being included in the final built site. If your GitHub repository is public, also be sure to include an ignore for those in the `.gitignore` of your Quartz. See the `git` [documentation](https://git-scm.com/docs/gitignore#_pattern_format) for more information.
> [!warning] Marking something as private via either a plugin or through the `ignorePatterns` pattern will only prevent a page from being included in the final built site. If your GitHub repository is public, also be sure to include an ignore for those in the `.gitignore` of your Quartz. See the `git` [documentation](https://git-scm.com/docs/gitignore#_pattern_format) for more information.

View File

@ -10,8 +10,7 @@ And, unlike some client-side highlighters, it has a full TextMate parser grammar
In short, it generates HTML that looks exactly like your code in an editor like VS Code. Under the hood, it's powered by [Rehype Pretty Code](https://rehype-pretty-code.netlify.app/) which uses [Shiki](https://github.com/shikijs/shiki).
> [!warning]
> Syntax highlighting does have an impact on build speed if you have a lot of code snippets in your notes.
> [!warning] Syntax highlighting does have an impact on build speed if you have a lot of code snippets in your notes.
## Formatting

View File

@ -6,11 +6,9 @@ Quartz effectively turns your Markdown files and other resources into a bundle o
However, if you'd like to publish your site to the world, you need a way to host it online. This guide will detail how to deploy with common hosting providers but any service that allows you to deploy static HTML should work as well.
> [!warning]
> The rest of this guide assumes that you've already created your own GitHub repository for Quartz. If you haven't already, [[setting up your GitHub repository|make sure you do so]].
> [!warning] The rest of this guide assumes that you've already created your own GitHub repository for Quartz. If you haven't already, [[setting up your GitHub repository|make sure you do so]].
> [!hint]
> Some Quartz features (like [[RSS Feed]] and sitemap generation) require `baseUrl` to be configured properly in your [[configuration]] to work properly. Make sure you set this before deploying!
> [!hint] Some Quartz features (like [[RSS Feed]] and sitemap generation) require `baseUrl` to be configured properly in your [[configuration]] to work properly. Make sure you set this before deploying!
## Cloudflare Pages
@ -29,8 +27,7 @@ Press "Save and deploy" and Cloudflare should have a deployed version of your si
To add a custom domain, check out [Cloudflare's documentation](https://developers.cloudflare.com/pages/platform/custom-domains/).
> [!warning]
> Cloudflare Pages performs a shallow clone by default, so if you rely on `git` for timestamps, it is recommended that you add `git fetch --unshallow &&` to the beginning of the build command (e.g., `git fetch --unshallow && npx quartz build`).
> [!warning] Cloudflare Pages performs a shallow clone by default, so if you rely on `git` for timestamps, it is recommended that you add `git fetch --unshallow &&` to the beginning of the build command (e.g., `git fetch --unshallow && npx quartz build`).
## GitHub Pages
@ -89,13 +86,11 @@ Then:
1. Head to "Settings" tab of your forked repository and in the sidebar, click "Pages". Under "Source", select "GitHub Actions".
2. Commit these changes by doing `npx quartz sync`. This should deploy your site to `<github-username>.github.io/<repository-name>`.
> [!hint]
> If you get an error about not being allowed to deploy to `github-pages` due to environment protection rules, make sure you remove any existing GitHub pages environments.
> [!hint] If you get an error about not being allowed to deploy to `github-pages` due to environment protection rules, make sure you remove any existing GitHub pages environments.
>
> You can do this by going to your Settings page on your GitHub fork and going to the Environments tab and pressing the trash icon. The GitHub action will recreate the environment for you correctly the next time you sync your Quartz.
> [!info]
> Quartz generates files in the format of `file.html` instead of `file/index.html` which means the trailing slashes for _non-folder paths_ are dropped. As GitHub pages does not do this redirect, this may cause existing links to your site that use trailing slashes to break. If not breaking existing links is important to you (e.g. you are migrating from Quartz 3), consider using [[#Cloudflare Pages]].
> [!info] Quartz generates files in the format of `file.html` instead of `file/index.html` which means the trailing slashes for _non-folder paths_ are dropped. As GitHub pages does not do this redirect, this may cause existing links to your site that use trailing slashes to break. If not breaking existing links is important to you (e.g. you are migrating from Quartz 3), consider using [[#Cloudflare Pages]].
### Custom Domain
@ -116,8 +111,7 @@ Here's how to add a custom domain to your GitHub pages deployment.
See the [GitHub documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain) for more detail about how to setup your own custom domain with GitHub Pages.
> [!question] Why aren't my changes showing up?
> There could be many different reasons why your changes aren't showing up but the most likely reason is that you forgot to push your changes to GitHub.
> [!question] Why aren't my changes showing up? There could be many different reasons why your changes aren't showing up but the most likely reason is that you forgot to push your changes to GitHub.
>
> Make sure you save your changes to Git and sync it to GitHub by doing `npx quartz sync`. This will also make sure to pull any updates you may have made from other devices so you have them locally.
@ -150,8 +144,7 @@ Before deploying to Vercel, a `vercel.json` file is required at the root of the
### Custom Domain
> [!note]
> If there is something already hosted on the domain, these steps will not work without replacing the previous content. As a workaround, you could use Next.js rewrites or use the next section to create a subdomain.
> [!note] If there is something already hosted on the domain, these steps will not work without replacing the previous content. As a workaround, you could use Next.js rewrites or use the next section to create a subdomain.
1. Update the `baseUrl` in `quartz.config.js` if necessary.
2. Go to the [Domains - Dashboard](https://vercel.com/dashboard/domains) page in Vercel.

View File

@ -26,8 +26,7 @@ This will guide you through initializing your Quartz with content. Once you've d
5. Sync your changes with [[setting up your GitHub repository|GitHub]]
6. [[hosting|Host]] Quartz online
If you prefer instructions in a video format you can try following Nicole van der Hoeven's
[video guide on how to set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s)
If you prefer instructions in a video format you can try following Nicole van der Hoeven's [video guide on how to set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s)
## 🔧 Features

View File

@ -22,8 +22,7 @@ These correspond to following parts of the page:
![[quartz layout.png|800]]
> [!note]
> There are two additional layout fields that are _not_ shown in the above diagram.
> [!note] There are two additional layout fields that are _not_ shown in the above diagram.
>
> 1. `head` is a single component that renders the `<head>` [tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head) in the HTML. This doesn't appear visually on the page and is only is responsible for metadata about the document like the tab title, scripts, and styles.
> 2. `header` is a set of components that are laid out horizontally and appears _before_ the `beforeBody` section. This enables you to replicate the old Quartz 3 header bar where the title, search bar, and dark mode toggle. By default, Quartz 4 doesn't place any components in the `header`.
@ -38,5 +37,4 @@ Most meaningful style changes like colour scheme and font can be done simply thr
You can see the base style sheet in `quartz/styles/base.scss` and write your own in `quartz/styles/custom.scss`.
> [!note]
> Some components may provide their own styling as well! For example, `quartz/components/Darkmode.tsx` imports styles from `quartz/components/styles/darkmode.scss`. If you'd like to customize styling for a specific component, double check the component definition to see how its styles are defined.
> [!note] Some components may provide their own styling as well! For example, `quartz/components/Darkmode.tsx` imports styles from `quartz/components/styles/darkmode.scss`. If you'd like to customize styling for a specific component, double check the component definition to see how its styles are defined.

View File

@ -20,8 +20,7 @@ git remote add upstream https://github.com/jackyzha0/quartz.git
When running `npx quartz create`, you will be prompted as to how to initialize your content folder. Here, you can choose to import or link your previous content folder and Quartz should work just as you expect it to.
> [!note]
> If the existing content folder you'd like to use is at the _same_ path on a different branch, clone the repo again somewhere at a _different_ path in order to use it.
> [!note] If the existing content folder you'd like to use is at the _same_ path on a different branch, clone the repo again somewhere at a _different_ path in order to use it.
## Key changes

View File

@ -24,8 +24,7 @@ The goal of digital gardening should be to tap into your networks collective
Quartz is designed first and foremost as a tool for publishing [digital gardens](https://jzhao.xyz/posts/networked-thought) to the web. To me, digital gardening is not just passive knowledge collection. Its a form of expression and sharing.
> “[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.”
> — Richard Hamming
> “[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming
**The goal of Quartz is to make sharing your digital garden free and simple.**

View File

@ -25,8 +25,7 @@ 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.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -8,8 +8,7 @@ This plugin emits all non-Markdown static assets in your content folder (like im
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.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -10,8 +10,7 @@ If you want to use a custom domain name like `quartz.example.com` for the site,
See [[Hosting]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,8 +6,7 @@ tags:
This plugin manages and emits the static resources required for the Quartz framework. This includes CSS stylesheets and JavaScript scripts that enhance the functionality and aesthetics of the generated site. See also the `cdnCaching` option in the `theme` section of the [[configuration]].
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -8,8 +8,7 @@ This plugin emits both RSS and an XML sitemap for your site. The [[RSS Feed]] al
This plugin emits a comprehensive index of the site's content, generating additional resources such as a sitemap, an RSS feed, and a
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:

View File

@ -6,8 +6,7 @@ tags:
This plugin is a core component of the Quartz framework. It generates the HTML pages for each piece of Markdown content. It emits the full-page [[layout]], including headers, footers, and body content, among others.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,8 +6,7 @@ tags:
This plugin parses links and processes them to point to the right places. It is also needed for embedded links (like images). See [[Obsidian compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
@ -20,8 +19,7 @@ This plugin accepts the following configuration options:
- `lazyLoad`: If `true`, adds lazy loading to resource elements (`img`, `video`, etc.) to improve page load performance. Defaults to `false`.
- `externalLinkIcon`: Adds an icon next to external links when `true` (default) to visually distinguishing them from internal links.
> [!warning]
> Removing this plugin is _not_ recommended and will likely break the page.
> [!warning] Removing this plugin is _not_ recommended and will likely break the page.
## API

View File

@ -6,15 +6,13 @@ tags:
This plugin determines the created, modified, and published dates for a document using three potential data sources: frontmatter metadata, Git history, and the filesystem. See [[authoring content#Syntax]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `priority`: The data sources to consult for date information. Highest priority first. Possible values are `"frontmatter"`, `"git"`, and `"filesystem"`. Defaults to `"frontmatter", "git", "filesystem"]`.
> [!warning]
> If you rely on `git` for dates, make sure `defaultDateType` is set to `modified` in `quartz.config.ts`.
> [!warning] If you rely on `git` for dates, make sure `defaultDateType` is set to `modified` in `quartz.config.ts`.
>
> Depending on how you [[hosting|host]] your Quartz, the `filesystem` dates of your local files may not match the final dates. In these cases, it may be better to use `git` or `frontmatter` to guarantee correct dates.

View File

@ -8,8 +8,7 @@ This plugin generates descriptions that are used as metadata for the HTML `head`
If the frontmatter contains a `description` property, it is used (see [[authoring content#Syntax]]). Otherwise, the plugin will do its best to use the first few sentences of the content to reach the target description length.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:

View File

@ -6,8 +6,7 @@ tags:
This plugin filters content based on an explicit `publish` flag in the frontmatter, allowing only content that is explicitly marked for publication to pass through. It's the opt-in version of [[RemoveDrafts]]. See [[private pages]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -8,8 +8,7 @@ This plugin generates index pages for folders, creating a listing page for each
Example: [[advanced/|Advanced]]
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,16 +6,14 @@ tags:
This plugin parses the frontmatter of the page using the [gray-matter](https://github.com/jonschlinkert/gray-matter) library. See [[authoring content#Syntax]], [[Obsidian compatibility]] and [[OxHugo compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `delimiters`: the delimiters to use for the frontmatter. Can have one value (e.g. `"---"`) or separate values for opening and closing delimiters (e.g. `["---", "~~~"]`). Defaults to `"---"`.
- `language`: the language to use for parsing the frontmatter. Can be `yaml` (default) or `toml`.
> [!warning]
> This plugin must not be removed, otherwise Quartz will break.
> [!warning] This plugin must not be removed, otherwise Quartz will break.
## API

View File

@ -8,8 +8,7 @@ This plugin enhances Markdown processing to support GitHub Flavored Markdown (GF
In addition, this plugin adds optional features for typographic refinement (such as converting straight quotes to curly quotes, dashes to en-dashes/em-dashes, and ellipses) and automatic heading links as a symbol that appears next to the heading on hover.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:

View File

@ -6,8 +6,7 @@ tags:
This plugin automatically converts single line breaks in Markdown text into hard line breaks in the HTML output. This plugin is not enabled by default as this doesn't follow the semantics of actual Markdown but you may enable it if you'd like parity with [[Obsidian compatibility|Obsidian]].
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,8 +6,7 @@ tags:
This plugin adds LaTeX support to Quartz. See [[features/Latex|Latex]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:

View File

@ -6,8 +6,7 @@ tags:
This plugin emits a 404 (Not Found) page for broken or non-existent URLs.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,8 +6,7 @@ tags:
This plugin provides support for [[Obsidian compatibility]].
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
@ -24,8 +23,7 @@ This plugin accepts the following configuration options:
- `enableVideoEmbed`: If `true` (default), enables the embedding of video files.
- `enableCheckbox`: If `true`, adds support for interactive checkboxes in content. Defaults to `false`.
> [!warning]
> Don't remove this plugin if you're using [[Obsidian compatibility|Obsidian]] to author the content!
> [!warning] Don't remove this plugin if you're using [[Obsidian compatibility|Obsidian]] to author the content!
## API

View File

@ -6,8 +6,7 @@ tags:
This plugin provides support for [ox-hugo](https://github.com/kaushalmodi/ox-hugo) compatibility. See [[OxHugo compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
@ -17,8 +16,7 @@ This plugin accepts the following configuration options:
- `replaceFigureWithMdImg`: If `true` (default), replaces `<figure/>` with `![]()`.
- `replaceOrgLatex`: If `true` (default), converts Org-mode [[features/Latex|Latex]] fragments to Quartz-compatible LaTeX wrapped in `$` (for inline) and `$$` (for block equations).
> [!warning]
> While you can use this together with [[ObsidianFlavoredMarkdown]], it's not recommended because it might mutate the file in unexpected ways. Use with caution.
> [!warning] While you can use this together with [[ObsidianFlavoredMarkdown]], it's not recommended because it might mutate the file in unexpected ways. Use with caution.
>
> If you use `toml` frontmatter, make sure to configure the [[Frontmatter]] plugin accordingly. See [[OxHugo compatibility]] for an example.

View File

@ -6,8 +6,7 @@ tags:
This plugin filters out content from your vault, so that only finalized content is made available. This prevents [[private pages]] from being published. By default, it filters out all pages with `draft: true` in the frontmatter and leaves all other pages intact.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,11 +6,9 @@ tags:
This plugin emits all static resources needed by Quartz. This is used, for example, for fonts and images that need a stable position, such as banners and icons. The plugin respects the `ignorePatterns` in the global [[configuration]].
> [!important]
> This is different from [[Assets]]. The resources from the [[Static]] plugin are located under `quartz/static`, whereas [[Assets]] renders all static resources under `content` and is used for images, videos, audio, etc. that are directly referenced by your markdown content.
> [!important] This is different from [[Assets]]. The resources from the [[Static]] plugin are located under `quartz/static`, whereas [[Assets]] renders all static resources under `content` and is used for images, videos, audio, etc. that are directly referenced by your markdown content.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -6,8 +6,7 @@ tags:
This plugin is used to add syntax highlighting to code blocks in Quartz. See [[syntax highlighting]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:

View File

@ -6,8 +6,7 @@ tags:
This plugin generates a table of contents (TOC) for Markdown documents. See [[table of contents]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
@ -16,8 +15,7 @@ This plugin accepts the following configuration options:
- `showByDefault`: If `true` (default), the TOC should be displayed by default. Can be overridden by frontmatter settings.
- `collapseByDefault`: If `true`, the TOC will start in a collapsed state. Default is `false`.
> [!warning]
> This plugin needs the `Component.TableOfContents` component in `quartz.layout.ts` to determine where to display the TOC. Without it, nothing will be displayed. They should always be added or removed together.
> [!warning] This plugin needs the `Component.TableOfContents` component in `quartz.layout.ts` to determine where to display the TOC. Without it, nothing will be displayed. They should always be added or removed together.
## API

View File

@ -6,8 +6,7 @@ tags:
This plugin emits dedicated pages for each tag used in the content. See [[folder and tag listings]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
> [!note] For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
This plugin has no configuration options.

View File

@ -31,13 +31,11 @@ Then, you can sync the content to upload it to your repository. This is a helper
npx quartz sync --no-pull
```
> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase`
> You may have an outdated version of `git`. Updating `git` should fix this issue.
> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase` You may have an outdated version of `git`. Updating `git` should fix this issue.
In future updates, you can simply run `npx quartz sync` every time you want to push updates to your repository.
> [!hint] Flags and options
> For full help options, you can run `npx quartz sync --help`.
> [!hint] Flags and options For full help options, you can run `npx quartz sync --help`.
>
> Most of these have sensible defaults but you can override them if you have a custom setup:
>

View File

@ -2,8 +2,7 @@
title: "Upgrading Quartz"
---
> [!note]
> This is specifically a guide for upgrading Quartz 4 version to a more recent update. If you are coming from Quartz 3, check out the [[migrating from Quartz 3|migration guide]] for more info.
> [!note] This is specifically a guide for upgrading Quartz 4 version to a more recent update. If you are coming from Quartz 3, check out the [[migrating from Quartz 3|migration guide]] for more info.
To fetch the latest Quartz updates, simply run
@ -13,7 +12,6 @@ npx quartz update
As Quartz uses [git](https://git-scm.com/) under the hood for versioning, updating effectively 'pulls' in the updates from the official Quartz GitHub repository. If you have local changes that might conflict with the updates, you may need to resolve these manually yourself (or, pull manually using `git pull origin upstream`).
> [!hint]
> Quartz will try to cache your content before updating to try and prevent merge conflicts. If you get a conflict mid-merge, you can stop the merge and then run `npx quartz restore` to restore your content from the cache.
> [!hint] Quartz will try to cache your content before updating to try and prevent merge conflicts. If you get a conflict mid-merge, you can stop the merge and then run `npx quartz restore` to restore your content from the cache.
If you have the [GitHub desktop app](https://desktop.github.com/), this will automatically open to help you resolve the conflicts. Otherwise, you will need to resolve this in a text editor like VSCode. For more help on resolving conflicts manually, check out the [GitHub guide on resolving merge conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line#competing-line-change-merge-conflicts).

View File

@ -101,9 +101,7 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {
await emitContent(ctx, filteredContent)
console.log(
chalk.green(
`Done processing ${fps.length} files in ${perf.timeSince()}`,
),
chalk.green(`Done processing ${fps.length} files in ${perf.timeSince()}`),
)
release()
@ -303,9 +301,7 @@ async function partialRebuildFromEntrypoint(
//
// if a.md changes, we need to re-emit contentIndex.json,
// and supply [a.md, b.md] to the emitter
const upstreams = [
...depGraph.getLeafNodeAncestors(fp),
] as FilePath[]
const upstreams = [...depGraph.getLeafNodeAncestors(fp)] as FilePath[]
const upstreamContent = upstreams
// filter out non-markdown files
@ -424,9 +420,7 @@ async function rebuildFromEntrypoint(
]
.filter((fp) => !toRemove.has(fp))
.map((fp) =>
slugifyFilePath(
path.posix.relative(argv.directory, fp) as FilePath,
),
slugifyFilePath(path.posix.relative(argv.directory, fp) as FilePath),
)
ctx.allSlugs = [...new Set([...initialSlugs, ...trackedSlugs])]
@ -450,9 +444,7 @@ async function rebuildFromEntrypoint(
console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`))
} catch (err) {
console.log(
chalk.yellow(
`Rebuild failed. Waiting on a change to fix the error...`,
),
chalk.yellow(`Rebuild failed. Waiting on a change to fix the error...`),
)
if (argv.verbose) {
console.log(chalk.red(err))

View File

@ -129,8 +129,7 @@ export async function handleCreate(argv) {
originalFolder = escapePath(
exitIfCancel(
await text({
message:
"Enter the full path to existing content folder",
message: "Enter the full path to existing content folder",
placeholder:
"On most terminal emulators, you can drag and drop a folder into the window and it will paste the full path",
validate(fp) {
@ -246,22 +245,14 @@ export async function handleBuild(argv) {
{
name: "inline-script-loader",
setup(build) {
build.onLoad(
{ filter: /\.inline\.(ts|js)$/ },
async (args) => {
let text = await promises.readFile(
args.path,
"utf8",
)
build.onLoad({filter: /\.inline\.(ts|js)$/}, async (args) => {
let text = await promises.readFile(args.path, "utf8")
// remove default exports that we manually inserted
text = text.replace("export default", "")
text = text.replace("export", "")
const sourcefile = path.relative(
path.resolve("."),
args.path,
)
const sourcefile = path.relative(path.resolve("."), args.path)
const resolveDir = path.dirname(sourcefile)
const transpiled = await esbuild.build({
stdin: {
@ -281,8 +272,7 @@ export async function handleBuild(argv) {
contents: rawMod,
loader: "text",
}
},
)
})
},
},
],
@ -303,9 +293,7 @@ export async function handleBuild(argv) {
if (cleanupBuild) {
await cleanupBuild()
console.log(
chalk.yellow(
"Detected a source code change, doing a hard rebuild...",
),
chalk.yellow("Detected a source code change, doing a hard rebuild..."),
)
}
@ -326,9 +314,7 @@ export async function handleBuild(argv) {
meta.bytes,
)})`,
)
console.log(
await esbuild.analyzeMetafile(result.metafile, { color: true }),
)
console.log(await esbuild.analyzeMetafile(result.metafile, {color: true}))
}
// bypass module cache
@ -375,9 +361,7 @@ export async function handleBuild(argv) {
headers: [
{
source: "**/*.*",
headers: [
{ key: "Content-Disposition", value: "inline" },
],
headers: [{key: "Content-Disposition", value: "inline"}],
},
],
})
@ -386,9 +370,7 @@ export async function handleBuild(argv) {
status >= 200 && status < 300
? chalk.green(`[${status}]`)
: chalk.red(`[${status}]`)
console.log(
statusString + chalk.grey(` ${argv.baseDir}${req.url}`),
)
console.log(statusString + chalk.grey(` ${argv.baseDir}${req.url}`))
release()
}
@ -564,9 +546,7 @@ export async function handleSync(argv) {
try {
gitPull(ORIGIN_NAME, QUARTZ_SOURCE_BRANCH)
} catch {
console.log(
chalk.red("An error occurred above while pulling updates."),
)
console.log(chalk.red("An error occurred above while pulling updates."))
await popContentFolder(contentFolder)
return
}

View File

@ -11,9 +11,7 @@ const ArticleTitle: QuartzComponent = ({
}: QuartzComponentProps) => {
const title = fileData.frontmatter?.title
if (title) {
return (
<h1 class={classNames(displayClass, "article-title")}>{title}</h1>
)
return <h1 class={classNames(displayClass, "article-title")}>{title}</h1>
} else {
return null
}

View File

@ -25,16 +25,13 @@ const Backlinks: QuartzComponent = ({
<li>
<a
href={resolveRelative(fileData.slug!, f.slug!)}
class="internal"
>
class="internal">
{f.frontmatter?.title}
</a>
</li>
))
) : (
<li>
{i18n(cfg.locale).components.backlinks.noBacklinksFound}
</li>
<li>{i18n(cfg.locale).components.backlinks.noBacklinksFound}</li>
)}
</ul>
</div>

View File

@ -4,12 +4,7 @@ import {
QuartzComponentProps,
} from "./types"
import breadcrumbsStyle from "./styles/breadcrumbs.scss"
import {
FullSlug,
SimpleSlug,
joinSegments,
resolveRelative,
} from "../util/path"
import {FullSlug, SimpleSlug, joinSegments, resolveRelative} from "../util/path"
import {QuartzPluginData} from "../plugins/vfile"
import {classNames} from "../util/lang"
@ -127,8 +122,7 @@ export default ((opts?: Partial<BreadcrumbOptions>) => {
const crumb = formatCrumb(
curPathSegment,
fileData.slug!,
(currentPath +
(includeTrailingSlash ? "/" : "")) as SimpleSlug,
(currentPath + (includeTrailingSlash ? "/" : "")) as SimpleSlug,
)
crumbs.push(crumb)
}
@ -145,8 +139,7 @@ export default ((opts?: Partial<BreadcrumbOptions>) => {
return (
<nav
class={classNames(displayClass, "breadcrumb-container")}
aria-label="breadcrumbs"
>
aria-label="breadcrumbs">
{crumbs.map((crumb, index) => (
<div class="breadcrumb-element">
<a href={crumb.path}>{crumb.displayName}</a>

View File

@ -48,15 +48,12 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
segments.push(displayedTime)
}
const segmentsElements = segments.map((segment) => (
<span>{segment}</span>
))
const segmentsElements = segments.map((segment) => <span>{segment}</span>)
return (
<p
show-comma={options.showComma}
class={classNames(displayClass, "content-meta")}
>
class={classNames(displayClass, "content-meta")}>
{segmentsElements}
</p>
)

View File

@ -33,11 +33,8 @@ const Darkmode: QuartzComponent = ({
y="0px"
viewBox="0 0 35 35"
style="enable-background:new 0 0 35 35"
xmlSpace="preserve"
>
<title>
{i18n(cfg.locale).components.themeToggle.darkMode}
</title>
xmlSpace="preserve">
<title>{i18n(cfg.locale).components.themeToggle.darkMode}</title>
<path d="M6,17.5C6,16.672,5.328,16,4.5,16h-3C0.672,16,0,16.672,0,17.5 S0.672,19,1.5,19h3C5.328,19,6,18.328,6,17.5z M7.5,26c-0.414,0-0.789,0.168-1.061,0.439l-2,2C4.168,28.711,4,29.086,4,29.5 C4,30.328,4.671,31,5.5,31c0.414,0,0.789-0.168,1.06-0.44l2-2C8.832,28.289,9,27.914,9,27.5C9,26.672,8.329,26,7.5,26z M17.5,6 C18.329,6,19,5.328,19,4.5v-3C19,0.672,18.329,0,17.5,0S16,0.672,16,1.5v3C16,5.328,16.671,6,17.5,6z M27.5,9 c0.414,0,0.789-0.168,1.06-0.439l2-2C30.832,6.289,31,5.914,31,5.5C31,4.672,30.329,4,29.5,4c-0.414,0-0.789,0.168-1.061,0.44 l-2,2C26.168,6.711,26,7.086,26,7.5C26,8.328,26.671,9,27.5,9z M6.439,8.561C6.711,8.832,7.086,9,7.5,9C8.328,9,9,8.328,9,7.5 c0-0.414-0.168-0.789-0.439-1.061l-2-2C6.289,4.168,5.914,4,5.5,4C4.672,4,4,4.672,4,5.5c0,0.414,0.168,0.789,0.439,1.06 L6.439,8.561z M33.5,16h-3c-0.828,0-1.5,0.672-1.5,1.5s0.672,1.5,1.5,1.5h3c0.828,0,1.5-0.672,1.5-1.5S34.328,16,33.5,16z M28.561,26.439C28.289,26.168,27.914,26,27.5,26c-0.828,0-1.5,0.672-1.5,1.5c0,0.414,0.168,0.789,0.439,1.06l2,2 C28.711,30.832,29.086,31,29.5,31c0.828,0,1.5-0.672,1.5-1.5c0-0.414-0.168-0.789-0.439-1.061L28.561,26.439z M17.5,29 c-0.829,0-1.5,0.672-1.5,1.5v3c0,0.828,0.671,1.5,1.5,1.5s1.5-0.672,1.5-1.5v-3C19,29.672,18.329,29,17.5,29z M17.5,7 C11.71,7,7,11.71,7,17.5S11.71,28,17.5,28S28,23.29,28,17.5S23.29,7,17.5,7z M17.5,25c-4.136,0-7.5-3.364-7.5-7.5 c0-4.136,3.364-7.5,7.5-7.5c4.136,0,7.5,3.364,7.5,7.5C25,21.636,21.636,25,17.5,25z"></path>
</svg>
</label>
@ -51,11 +48,8 @@ const Darkmode: QuartzComponent = ({
y="0px"
viewBox="0 0 100 100"
style="enable-background:new 0 0 100 100"
xmlSpace="preserve"
>
<title>
{i18n(cfg.locale).components.themeToggle.lightMode}
</title>
xmlSpace="preserve">
<title>{i18n(cfg.locale).components.themeToggle.lightMode}</title>
<path d="M96.76,66.458c-0.853-0.852-2.15-1.064-3.23-0.534c-6.063,2.991-12.858,4.571-19.655,4.571 C62.022,70.495,50.88,65.88,42.5,57.5C29.043,44.043,25.658,23.536,34.076,6.47c0.532-1.08,0.318-2.379-0.534-3.23 c-0.851-0.852-2.15-1.064-3.23-0.534c-4.918,2.427-9.375,5.619-13.246,9.491c-9.447,9.447-14.65,22.008-14.65,35.369 c0,13.36,5.203,25.921,14.65,35.368s22.008,14.65,35.368,14.65c13.361,0,25.921-5.203,35.369-14.65 c3.872-3.871,7.064-8.328,9.491-13.246C97.826,68.608,97.611,67.309,96.76,66.458z"></path>
</svg>
</label>

View File

@ -96,12 +96,8 @@ export default ((userOpts?: Partial<Options>) => {
data-behavior={opts.folderClickBehavior}
data-collapsed={opts.folderDefaultState}
data-savestate={opts.useSavedState}
data-tree={jsonTree}
>
<h1>
{opts.title ??
i18n(cfg.locale).components.explorer.title}
</h1>
data-tree={jsonTree}>
<h1>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h1>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
@ -112,18 +108,13 @@ export default ((userOpts?: Partial<Options>) => {
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="fold"
>
class="fold">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div id="explorer-content">
<ul class="overflow" id="explorer-ul">
<ExplorerNode
node={fileTree}
opts={opts}
fileData={fileData}
/>
<ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
<li id="explorer-end" />
</ul>
</div>

View File

@ -59,8 +59,7 @@ export class FileNode {
) {
this.children = []
this.name = slugSegment
this.displayName =
displayName ?? file?.frontmatter?.title ?? slugSegment
this.displayName = displayName ?? file?.frontmatter?.title ?? slugSegment
this.file = file ? clone(file) : null
this.depth = depth ?? 0
}
@ -83,12 +82,7 @@ export class FileNode {
} else {
// direct child
this.children.push(
new FileNode(
nextSegment,
undefined,
fileData.file,
this.depth + 1,
),
new FileNode(nextSegment, undefined, fileData.file, this.depth + 1),
)
}
@ -201,8 +195,7 @@ export function ExplorerNode({
<li key={node.file.slug}>
<a
href={resolveRelative(fileData.slug!, node.file.slug!)}
data-for={node.file.slug}
>
data-for={node.file.slug}>
{node.displayName}
</a>
</li>
@ -222,8 +215,7 @@ export function ExplorerNode({
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="folder-icon"
>
class="folder-icon">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
{/* render <a> tag if folderBehavior is "link", otherwise render <button> with collapse click event */}
@ -235,15 +227,12 @@ export function ExplorerNode({
folderPath as SimpleSlug,
)}
data-for={node.name}
class="folder-title"
>
class="folder-title">
{node.displayName}
</a>
) : (
<button class="folder-button">
<span class="folder-title">
{node.displayName}
</span>
<span class="folder-title">{node.displayName}</span>
</button>
)}
</div>
@ -251,16 +240,14 @@ export function ExplorerNode({
)}
{/* Recursively render children of folder */}
<div
class={`folder-outer ${node.depth === 0 || isDefaultOpen ? "open" : ""}`}
>
class={`folder-outer ${node.depth === 0 || isDefaultOpen ? "open" : ""}`}>
<ul
// Inline style for left folder paddings
style={{
paddingLeft: node.name !== "" ? "1.4rem" : "0",
}}
class="content"
data-folderul={folderPath}
>
data-folderul={folderPath}>
{node.children.map((childNode, i) => (
<ExplorerNode
node={childNode}

View File

@ -74,10 +74,7 @@ export default ((opts?: GraphOptions) => {
<div class={classNames(displayClass, "graph")}>
<h2>{i18n(cfg.locale).components.graph.title}</h2>
<div class="graph-outer">
<div
id="graph-container"
data-cfg={JSON.stringify(localGraph)}
></div>
<div id="graph-container" data-cfg={JSON.stringify(localGraph)}></div>
<svg
version="1.1"
id="global-graph-icon"
@ -87,8 +84,7 @@ export default ((opts?: GraphOptions) => {
y="0px"
viewBox="0 0 55 55"
fill="currentColor"
xmlSpace="preserve"
>
xmlSpace="preserve">
<path
d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17
s-3.542,0.634-4.898,1.688l-7.669-7.669C16.785,10.424,17,9.74,17,9c0-2.206-1.794-4-4-4S9,6.794,9,9s1.794,4,4,4
@ -107,8 +103,7 @@ export default ((opts?: GraphOptions) => {
<div id="global-graph-outer">
<div
id="global-graph-container"
data-cfg={JSON.stringify(globalGraph)}
></div>
data-cfg={JSON.stringify(globalGraph)}></div>
</div>
</div>
)

View File

@ -15,8 +15,7 @@ export default (() => {
externalResources,
}: QuartzComponentProps) => {
const title =
fileData.frontmatter?.title ??
i18n(cfg.locale).propertyDefaults.title
fileData.frontmatter?.title ?? i18n(cfg.locale).propertyDefaults.title
const description =
fileData.description?.trim() ??
i18n(cfg.locale).propertyDefaults.description
@ -24,8 +23,7 @@ export default (() => {
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
const path = url.pathname as FullSlug
const baseDir =
fileData.slug === "404" ? path : pathToRoot(fileData.slug!)
const baseDir = fileData.slug === "404" ? path : pathToRoot(fileData.slug!)
const iconPath = joinSegments(baseDir, "static/icon.png")
const ogImagePath = `https://${cfg.baseUrl}/static/og-image.png`
@ -34,32 +32,17 @@ export default (() => {
<head>
<title>{title}</title>
<meta charSet="utf-8" />
{cfg.theme.cdnCaching &&
cfg.theme.fontOrigin === "googleFonts" && (
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "googleFonts" && (
<>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
rel="stylesheet"
href={googleFontHref(cfg.theme)}
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link rel="stylesheet" href={googleFontHref(cfg.theme)} />
</>
)}
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
{cfg.baseUrl && (
<meta property="og:image" content={ogImagePath} />
)}
{cfg.baseUrl && <meta property="og:image" content={ogImagePath} />}
<meta property="og:width" content="1200" />
<meta property="og:height" content="675" />
<link rel="icon" href={iconPath} />
@ -75,9 +58,7 @@ export default (() => {
/>
))}
{js
.filter(
(resource) => resource.loadTime === "beforeDOMReady",
)
.filter((resource) => resource.loadTime === "beforeDOMReady")
.map((res) => JSResourceToScriptElement(res, true))}
</head>
)

View File

@ -51,21 +51,14 @@ export const PageList: QuartzComponent = ({
<div class="section">
{page.dates && (
<p class="meta">
<Date
date={getDate(cfg, page)!}
locale={cfg.locale}
/>
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
</p>
)}
<div class="desc">
<h3>
<a
href={resolveRelative(
fileData.slug!,
page.slug!,
)}
class="internal"
>
href={resolveRelative(fileData.slug!, page.slug!)}
class="internal">
{title}
</a>
</h3>
@ -78,8 +71,7 @@ export const PageList: QuartzComponent = ({
href={resolveRelative(
fileData.slug!,
`tags/${tag}` as FullSlug,
)}
>
)}>
{tag}
</a>
</li>

View File

@ -39,15 +39,11 @@ export default ((userOpts?: Partial<Options>) => {
const remaining = Math.max(0, pages.length - opts.limit)
return (
<div class={classNames(displayClass, "recent-notes")}>
<h3>
{opts.title ??
i18n(cfg.locale).components.recentNotes.title}
</h3>
<h3>{opts.title ?? i18n(cfg.locale).components.recentNotes.title}</h3>
<ul class="recent-ul">
{pages.slice(0, opts.limit).map((page) => {
const title =
page.frontmatter?.title ??
i18n(cfg.locale).propertyDefaults.title
page.frontmatter?.title ?? i18n(cfg.locale).propertyDefaults.title
const tags = page.frontmatter?.tags ?? []
return (
@ -56,22 +52,15 @@ export default ((userOpts?: Partial<Options>) => {
<div class="desc">
<h3>
<a
href={resolveRelative(
fileData.slug!,
page.slug!,
)}
class="internal"
>
href={resolveRelative(fileData.slug!, page.slug!)}
class="internal">
{title}
</a>
</h3>
</div>
{page.dates && (
<p class="meta">
<Date
date={getDate(cfg, page)!}
locale={cfg.locale}
/>
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
</p>
)}
<ul class="tags">
@ -82,8 +71,7 @@ export default ((userOpts?: Partial<Options>) => {
href={resolveRelative(
fileData.slug!,
`tags/${tag}` as FullSlug,
)}
>
)}>
{tag}
</a>
</li>
@ -96,15 +84,8 @@ export default ((userOpts?: Partial<Options>) => {
</ul>
{opts.linkToMore && remaining > 0 && (
<p>
<a
href={resolveRelative(
fileData.slug!,
opts.linkToMore,
)}
>
{i18n(
cfg.locale,
).components.recentNotes.seeRemainingMore({
<a href={resolveRelative(fileData.slug!, opts.linkToMore)}>
{i18n(cfg.locale).components.recentNotes.seeRemainingMore({
remaining,
})}
</a>

View File

@ -35,15 +35,11 @@ export default ((userOpts?: Partial<SearchOptions>) => {
aria-labelledby="title desc"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 19.9 19.7"
>
viewBox="0 0 19.9 19.7">
<title id="title">Search</title>
<desc id="desc">Search</desc>
<g class="search-path" fill="none">
<path
stroke-linecap="square"
d="M18.5 18.3l-5.4-5.4"
/>
<path stroke-linecap="square" d="M18.5 18.3l-5.4-5.4" />
<circle cx="8" cy="8" r="7" />
</g>
</svg>
@ -58,10 +54,7 @@ export default ((userOpts?: Partial<SearchOptions>) => {
aria-label={searchPlaceholder}
placeholder={searchPlaceholder}
/>
<div
id="search-layout"
data-preview={opts.enablePreview}
></div>
<div id="search-layout" data-preview={opts.enablePreview}></div>
</div>
</div>
</div>

View File

@ -33,8 +33,7 @@ const TableOfContents: QuartzComponent = ({
<button
type="button"
id="toc"
class={fileData.collapseToc ? "collapsed" : ""}
>
class={fileData.collapseToc ? "collapsed" : ""}>
<h3>{i18n(cfg.locale).components.tableOfContents.title}</h3>
<svg
xmlns="http://www.w3.org/2000/svg"
@ -46,22 +45,15 @@ const TableOfContents: QuartzComponent = ({
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="fold"
>
class="fold">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div id="toc-content">
<ul class="overflow">
{fileData.toc.map((tocEntry) => (
<li
key={tocEntry.slug}
class={`depth-${tocEntry.depth}`}
>
<a
href={`#${tocEntry.slug}`}
data-for={tocEntry.slug}
>
<li key={tocEntry.slug} class={`depth-${tocEntry.depth}`}>
<a href={`#${tocEntry.slug}`} data-for={tocEntry.slug}>
{tocEntry.text}
</a>
</li>

View File

@ -58,9 +58,7 @@ export default ((opts?: Partial<FolderContentOptions>) => {
<div class="page-listing">
{options.showFolderCount && (
<p>
{i18n(
cfg.locale,
).pages.folderContent.itemsUnderFolder({
{i18n(cfg.locale).pages.folderContent.itemsUnderFolder({
count: allPagesInFolder.length,
})}
</p>

View File

@ -73,30 +73,23 @@ const TagContent: QuartzComponent = (props: QuartzComponentProps) => {
return (
<div>
<h2>
<a
class="internal tag-link"
href={`../tags/${tag}`}
>
<a class="internal tag-link" href={`../tags/${tag}`}>
{tag}
</a>
</h2>
{content && <p>{content}</p>}
<div class="page-listing">
<p>
{i18n(
cfg.locale,
).pages.tagContent.itemsUnderTag({
{i18n(cfg.locale).pages.tagContent.itemsUnderTag({
count: pages.length,
})}
{pages.length > numPages && (
<>
{" "}
<span>
{i18n(
cfg.locale,
).pages.tagContent.showingFirst(
{ count: numPages },
)}
{i18n(cfg.locale).pages.tagContent.showingFirst({
count: numPages,
})}
</span>
</>
)}

View File

@ -75,9 +75,7 @@ export function renderPage(
const classNames = (node.properties?.className ?? []) as string[]
if (classNames.includes("transclude")) {
const inner = node.children[0] as Element
const transcludeTarget = inner.properties[
"data-slug"
] as FullSlug
const transcludeTarget = inner.properties["data-slug"] as FullSlug
const page = componentData.allFiles.find(
(f) => f.slug === transcludeTarget,
)
@ -101,11 +99,7 @@ export function renderPage(
}
node.children = [
normalizeHastElement(
blockNode,
slug,
transcludeTarget,
),
normalizeHastElement(blockNode, slug, transcludeTarget),
{
type: "element",
tagName: "a",
@ -116,8 +110,8 @@ export function renderPage(
children: [
{
type: "text",
value: i18n(cfg.locale).components
.transcludes.linkToOriginal,
value: i18n(cfg.locale).components.transcludes
.linkToOriginal,
},
],
},
@ -131,20 +125,12 @@ export function renderPage(
let endIdx = undefined
for (const [i, el] of page.htmlAst.children.entries()) {
// skip non-headers
if (
!(
el.type === "element" &&
el.tagName.match(headerRegex)
)
)
if (!(el.type === "element" && el.tagName.match(headerRegex)))
continue
const depth = Number(el.tagName.substring(1))
// lookin for our blockref
if (
startIdx === undefined ||
startDepth === undefined
) {
if (startIdx === undefined || startDepth === undefined) {
// skip until we find the blockref that matches
if (el.properties?.id === blockRef) {
startIdx = i
@ -163,16 +149,9 @@ export function renderPage(
node.children = [
...(
page.htmlAst.children.slice(
startIdx,
endIdx,
) as ElementContent[]
page.htmlAst.children.slice(startIdx, endIdx) as ElementContent[]
).map((child) =>
normalizeHastElement(
child as Element,
slug,
transcludeTarget,
),
normalizeHastElement(child as Element, slug, transcludeTarget),
),
{
type: "element",
@ -184,8 +163,7 @@ export function renderPage(
children: [
{
type: "text",
value: i18n(cfg.locale).components
.transcludes.linkToOriginal,
value: i18n(cfg.locale).components.transcludes.linkToOriginal,
},
],
},
@ -202,21 +180,14 @@ export function renderPage(
type: "text",
value:
page.frontmatter?.title ??
i18n(
cfg.locale,
).components.transcludes.transcludeOf({
i18n(cfg.locale).components.transcludes.transcludeOf({
targetSlug: page.slug!,
}),
},
],
},
...(page.htmlAst.children as ElementContent[]).map(
(child) =>
normalizeHastElement(
child as Element,
slug,
transcludeTarget,
),
...(page.htmlAst.children as ElementContent[]).map((child) =>
normalizeHastElement(child as Element, slug, transcludeTarget),
),
{
type: "element",
@ -228,8 +199,7 @@ export function renderPage(
children: [
{
type: "text",
value: i18n(cfg.locale).components
.transcludes.linkToOriginal,
value: i18n(cfg.locale).components.transcludes.linkToOriginal,
},
],
},

View File

@ -33,9 +33,7 @@ function setupCallout() {
if (title) {
title.addEventListener("click", toggleCallout)
window.addCleanup(() =>
title.removeEventListener("click", toggleCallout),
)
window.addCleanup(() => title.removeEventListener("click", toggleCallout))
const collapsed = div.classList.contains("is-collapsed")
const height = collapsed ? title.scrollHeight : div.scrollHeight

View File

@ -28,9 +28,7 @@ document.addEventListener("nav", () => {
)
}
button.addEventListener("click", onClick)
window.addCleanup(() =>
button.removeEventListener("click", onClick),
)
window.addCleanup(() => button.removeEventListener("click", onClick))
els[i].prepend(button)
}
}

View File

@ -5,20 +5,15 @@ const currentTheme = localStorage.getItem("theme") ?? userPref
document.documentElement.setAttribute("saved-theme", currentTheme)
const emitThemeChangeEvent = (theme: "light" | "dark") => {
const event: CustomEventMap["themechange"] = new CustomEvent(
"themechange",
{
const event: CustomEventMap["themechange"] = new CustomEvent("themechange", {
detail: {theme},
},
)
})
document.dispatchEvent(event)
}
document.addEventListener("nav", () => {
const switchTheme = (e: Event) => {
const newTheme = (e.target as HTMLInputElement)?.checked
? "dark"
: "light"
const newTheme = (e.target as HTMLInputElement)?.checked ? "dark" : "light"
document.documentElement.setAttribute("saved-theme", newTheme)
localStorage.setItem("theme", newTheme)
emitThemeChangeEvent(newTheme)

View File

@ -59,16 +59,12 @@ function setupExplorer() {
"folder-button",
) as HTMLCollectionOf<HTMLElement>) {
item.addEventListener("click", toggleFolder)
window.addCleanup(() =>
item.removeEventListener("click", toggleFolder),
)
window.addCleanup(() => item.removeEventListener("click", toggleFolder))
}
}
explorer.addEventListener("click", toggleExplorer)
window.addCleanup(() =>
explorer.removeEventListener("click", toggleExplorer),
)
window.addCleanup(() => explorer.removeEventListener("click", toggleExplorer))
// Set up click handlers for each folder (click handler on folder "icon")
for (const item of document.getElementsByClassName(

View File

@ -237,8 +237,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
const linkNodes = d3
.selectAll(".link")
.filter(
(d: any) =>
d.source.id === currentId || d.target.id === currentId,
(d: any) => d.source.id === currentId || d.target.id === currentId,
)
if (focusOnHover) {
@ -274,10 +273,7 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
.select("text")
.transition()
.duration(200)
.attr(
"opacityOld",
d3.select(parent).select("text").style("opacity"),
)
.attr("opacityOld", d3.select(parent).select("text").style("opacity"))
.style("opacity", 1)
.style("font-size", bigFont + "em")
})
@ -296,24 +292,17 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
const linkNodes = d3
.selectAll(".link")
.filter(
(d: any) =>
d.source.id === currentId || d.target.id === currentId,
(d: any) => d.source.id === currentId || d.target.id === currentId,
)
linkNodes
.transition()
.duration(200)
.attr("stroke", "var(--lightgray)")
linkNodes.transition().duration(200).attr("stroke", "var(--lightgray)")
const parent = this.parentNode as HTMLElement
d3.select<HTMLElement, NodeData>(parent)
.select("text")
.transition()
.duration(200)
.style(
"opacity",
d3.select(parent).select("text").attr("opacityOld"),
)
.style("opacity", d3.select(parent).select("text").attr("opacityOld"))
.style("font-size", fontSize + "em")
})
// @ts-ignore
@ -348,16 +337,15 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
node.attr("transform", transform)
const scale = transform.k * opacityScale
const scaledOpacity = Math.max((scale - 1) / 3.75, 0)
labels
.attr("transform", transform)
.style("opacity", scaledOpacity)
labels.attr("transform", transform).style("opacity", scaledOpacity)
}),
)
}
// progress the simulation
simulation.on("tick", () => {
link.attr("x1", (d: any) => d.source.x)
link
.attr("x1", (d: any) => d.source.x)
.attr("y1", (d: any) => d.source.y)
.attr("x2", (d: any) => d.target.x)
.attr("y2", (d: any) => d.target.y)

View File

@ -1,11 +1,7 @@
import FlexSearch from "flexsearch"
import {ContentDetails} from "../../plugins/emitters/contentIndex"
import {registerEscapeHandler, removeAllChildren} from "./util"
import {
FullSlug,
normalizeRelativeURLs,
resolveRelative,
} from "../../util/path"
import {FullSlug, normalizeRelativeURLs, resolveRelative} from "../../util/path"
interface Item {
id: number
@ -82,10 +78,7 @@ function highlight(searchTerm: string, text: string, trim?: boolean) {
i++
) {
const window = occurrencesIndices.slice(i, i + contextWindowWords)
const windowSum = window.reduce(
(total, cur) => total + (cur ? 1 : 0),
0,
)
const windowSum = window.reduce((total, cur) => total + (cur ? 1 : 0), 0)
if (windowSum >= bestSum) {
bestSum = windowSum
bestIndex = i
@ -106,10 +99,7 @@ function highlight(searchTerm: string, text: string, trim?: boolean) {
for (const searchTok of tokenizedTerms) {
if (tok.toLowerCase().includes(searchTok.toLowerCase())) {
const regex = new RegExp(searchTok.toLowerCase(), "gi")
return tok.replace(
regex,
`<span class="highlight">$&</span>`,
)
return tok.replace(regex, `<span class="highlight">$&</span>`)
}
}
return tok
@ -144,9 +134,7 @@ function highlightHTML(searchTerm: string, el: HTMLElement) {
for (const match of matches) {
const matchIndex = nodeText.indexOf(match, lastIndex)
spanContainer.appendChild(
document.createTextNode(
nodeText.slice(lastIndex, matchIndex),
),
document.createTextNode(nodeText.slice(lastIndex, matchIndex)),
)
spanContainer.appendChild(createHighlightSpan(match))
lastIndex = matchIndex + match.length
@ -354,23 +342,13 @@ document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
enablePreview && window.innerWidth > 600 ? "" : `<p>${content}</p>`
}`
itemTile.addEventListener("click", (event) => {
if (
event.altKey ||
event.ctrlKey ||
event.metaKey ||
event.shiftKey
)
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
return
hideSearch()
})
const handler = (event: MouseEvent) => {
if (
event.altKey ||
event.ctrlKey ||
event.metaKey ||
event.shiftKey
)
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
return
hideSearch()
}
@ -460,10 +438,7 @@ document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
async function onType(e: HTMLElementEventMap["input"]) {
if (!searchLayout || !index) return
currentSearchTerm = (e.target as HTMLInputElement).value
searchLayout.classList.toggle(
"display-results",
currentSearchTerm !== "",
)
searchLayout.classList.toggle("display-results", currentSearchTerm !== "")
searchType = currentSearchTerm.startsWith("#") ? "tags" : "basic"
let searchResults: FlexSearch.SimpleDocumentSearchResultSetUnit[]
@ -483,9 +458,7 @@ document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
const getByField = (field: string): number[] => {
const results = searchResults.filter((x) => x.field === field)
return results.length === 0
? []
: ([...results[0].result] as number[])
return results.length === 0 ? [] : ([...results[0].result] as number[])
}
// order titles ahead of content

View File

@ -28,9 +28,7 @@ const isSamePage = (url: URL): boolean => {
return sameOrigin && samePath
}
const getOpts = ({
target,
}: Event): { url: URL; scroll?: boolean } | undefined => {
const getOpts = ({target}: Event): {url: URL; scroll?: boolean} | undefined => {
if (!isElement(target)) return
if (target.attributes.getNamedItem("target")?.value === "_blank") return
const a = target.closest("a")
@ -152,10 +150,7 @@ function createRouter() {
window.addEventListener("popstate", (event) => {
const {url} = getOpts(event) ?? {}
if (
window.location.hash &&
window.location.pathname === url?.pathname
)
if (window.location.hash && window.location.pathname === url?.pathname)
return
try {
navigate(new URL(window.location.toString()), true)
@ -189,7 +184,8 @@ if (!customElements.get("route-announcer")) {
const attrs = {
"aria-live": "assertive",
"aria-atomic": "true",
style: "position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px",
"style":
"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px",
}
customElements.define(

View File

@ -29,9 +29,7 @@ function setupToc() {
const collapsed = toc.classList.contains("collapsed")
const content = toc.nextElementSibling as HTMLElement | undefined
if (!content) return
content.style.maxHeight = collapsed
? "0px"
: content.scrollHeight + "px"
content.style.maxHeight = collapsed ? "0px" : content.scrollHeight + "px"
toc.addEventListener("click", toggleToc)
window.addCleanup(() => toc.removeEventListener("click", toggleToc))
}

View File

@ -16,9 +16,7 @@ export function registerEscapeHandler(
}
outsideContainer?.addEventListener("click", click)
window.addCleanup(() =>
outsideContainer?.removeEventListener("click", click),
)
window.addCleanup(() => outsideContainer?.removeEventListener("click", click))
document.addEventListener("keydown", esc)
window.addCleanup(() => document.removeEventListener("keydown", esc))
}

View File

@ -40,8 +40,7 @@ export default {
},
recentNotes: {
title: "Zuletzt bearbeitete Seiten",
seeRemainingMore: ({ remaining }) =>
`${remaining} weitere ansehen →`,
seeRemainingMore: ({remaining}) => `${remaining} weitere ansehen →`,
},
transcludes: {
transcludeOf: ({targetSlug}) => `Transklusion von ${targetSlug}`,
@ -82,8 +81,7 @@ export default {
count === 1
? "1 Datei mit diesem Tag."
: `${count} Dateien mit diesem Tag.`,
showingFirst: ({ count }) =>
`Die ersten ${count} Tags werden angezeigt.`,
showingFirst: ({count}) => `Die ersten ${count} Tags werden angezeigt.`,
totalTags: ({count}) => `${count} Tags insgesamt.`,
},
},

View File

@ -77,9 +77,7 @@ export default {
tag: "Tag",
tagIndex: "Tag Index",
itemsUnderTag: ({count}) =>
count === 1
? "1 item with this tag."
: `${count} items with this tag.`,
count === 1 ? "1 item with this tag." : `${count} items with this tag.`,
showingFirst: ({count}) => `Showing first ${count} tags.`,
totalTags: ({count}) => `Found ${count} total tags.`,
},

View File

@ -80,10 +80,8 @@ export default {
count === 1
? "1 artículo con esta etiqueta."
: `${count} artículos con esta etiqueta.`,
showingFirst: ({ count }) =>
`Mostrando las primeras ${count} etiquetas.`,
totalTags: ({ count }) =>
`Se encontraron ${count} etiquetas en total.`,
showingFirst: ({count}) => `Mostrando las primeras ${count} etiquetas.`,
totalTags: ({count}) => `Se encontraron ${count} etiquetas en total.`,
},
},
} as const satisfies Translation

View File

@ -80,8 +80,7 @@ export default {
count === 1
? "1 élément avec cette étiquette."
: `${count} éléments avec cette étiquette.`,
showingFirst: ({ count }) =>
`Affichage des premières ${count} étiquettes.`,
showingFirst: ({count}) => `Affichage des premières ${count} étiquettes.`,
totalTags: ({count}) => `Trouvé ${count} étiquettes au total.`,
},
},

View File

@ -74,8 +74,7 @@ export default {
tag: "タグ",
tagIndex: "タグ一覧",
itemsUnderTag: ({count}) => `${count}件のページ`,
showingFirst: ({ count }) =>
`のうち最初の${count}件を表示しています`,
showingFirst: ({count}) => `のうち最初の${count}件を表示しています`,
totalTags: ({count}) => `${count}個のタグを表示中`,
},
},

View File

@ -55,9 +55,7 @@ export default {
},
contentMeta: {
readingTime: ({minutes}) =>
minutes === 1
? "1 minuut leestijd"
: `${minutes} minuten leestijd`,
minutes === 1 ? "1 minuut leestijd" : `${minutes} minuten leestijd`,
},
},
pages: {
@ -72,21 +70,15 @@ export default {
folderContent: {
folder: "Map",
itemsUnderFolder: ({count}) =>
count === 1
? "1 item in deze map."
: `${count} items in deze map.`,
count === 1 ? "1 item in deze map." : `${count} items in deze map.`,
},
tagContent: {
tag: "Label",
tagIndex: "Label-index",
itemsUnderTag: ({count}) =>
count === 1
? "1 item met dit label."
: `${count} items met dit label.`,
count === 1 ? "1 item met dit label." : `${count} items met dit label.`,
showingFirst: ({count}) =>
count === 1
? "Eerste label tonen."
: `Eerste ${count} labels tonen.`,
count === 1 ? "Eerste label tonen." : `Eerste ${count} labels tonen.`,
totalTags: ({count}) => `${count} labels gevonden.`,
},
},

View File

@ -55,9 +55,7 @@ export default {
},
contentMeta: {
readingTime: ({minutes}) =>
minutes == 1
? `lectură de 1 minut`
: `lectură de ${minutes} minute`,
minutes == 1 ? `lectură de 1 minut` : `lectură de ${minutes} minute`,
},
},
pages: {
@ -83,10 +81,8 @@ export default {
count === 1
? "1 articol cu această etichetă."
: `${count} articole cu această etichetă.`,
showingFirst: ({ count }) =>
`Se afișează primele ${count} etichete.`,
totalTags: ({ count }) =>
`Au fost găsite ${count} etichete în total.`,
showingFirst: ({count}) => `Se afișează primele ${count} etichete.`,
totalTags: ({count}) => `Au fost găsite ${count} etichete în total.`,
},
},
} as const satisfies Translation

View File

@ -40,8 +40,7 @@ export default {
},
recentNotes: {
title: "Останні нотатки",
seeRemainingMore: ({ remaining }) =>
`Переглянути ще ${remaining}`,
seeRemainingMore: ({remaining}) => `Переглянути ще ${remaining}`,
},
transcludes: {
transcludeOf: ({targetSlug}) => `Видобуто з ${targetSlug}`,

View File

@ -77,9 +77,7 @@ export default {
tag: "Thẻ",
tagIndex: "Thẻ Mục Lục",
itemsUnderTag: ({count}) =>
count === 1
? "1 mục gắn thẻ này."
: `${count} mục gắn thẻ này.`,
count === 1 ? "1 mục gắn thẻ này." : `${count} mục gắn thẻ này.`,
showingFirst: ({count}) => `Hiển thị trước ${count} thẻ.`,
totalTags: ({count}) => `Tìm thấy ${count} thẻ tổng cộng.`,
},

View File

@ -30,8 +30,7 @@ export const Assets: QuartzEmitterPlugin = () => {
for (const fp of fps) {
const ext = path.extname(fp)
const src = joinSegments(argv.directory, fp) as FilePath
const name = (slugifyFilePath(fp as FilePath, true) +
ext) as FilePath
const name = (slugifyFilePath(fp as FilePath, true) + ext) as FilePath
const dest = joinSegments(argv.output, name) as FilePath
@ -47,8 +46,7 @@ export const Assets: QuartzEmitterPlugin = () => {
for (const fp of fps) {
const ext = path.extname(fp)
const src = joinSegments(argv.directory, fp) as FilePath
const name = (slugifyFilePath(fp as FilePath, true) +
ext) as FilePath
const name = (slugifyFilePath(fp as FilePath, true) + ext) as FilePath
const dest = joinSegments(assetsPath, name) as FilePath
const dir = path.dirname(dest) as FilePath

View File

@ -181,10 +181,7 @@ export const ComponentResources: QuartzEmitterPlugin = () => {
await fetch(googleFontHref(ctx.cfg.configuration.theme))
).text()
while (
(match = fontSourceRegex.exec(googleFontsStyleSheet)) !==
null
) {
while ((match = fontSourceRegex.exec(googleFontsStyleSheet)) !== null) {
// match[0] is the `url(path)`, match[1] is the `path`
const url = match[1]
// the static name of this file.
@ -206,11 +203,7 @@ export const ComponentResources: QuartzEmitterPlugin = () => {
.then((buf) =>
write({
ctx,
slug: joinSegments(
"static",
"fonts",
filename,
) as FullSlug,
slug: joinSegments("static", "fonts", filename) as FullSlug,
ext: `.${ext}`,
content: Buffer.from(buf),
}),

View File

@ -117,18 +117,12 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
graph.addEdge(
sourcePath,
joinSegments(
ctx.argv.output,
"static/contentIndex.json",
) as FilePath,
joinSegments(ctx.argv.output, "static/contentIndex.json") as FilePath,
)
if (opts?.enableSiteMap) {
graph.addEdge(
sourcePath,
joinSegments(
ctx.argv.output,
"sitemap.xml",
) as FilePath,
joinSegments(ctx.argv.output, "sitemap.xml") as FilePath,
)
}
if (opts?.enableRSS) {
@ -147,8 +141,7 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
const linkIndex: ContentIndex = new Map()
for (const [tree, file] of content) {
const slug = file.data.slug!
const date =
getDate(ctx.cfg.configuration, file.data) ?? new Date()
const date = getDate(ctx.cfg.configuration, file.data) ?? new Date()
if (
opts?.includeEmptyFiles ||
(file.data.text && file.data.text !== "")

Some files were not shown because too many files have changed in this diff Show More