Skip to content

Commit c6f35d5

Browse files
Merge remote-tracking branch 'origin/main'
2 parents 2b5e803 + 8551f69 commit c6f35d5

28 files changed

+694
-53
lines changed

package-lock.json

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

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"github-slugger": "^2.0.0",
4949
"globby": "^14.0.1",
5050
"gray-matter": "^4.0.3",
51-
"hast-util-to-html": "^9.0.0",
51+
"hast-util-to-html": "^9.0.1",
5252
"hast-util-to-jsx-runtime": "^2.3.0",
5353
"hast-util-to-string": "^3.0.0",
5454
"is-absolute-url": "^4.0.1",
@@ -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.7.1",
108-
"typescript": "^5.4.3"
107+
"tsx": "^4.11.0",
108+
"typescript": "^5.4.5"
109109
}
110110
}

quartz.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const config: QuartzConfig = {
5656
Plugin.CreatedModifiedDate({
5757
priority: ["frontmatter", "filesystem"],
5858
}),
59-
Plugin.Latex({ renderEngine: "katex" }),
6059
Plugin.SyntaxHighlighting({
6160
theme: {
6261
light: "github-light",
@@ -69,6 +68,7 @@ const config: QuartzConfig = {
6968
Plugin.TableOfContents(),
7069
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
7170
Plugin.Description(),
71+
Plugin.Latex({ renderEngine: "katex" }),
7272
],
7373
filters: [Plugin.RemoveDrafts()],
7474
emitters: [

quartz/cfg.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export type Analytics =
3030
apiKey: string
3131
host?: string
3232
}
33+
| {
34+
provider: "tinylytics"
35+
siteId: string
36+
}
3337

3438
export interface GlobalConfiguration {
3539
pageTitle: string

quartz/components/RecentNotes.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ 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
}
1819

1920
const defaultOptions = (cfg: GlobalConfiguration): Options => ({
2021
limit: 3,
2122
linkToMore: false,
23+
showTags: true,
2224
filter: () => true,
2325
sort: byDateAndAlphabetical(cfg),
2426
})
@@ -56,18 +58,20 @@ export default ((userOpts?: Partial<Options>) => {
5658
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
5759
</p>
5860
)}
59-
<ul class="tags">
60-
{tags.map((tag) => (
61-
<li>
62-
<a
63-
class="internal tag-link"
64-
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
65-
>
66-
{tag}
67-
</a>
68-
</li>
69-
))}
70-
</ul>
61+
{opts.showTags && (
62+
<ul class="tags">
63+
{tags.map((tag) => (
64+
<li>
65+
<a
66+
class="internal tag-link"
67+
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
68+
>
69+
{tag}
70+
</a>
71+
</li>
72+
))}
73+
</ul>
74+
)}
7175
</div>
7276
</li>
7377
)

quartz/components/pages/404.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ 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>404</h1>
812
<p>{i18n(cfg.locale).pages.error.notFound}</p>
13+
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
914
</article>
1015
)
1116
}

quartz/components/scripts/graph.inline.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
223223
.transition()
224224
.duration(200)
225225
.style("opacity", 0.2)
226+
227+
d3.selectAll<HTMLElement, NodeData>(".node")
228+
.filter((d) => !connectedNodes.includes(d.id))
229+
.nodes()
230+
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
231+
.forEach((it) => {
232+
let opacity = parseFloat(it.style("opacity"))
233+
it.transition()
234+
.duration(200)
235+
.attr("opacityOld", opacity)
236+
.style("opacity", Math.min(opacity, 0.2))
237+
})
226238
}
227239

228240
// highlight links
@@ -245,6 +257,12 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
245257
if (focusOnHover) {
246258
d3.selectAll<HTMLElement, NodeData>(".link").transition().duration(200).style("opacity", 1)
247259
d3.selectAll<HTMLElement, NodeData>(".node").transition().duration(200).style("opacity", 1)
260+
261+
d3.selectAll<HTMLElement, NodeData>(".node")
262+
.filter((d) => !connectedNodes.includes(d.id))
263+
.nodes()
264+
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
265+
.forEach((it) => it.transition().duration(200).style("opacity", it.attr("opacityOld")))
248266
}
249267
const currentId = d.id
250268
const linkNodes = d3
@@ -264,6 +282,13 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
264282
// @ts-ignore
265283
.call(drag(simulation))
266284

285+
// make tags hollow circles
286+
node
287+
.filter((d) => d.id.startsWith("tags/"))
288+
.attr("stroke", color)
289+
.attr("stroke-width", 2)
290+
.attr("fill", "var(--light)")
291+
267292
// draw labels
268293
const labels = graphNode
269294
.append("text")

quartz/i18n/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import zh from "./locales/zh-CN"
1515
import vi from "./locales/vi-VN"
1616
import pt from "./locales/pt-BR"
1717
import hu from "./locales/hu-HU"
18+
import fa from "./locales/fa-IR"
19+
import pl from "./locales/pl-PL"
1820

1921
export const TRANSLATIONS = {
2022
"en-US": en,
@@ -54,6 +56,8 @@ export const TRANSLATIONS = {
5456
"vi-VN": vi,
5557
"pt-BR": pt,
5658
"hu-HU": hu,
59+
"fa-IR": fa,
60+
"pl-PL": pl,
5761
} as const
5862

5963
export const defaultTranslation = "en-US"

quartz/i18n/locales/ar-SA.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default {
7070
error: {
7171
title: "غير موجود",
7272
notFound: "إما أن هذه الصفحة خاصة أو غير موجودة.",
73+
home: "العوده للصفحة الرئيسية",
7374
},
7475
folderContent: {
7576
folder: "مجلد",

quartz/i18n/locales/de-DE.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Nicht gefunden",
6767
notFound: "Diese Seite ist entweder nicht öffentlich oder existiert nicht.",
68+
home: "Return to Homepage",
6869
},
6970
folderContent: {
7071
folder: "Ordner",

0 commit comments

Comments
 (0)