Skip to content

Commit 2d897f1

Browse files
committed
merge upstream changes & site update
2 parents f313711 + 244801a commit 2d897f1

32 files changed

+199
-48
lines changed

docs/advanced/paths.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ Here are the main types of slugs with a rough description of each type of path:
4848
- `SimpleSlug`: cannot be relative and shouldn't have `/index` as an ending or a file extension. It _can_ however have a trailing slash to indicate a folder path.
4949
- `RelativeURL`: must start with `.` or `..` to indicate it's a relative URL. Shouldn't have `/index` as an ending or a file extension but can contain a trailing slash.
5050

51-
To get a clearer picture of how these relate to each other, take a look at the path tests in `quartz/path.test.ts`.
51+
To get a clearer picture of how these relate to each other, take a look at the path tests in `quartz/util/path.test.ts`.

docs/features/recent notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Quartz can generate a list of recent notes based on some filtering and sorting c
99

1010
- Changing the title from "Recent notes": pass in an additional parameter to `Component.RecentNotes({ title: "Recent writing" })`
1111
- Changing the number of recent notes: pass in an additional parameter to `Component.RecentNotes({ limit: 5 })`
12+
- Display the note's tags (defaults to true): `Component.RecentNotes({ showTags: false })`
1213
- Show a 'see more' link: pass in an additional parameter to `Component.RecentNotes({ linkToMore: "tags/components" })`. This field should be a full slug to a page that exists.
1314
- Customize filtering: pass in an additional parameter to `Component.RecentNotes({ filter: someFilterFunction })`. The filter function should be a function that has the signature `(f: QuartzPluginData) => boolean`.
1415
- Customize sorting: pass in an additional parameter to `Component.RecentNotes({ sort: someSortFunction })`. By default, Quartz will sort by date and then tie break lexographically. The sort function should be a function that has the signature `(f1: QuartzPluginData, f2: QuartzPluginData) => number`. See `byDateAndAlphabetical` in `quartz/components/PageList.tsx` for an example.

docs/features/syntax highlighting.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ const [age, setAge] = useState(50)
9595
const [name, setName] = useState("Taylor")
9696
```
9797

98+
### Inline Highlighting
99+
100+
Append {:lang} to the end of inline code to highlight it like a regular code block.
101+
102+
```
103+
This is an array `[1, 2, 3]{:js}` of numbers 1 through 3.
104+
```
105+
106+
This is an array `[1, 2, 3]{:js}` of numbers 1 through 3.
107+
98108
### Line numbers
99109

100110
Syntax highlighting has line numbers configured automatically. If you want to start line numbers at a specific number, use `showLineNumbers{number}`:

docs/showcase.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ Want to see what Quartz can do? Here are some cool community gardens:
2828
- [🪴Aster's notebook](https://notes.asterhu.com)
2929
- [🥷🏻🌳🍃 Computer Science & Thinkering Garden](https://notes.yxy.ninja)
3030
- [A Pattern Language - Christopher Alexander (Architecture)](https://patternlanguage.cc/)
31+
- [Gatekeeper Wiki](https://www.gatekeeper.wiki)
3132

3233
If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/v4/docs/showcase.md)!

package-lock.json

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@
7979
"remark-rehype": "^11.1.0",
8080
"remark-smartypants": "^2.1.0",
8181
"rfdc": "^1.3.1",
82-
"rimraf": "^5.0.5",
82+
"rimraf": "^5.0.7",
8383
"serve-handler": "^6.1.5",
84-
"shiki": "^1.2.3",
84+
"shiki": "^1.6.0",
8585
"source-map-support": "^0.5.21",
8686
"to-vfile": "^8.0.0",
8787
"toml": "^3.0.0",
8888
"unified": "^11.0.4",
8989
"unist-util-visit": "^5.0.0",
9090
"vfile": "^6.0.1",
9191
"workerpool": "^9.1.1",
92-
"ws": "^8.15.1",
92+
"ws": "^8.17.0",
9393
"yargs": "^17.7.2"
9494
},
9595
"devDependencies": {
@@ -104,7 +104,7 @@
104104
"@types/yargs": "^17.0.32",
105105
"esbuild": "^0.19.9",
106106
"prettier": "^3.2.4",
107-
"tsx": "^4.9.3",
107+
"tsx": "^4.11.0",
108108
"typescript": "^5.4.5"
109109
}
110110
}

quartz.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const config: QuartzConfig = {
5858
Plugin.CreatedModifiedDate({
5959
priority: ["frontmatter", "filesystem"],
6060
}),
61-
Plugin.Latex({ renderEngine: "katex" }),
6261
Plugin.SyntaxHighlighting({
6362
theme: {
6463
light: "github-light",
@@ -71,6 +70,7 @@ const config: QuartzConfig = {
7170
Plugin.TableOfContents(),
7271
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
7372
Plugin.Description(),
73+
Plugin.Latex({ renderEngine: "katex" }),
7474
],
7575
filters: [Plugin.RemoveDrafts()],
7676
emitters: [

quartz.layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const defaultContentPageLayout: PageLayout = {
2626
Component.MobileOnly(Component.Spacer()),
2727
Component.Search(),
2828
Component.MobileOnly(Component.Darkmode()),
29-
Component.DesktopOnly(Component.RecentNotes({ linkToMore: "tags/" , limit: 3 })),
29+
Component.DesktopOnly(Component.RecentNotes({ linkToMore: "tags/" , limit: 3, showTags: false })),
3030
Component.DesktopOnly(Component.Explorer()),
3131
],
3232
right: [

quartz/components/RecentNotes.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface Options {
1212
title?: string
1313
limit: number
1414
linkToMore: SimpleSlug | false
15+
showTags: boolean
1516
filter: (f: QuartzPluginData) => boolean
1617
sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number
1718
}
@@ -20,6 +21,7 @@ const defaultOptions = (cfg: GlobalConfiguration): Options => ({
2021
title: "Recent Updates",
2122
limit: 3,
2223
linkToMore: false,
24+
showTags: true,
2325
filter: () => true,
2426
sort: byDateAndAlphabetical(cfg),
2527
})
@@ -57,19 +59,20 @@ export default ((userOpts?: Partial<Options>) => {
5759
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
5860
</p>
5961
)}
60-
{/* <ul class="tags">
61-
{tags.map((tag) => (
62-
<li>
63-
<a
64-
class="internal tag-link"
65-
66-
href={resolveRelative(fileDaAta.slug!, `tags/${tag}` as FullSlug)}
67-
>
68-
{tag}
69-
</a>
70-
</li>
71-
))}
72-
</ul> */}
62+
{opts.showTags && (
63+
<ul class="tags">
64+
{tags.map((tag) => (
65+
<li>
66+
<a
67+
class="internal tag-link"
68+
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
69+
>
70+
{tag}
71+
</a>
72+
</li>
73+
))}
74+
</ul>
75+
)}
7376
</div>
7477
</li>
7578
)

quartz/components/pages/404.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ import { i18n } from "../../i18n"
22
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
33

44
const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => {
5+
// If baseUrl contains a pathname after the domain, use this as the home link
6+
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
7+
const baseDir = url.pathname
8+
59
return (
610
<article class="popover-hint">
711
<h1>Oops</h1>
812
<p>I am still working on this note. Tell me <a href={"https://github.com/xy-241/CS-Notes/issues"}>here</a> if you want to read it urgently!</p>
913

1014
<p>Meanwhile, here is a cute cat to express my apologies 🥺👉🏻👈🏻</p>
15+
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
16+
<p></p>
1117
<img src={"https://cataas.com/cat/cute/says/Github Star Pls?fontColor=white&fontSize=50"} alt={"cuteCat"} />
1218

1319
{/* <p>{i18n(cfg.locale).pages.error.notFound}</p> */}

0 commit comments

Comments
 (0)