mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-27 22:14:40 +01:00
Compare commits
659
Commits
feat/bases
...
v5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce1b5d4d89 | ||
|
|
e02d690957 | ||
|
|
5d94a93a03 | ||
|
|
9a4beb1747 | ||
|
|
c03c643a7c | ||
|
|
74d06afca0 | ||
|
|
f285e12ff9 | ||
|
|
6729a1e7bb | ||
|
|
37a61cfc08 | ||
|
|
45ed91c90c | ||
|
|
9909b508e7 | ||
|
|
bd3ac11469 | ||
|
|
92fa358ef1 | ||
|
|
ae8049d0fa | ||
|
|
e42cdf469d | ||
|
|
747d10ce3a | ||
|
|
2635c6080a | ||
|
|
149c82f1da | ||
|
|
f47668e024 | ||
|
|
29be20f41c | ||
|
|
f7b41e7bbf | ||
|
|
7c24cc66e1 | ||
|
|
3df0062b6f | ||
|
|
beca3bc26d | ||
|
|
0e16919455 | ||
|
|
81b358224b | ||
|
|
0346dc6149 | ||
|
|
e0f1e03913 | ||
|
|
c79adab53b | ||
|
|
af36801547 | ||
|
|
b1fc7acd8e | ||
|
|
011c101cd3 | ||
|
|
690f7a0325 | ||
|
|
abfda7b85e | ||
|
|
f646ffe97d | ||
|
|
61b06fa295 | ||
|
|
39520c2aca | ||
|
|
842712113b | ||
|
|
8be4d8eadc | ||
|
|
7b4da1cbcc | ||
|
|
b2241c313e | ||
|
|
bc0e3937c3 | ||
|
|
9de19e3027 | ||
|
|
a51b7df1ce | ||
|
|
2b061ab9de | ||
|
|
0d05ef72d8 | ||
|
|
e07aad698d | ||
|
|
dd667ee315 | ||
|
|
673a596cf8 | ||
|
|
57cd6631d3 | ||
|
|
623e710fe8 | ||
|
|
8c612458cd | ||
|
|
1c48865b9f | ||
|
|
c608817610 | ||
|
|
2bea104934 | ||
|
|
5071ecd403 | ||
|
|
51c13bcca4 | ||
|
|
01f8f963ea | ||
|
|
11334aa029 | ||
|
|
c2293500d7 | ||
|
|
4172d3f56c | ||
|
|
09a6b0336a | ||
|
|
415af8a52d | ||
|
|
6ce31a4814 | ||
|
|
df11e31ef3 | ||
|
|
734e1b8531 | ||
|
|
b25eba0dca | ||
|
|
465d0e03eb | ||
|
|
3a1dc46aab | ||
|
|
d5dad620d8 | ||
|
|
661b56afc3 | ||
|
|
2209ee6d7d | ||
|
|
caec7d24ee | ||
|
|
773e2c7fe1 | ||
|
|
96fc9c1bfb | ||
|
|
7ef986a16b | ||
|
|
a5b07e3c48 | ||
|
|
c97a377b84 | ||
|
|
52af9f1a29 | ||
|
|
093d233d2c | ||
|
|
a55f25f185 | ||
|
|
050586dc14 | ||
|
|
0cfcfc868b | ||
|
|
2f2c35d64c | ||
|
|
fb6464ef68 | ||
|
|
dc10654108 | ||
|
|
c33b6cfc48 | ||
|
|
3ab4503fe0 | ||
|
|
799b8e370f | ||
|
|
9d6cdba8e4 | ||
|
|
71454c77b6 | ||
|
|
8417bdc03f | ||
|
|
db7484e05e | ||
|
|
52f7895ea6 | ||
|
|
0bab8ea1bb | ||
|
|
282ef789b6 | ||
|
|
c97c545f0c | ||
|
|
e85dceaf23 | ||
|
|
7ce0665400 | ||
|
|
cc22cfe413 | ||
|
|
ed5912a53b | ||
|
|
43e2eb9e11 | ||
|
|
cfa0413736 | ||
|
|
a96d993bf5 | ||
|
|
09c0e5203d | ||
|
|
d70ab4e164 | ||
|
|
fd744c0a9e | ||
|
|
d9566ec223 | ||
|
|
72097c86e4 | ||
|
|
9c172ca3a4 | ||
|
|
39ecd2a76d | ||
|
|
a9b4be1046 | ||
|
|
b7316ae8fa | ||
|
|
d77bc173d3 | ||
|
|
488da675e7 | ||
|
|
16bc33e9fb | ||
|
|
33acb1c716 | ||
|
|
6f689dcdb9 | ||
|
|
4679f825fd | ||
|
|
05b5082388 | ||
|
|
c4d02241d5 | ||
|
|
8ce7599280 | ||
|
|
edd97cc665 | ||
|
|
fd8256e4a0 | ||
|
|
fd1e5eb8bf | ||
|
|
7c3df898ed | ||
|
|
5bec47ee54 | ||
|
|
ea2b3485bf | ||
|
|
857de3b2bc | ||
|
|
df13ac29e5 | ||
|
|
3b78d1658d | ||
|
|
c568c93fa0 | ||
|
|
dfd1d6bd67 | ||
|
|
b4d73585f7 | ||
|
|
723759f931 | ||
|
|
f5773b611f | ||
|
|
7714325740 | ||
|
|
4036e25a77 | ||
|
|
c770681ba8 | ||
|
|
55311cb0bc | ||
|
|
cc253bea53 | ||
|
|
2386362d57 | ||
|
|
d533468802 | ||
|
|
048519774a | ||
|
|
ee1cdffd0d | ||
|
|
08fddad0e8 | ||
|
|
506a7caa8c | ||
|
|
678398d235 | ||
|
|
6f82d03fd4 | ||
|
|
95e96b4871 | ||
|
|
23b70cdba0 | ||
|
|
829bec461f | ||
|
|
c392e177a7 | ||
|
|
3f8104fb50 | ||
|
|
7531e678f5 | ||
|
|
568004496b | ||
|
|
d80bb003f1 | ||
|
|
6f79e008e2 | ||
|
|
166d09b876 | ||
|
|
3960252445 | ||
|
|
436cce7610 | ||
|
|
4ed26b3943 | ||
|
|
8f469ed237 | ||
|
|
cdc5a0297f | ||
|
|
1dfe7fcdb0 | ||
|
|
7453f7f0d0 | ||
|
|
9c46b01c57 | ||
|
|
842a293ab1 | ||
|
|
6f872d4302 | ||
|
|
8578f2fdb2 | ||
|
|
5b863b0752 | ||
|
|
d092a3179b | ||
|
|
dacfeba928 | ||
|
|
5fafbf37b7 | ||
|
|
2e4ef40bc0 | ||
|
|
99685cf741 | ||
|
|
b58a7f20fe | ||
|
|
49d05638f2 | ||
|
|
d7d6c7b17f | ||
|
|
db2ce262b7 | ||
|
|
29a5bdf4b9 | ||
|
|
97059690a0 | ||
|
|
e2e248b9b8 | ||
|
|
9a04652b4f | ||
|
|
b19cdb8a09 | ||
|
|
ed4f6537e0 | ||
|
|
64dde0cb9c | ||
|
|
d8e2c7fb43 | ||
|
|
61329d2f74 | ||
|
|
ffc6e36ee9 | ||
|
|
46312a6197 | ||
|
|
607ccb8561 | ||
|
|
2fda5546dc | ||
|
|
006b75e4b0 | ||
|
|
e342ec5943 | ||
|
|
6a9d08ae1a | ||
|
|
f690faad9e | ||
|
|
546703340e | ||
|
|
7cfb079616 | ||
|
|
bdc1c71f65 | ||
|
|
beeeed45b8 | ||
|
|
0ab525ce4d | ||
|
|
2ec28ddd04 | ||
|
|
da4fb9bb7b | ||
|
|
b84c323224 | ||
|
|
ba5a9a6ce0 | ||
|
|
08e9470577 | ||
|
|
f520811260 | ||
|
|
7e45c5489e | ||
|
|
922bb80cb6 | ||
|
|
2a4ab673dc | ||
|
|
7236249485 | ||
|
|
6e91a0010b | ||
|
|
edb64cd331 | ||
|
|
be42e8e664 | ||
|
|
d8794ea388 | ||
|
|
af5246ce33 | ||
|
|
85d2b43df0 | ||
|
|
db6e72fad7 | ||
|
|
e8a192ece5 | ||
|
|
e41ebf644a | ||
|
|
33ff9eaccf | ||
|
|
fa89733d4f | ||
|
|
6210f284d2 | ||
|
|
ac8cc4b045 | ||
|
|
0770178fa5 | ||
|
|
8854aebf7d | ||
|
|
bebabb1445 | ||
|
|
7d255c3a0b | ||
|
|
f5ef8f738d | ||
|
|
e7da9cebf4 | ||
|
|
28581e8e54 | ||
|
|
4ff86a7809 | ||
|
|
7688df602b | ||
|
|
fc865525b7 | ||
|
|
0f294f7139 | ||
|
|
3c7cba46ae | ||
|
|
4683f8b462 | ||
|
|
8be3806431 | ||
|
|
98cfbfabe8 | ||
|
|
6c91c6d621 | ||
|
|
f687f582f6 | ||
|
|
03996bb87a | ||
|
|
f30980744a | ||
|
|
483b7629e5 | ||
|
|
fe6a3ea879 | ||
|
|
df7e0180da | ||
|
|
0787f97149 | ||
|
|
b29db43197 | ||
|
|
214f478389 | ||
|
|
66f2578e42 | ||
|
|
addf542511 | ||
|
|
01bc5c5c88 | ||
|
|
60c8318b34 | ||
|
|
e3e3d5f398 | ||
|
|
28fcb64720 | ||
|
|
99909ddb22 | ||
|
|
2ef60c6be5 | ||
|
|
f8b563867b | ||
|
|
913f9f06b5 | ||
|
|
8a62b70b1d | ||
|
|
22c18d1981 | ||
|
|
e5332d4491 | ||
|
|
9f9547eb2d | ||
|
|
b2da325a32 | ||
|
|
986aa227a8 | ||
|
|
ec1d0b4c06 | ||
|
|
eab5c532c7 | ||
|
|
6b7bc28912 | ||
|
|
e4ebd28c0d | ||
|
|
b7998bbd2d | ||
|
|
edfa7f1f1b | ||
|
|
c24663f1ab | ||
|
|
5f503715ab | ||
|
|
6c6aaaa322 | ||
|
|
158a9b5c0f | ||
|
|
08c2857aa6 | ||
|
|
0778a9a157 | ||
|
|
1f19843db2 | ||
|
|
15b8eeffbf | ||
|
|
5b6de1fe4c | ||
|
|
3e4a50a5ed | ||
|
|
5507de3365 | ||
|
|
31bcb34ca7 | ||
|
|
671ca4921e | ||
|
|
0a475bd328 | ||
|
|
3103485049 | ||
|
|
63ea0b7190 | ||
|
|
ab4426337a | ||
|
|
a78706f710 | ||
|
|
3eaf219196 | ||
|
|
1b4644157b | ||
|
|
e44f2b0364 | ||
|
|
76de2838a1 | ||
|
|
981c64af98 | ||
|
|
4920dae17e | ||
|
|
7ffd3a818a | ||
|
|
774f76335a | ||
|
|
571dde2d86 | ||
|
|
fb96a9d8cd | ||
|
|
114ffc4a86 | ||
|
|
73a06a0ba8 | ||
|
|
3111df2366 | ||
|
|
96f62ec88c | ||
|
|
5c581299a9 | ||
|
|
8f4a816944 | ||
|
|
b6bcd4f6cc | ||
|
|
295e822cf9 | ||
|
|
9fa4fa7bf0 | ||
|
|
7cf595d20a | ||
|
|
096350cf0e | ||
|
|
6e87fda4a5 | ||
|
|
8eae6a1277 | ||
|
|
3c18be8c71 | ||
|
|
67ae68e9a4 | ||
|
|
c84f348039 | ||
|
|
6e9f5c45d8 | ||
|
|
d66968cd7c | ||
|
|
50203da448 | ||
|
|
ea75b1bdc8 | ||
|
|
1cc1439e20 | ||
|
|
f768b1eb7c | ||
|
|
18deab128c | ||
|
|
13a3d1865c | ||
|
|
052ebb23d5 | ||
|
|
3b8095bdf7 | ||
|
|
e49024cca5 | ||
|
|
d2c95da653 | ||
|
|
340672580e | ||
|
|
d89a8c76ea | ||
|
|
e1ab1269f8 | ||
|
|
e31990aaea | ||
|
|
f3e02aff39 | ||
|
|
9eebd805d7 | ||
|
|
7e449b8974 | ||
|
|
09097db511 | ||
|
|
461646361b | ||
|
|
fbabc76d4a | ||
|
|
4ef1814ec1 | ||
|
|
97a2d05f80 | ||
|
|
5e78078ff7 | ||
|
|
b080c219b9 | ||
|
|
3dff48b5df | ||
|
|
5519ffe5d9 | ||
|
|
afe7e68ff0 | ||
|
|
4bfe60a28a | ||
|
|
9be7f42b42 | ||
|
|
f8b1a4d7aa | ||
|
|
233a975a32 | ||
|
|
f1fba3fc55 | ||
|
|
2176a4ae03 | ||
|
|
75f485bd2f | ||
|
|
4ef8d6cbc7 | ||
|
|
50227ba2c3 | ||
|
|
254af5dcff | ||
|
|
762f7634b4 | ||
|
|
f5fa2343a4 | ||
|
|
1930712042 | ||
|
|
041de1c692 | ||
|
|
631f6b45b5 | ||
|
|
075afd3f71 | ||
|
|
990884386a | ||
|
|
74b3fc9efd | ||
|
|
7076a897e1 | ||
|
|
507ad7f3d4 | ||
|
|
41864a0eba | ||
|
|
508f73a33f | ||
|
|
6f27207fbf | ||
|
|
89fb2afe6f | ||
|
|
a121fd2e96 | ||
|
|
e37b4888f3 | ||
|
|
e22d4446b4 | ||
|
|
c2e1a619f0 | ||
|
|
754058ad54 | ||
|
|
2a5e3ae574 | ||
|
|
94fcabb0b4 | ||
|
|
26a5a86d77 | ||
|
|
326bc49b96 | ||
|
|
3c8726834a | ||
|
|
a791a4f12d | ||
|
|
581f6707da | ||
|
|
555b2ba838 | ||
|
|
3d99dca87d | ||
|
|
966307e0d0 | ||
|
|
ebdbb3da21 | ||
|
|
49785911c9 | ||
|
|
e8ccb7991c | ||
|
|
11b9960663 | ||
|
|
4b7ecb96f0 | ||
|
|
a71cbfbeed | ||
|
|
b6939da24d | ||
|
|
6fdeaef8c2 | ||
|
|
eefff261a6 | ||
|
|
7ed01ddd43 | ||
|
|
fe1f1d30aa | ||
|
|
57094a8fee | ||
|
|
97eea3ee34 | ||
|
|
ab8e77392c | ||
|
|
f45b9d42bd | ||
|
|
af583c167a | ||
|
|
de21613607 | ||
|
|
69571de66e | ||
|
|
5b34917e98 | ||
|
|
e56ffae883 | ||
|
|
b4cb37d8bf | ||
|
|
ca70ffd03b | ||
|
|
9cf87ff1c2 | ||
|
|
e54b89f889 | ||
|
|
e12ca11100 | ||
|
|
92a4a48430 | ||
|
|
9e74db69a9 | ||
|
|
25d89ff94a | ||
|
|
decbd0a969 | ||
|
|
87083faeb6 | ||
|
|
58593c7c72 | ||
|
|
8a79f59abb | ||
|
|
2000295346 | ||
|
|
c5bbc92b74 | ||
|
|
b2f1dad514 | ||
|
|
81db804f54 | ||
|
|
9737bce709 | ||
|
|
951dfee599 | ||
|
|
afe98e6b1a | ||
|
|
f15aa0032a | ||
|
|
9e4d4518bd | ||
|
|
3138a88bb1 | ||
|
|
db5aca2b8d | ||
|
|
dd1b36c148 | ||
|
|
4579e49465 | ||
|
|
882d3b3f50 | ||
|
|
667d487a0f | ||
|
|
36b3542371 | ||
|
|
b24f2a5e7b | ||
|
|
ad685b8d4e | ||
|
|
2862ec7303 | ||
|
|
9ac5d6e7e6 | ||
|
|
399cdd83d2 | ||
|
|
336b3ea131 | ||
|
|
24975c6975 | ||
|
|
4a06ee6b44 | ||
|
|
cbe101dc12 | ||
|
|
29dea35776 | ||
|
|
257f004bbf | ||
|
|
51ba21804d | ||
|
|
2dc58a33df | ||
|
|
22fc3b5cef | ||
|
|
d6414218de | ||
|
|
c837425148 | ||
|
|
cf28741977 | ||
|
|
cce45e0718 | ||
|
|
38395a1bac | ||
|
|
228218ece8 | ||
|
|
27639d5ab5 | ||
|
|
97472ebf88 | ||
|
|
9f7caa96f4 | ||
|
|
ee683e0e86 | ||
|
|
ed0f27c05f | ||
|
|
d45b7a7bf6 | ||
|
|
c4b0145e59 | ||
|
|
629efafafe | ||
|
|
eb53936ec7 | ||
|
|
2455c87167 | ||
|
|
455985f7ef | ||
|
|
601f23f132 | ||
|
|
6b3c72d11e | ||
|
|
0d9b356046 | ||
|
|
7f00400ad2 | ||
|
|
caa55037f7 | ||
|
|
17aa8ab233 | ||
|
|
bdc3347c75 | ||
|
|
dfde22acfd | ||
|
|
b1e5d3a7cc | ||
|
|
4d715774e1 | ||
|
|
097f3040fb | ||
|
|
0593c8cd6a | ||
|
|
5b6588189f | ||
|
|
c206aa3c02 | ||
|
|
2a02240802 | ||
|
|
cfcd9c18ac | ||
|
|
cfba672f51 | ||
|
|
2e34c64c63 | ||
|
|
70c2aa0f53 | ||
|
|
afb84b1ffe | ||
|
|
05b79e1d60 | ||
|
|
f681e871ea | ||
|
|
bc1c6a47d8 | ||
|
|
c6d7da00b2 | ||
|
|
0c008d49c2 | ||
|
|
7c7e8789ca | ||
|
|
4a9000cd16 | ||
|
|
307f3b9298 | ||
|
|
d88e97c769 | ||
|
|
7fd0590a46 | ||
|
|
0c63884f65 | ||
|
|
47e0ba3a58 | ||
|
|
0e314cb1eb | ||
|
|
635d2af12e | ||
|
|
21ea5895cb | ||
|
|
9031614318 | ||
|
|
cb83ed320f | ||
|
|
3da68acd02 | ||
|
|
38eca77b5e | ||
|
|
17efeb93f3 | ||
|
|
c8f6e6dc14 | ||
|
|
f3a549a68d | ||
|
|
a76af2866b | ||
|
|
9fcc3f260c | ||
|
|
886bf6d7f6 | ||
|
|
24f2a7325a | ||
|
|
4914242ef9 | ||
|
|
907cef735b | ||
|
|
efd9e8e095 | ||
|
|
6a2bb304d2 | ||
|
|
8e45841e34 | ||
|
|
a85c3bd814 | ||
|
|
dfc2369140 | ||
|
|
710db1f161 | ||
|
|
4ffe041f13 | ||
|
|
b3082c32dc | ||
|
|
ff19a3bf38 | ||
|
|
dc88017b37 | ||
|
|
4fc6be7850 | ||
|
|
e15b3da014 | ||
|
|
f370898c56 | ||
|
|
cab4b523df | ||
|
|
6c3b94e474 | ||
|
|
c32d11cb8b | ||
|
|
0572f06d08 | ||
|
|
17d5ae76bf | ||
|
|
f711071020 | ||
|
|
85563ffaab | ||
|
|
6def58c0d0 | ||
|
|
5f513a80bb | ||
|
|
9c118804a9 | ||
|
|
5bec6fb87b | ||
|
|
b9d4298321 | ||
|
|
64001920a0 | ||
|
|
64802f858b | ||
|
|
7e01af6a4d | ||
|
|
232781cbca | ||
|
|
2c1d9b5fb6 | ||
|
|
b8b71edffe | ||
|
|
d2e2df8518 | ||
|
|
afa63033cc | ||
|
|
9d26e48dc5 | ||
|
|
341b800663 | ||
|
|
07c9bb6976 | ||
|
|
512d48d719 | ||
|
|
bbcaa22413 | ||
|
|
7a86a76f44 | ||
|
|
c4c6016755 | ||
|
|
f5b66ec3f0 | ||
|
|
0f84b66cea | ||
|
|
88337abbe1 | ||
|
|
2bf6cb655b | ||
|
|
5c934ca1c6 | ||
|
|
9c62152257 | ||
|
|
287d41b2ac | ||
|
|
1f555cf6c4 | ||
|
|
e0fadf7e77 | ||
|
|
31ca75e762 | ||
|
|
0c50cca1f6 | ||
|
|
b7885ce779 | ||
|
|
1d5d069174 | ||
|
|
2a6117142c | ||
|
|
52e4257bda | ||
|
|
785ac92347 | ||
|
|
c0d3a30fdd | ||
|
|
2180e2e17b | ||
|
|
712b4477b7 | ||
|
|
00c4e392ff | ||
|
|
1342728ce2 | ||
|
|
84ee01f790 | ||
|
|
8e7100a562 | ||
|
|
3012aa01ea | ||
|
|
04912ac2e5 | ||
|
|
db2cc6abca | ||
|
|
704484d6a5 | ||
|
|
0b377b36d6 | ||
|
|
442159a21c | ||
|
|
13f8d5b41b | ||
|
|
4a8b10f60d | ||
|
|
dce936ffd4 | ||
|
|
31ad9edd2a | ||
|
|
144b7d9a4a | ||
|
|
a876a1e11e | ||
|
|
8a98878e5c | ||
|
|
328ef01c67 | ||
|
|
2d579c0f9e | ||
|
|
f881d5e332 | ||
|
|
6d08b5f070 | ||
|
|
96bf848aa9 | ||
|
|
31d5c025b2 | ||
|
|
434c166ed0 | ||
|
|
c1de25ebe8 | ||
|
|
619a3b7f0f | ||
|
|
b61e023759 | ||
|
|
d9bfbf876f | ||
|
|
28414da76e | ||
|
|
c7b527ae9f | ||
|
|
d413917f8f | ||
|
|
f7ead71ee5 | ||
|
|
67c5433fe6 | ||
|
|
4c854f845c | ||
|
|
627fa78f19 | ||
|
|
b4e07a560e | ||
|
|
de4826a83f | ||
|
|
49a1ddfd84 | ||
|
|
cd17a74eeb | ||
|
|
cc6cb46114 | ||
|
|
954306ab21 | ||
|
|
da6c498dc9 | ||
|
|
db11f757c2 | ||
|
|
c65fb652d2 | ||
|
|
7cd15f5aba | ||
|
|
1b999a792f | ||
|
|
75aef3b0a9 | ||
|
|
f2c2a31292 | ||
|
|
166b9c87d8 | ||
|
|
a7dca22667 | ||
|
|
bd32a98749 | ||
|
|
219bed15bf | ||
|
|
7b85aa3464 | ||
|
|
b2ae694b9a | ||
|
|
51b05e79e2 | ||
|
|
13a25cbfaf | ||
|
|
94cb313ce6 | ||
|
|
02488d07b2 | ||
|
|
d792d8ebf9 | ||
|
|
a932000421 | ||
|
|
56a801345a | ||
|
|
f7f33444ca | ||
|
|
7e28a970e7 | ||
|
|
49caf725dd | ||
|
|
24634934d1 | ||
|
|
4bb075cc64 | ||
|
|
14328062da | ||
|
|
6ec256dcbc | ||
|
|
52ca3aef4c | ||
|
|
0f67327a6c | ||
|
|
b2971bde6b | ||
|
|
cc8756b0c7 | ||
|
|
b11bad1326 | ||
|
|
f8c9a2926d | ||
|
|
1b878e655e | ||
|
|
a7d91f05f9 | ||
|
|
821e124ca2 | ||
|
|
cd8abda27c | ||
|
|
cdda0dc520 | ||
|
|
b0724bf99d | ||
|
|
341b8b3779 | ||
|
|
85680868b7 | ||
|
|
6dbb287c14 | ||
|
|
171ddcf753 | ||
|
|
5ec3f4a13a | ||
|
|
ab346fa66a | ||
|
|
bc99b4a636 | ||
|
|
a6b83da067 | ||
|
|
33dc50267b |
No files matched your search
@@ -0,0 +1,13 @@
|
||||
# Changesets
|
||||
|
||||
Quartz is versioned with [changesets](https://github.com/changesets/changesets). Every pull request that changes how Quartz behaves should include a changeset:
|
||||
|
||||
```shell
|
||||
npx changeset
|
||||
```
|
||||
|
||||
Pick the bump (`patch` for fixes, `minor` for new features and new plugin APIs, `major` for breaking changes) and describe the change for users — the text ends up in `CHANGELOG.md` and the GitHub release notes.
|
||||
|
||||
On every push to `v5`, the release workflow opens (or updates) a "chore: release Quartz" pull request that bumps the version in `package.json` and writes `CHANGELOG.md`. Merging it tags the commit `vX.Y.Z` and publishes a GitHub release. Quartz is not published to npm.
|
||||
|
||||
See `docs/advanced/versioning.md` for what the version means for users and plugin authors.
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "restricted",
|
||||
"baseBranch": "v5",
|
||||
"updateInternalDependencies": "patch",
|
||||
"privatePackages": {
|
||||
"version": true,
|
||||
"tag": true
|
||||
},
|
||||
"ignore": []
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
A plugin that depends on a plugin of another pipeline stage (an emitter or component on a transformer) no longer fails the build because of their `order`: order is checked only between plugins of the same stage.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Plugin updates with the fixes from a test audit:
|
||||
|
||||
- note-properties: an empty `tags:` or `aliases:` no longer fails the build.
|
||||
- bases-page: sorting, filters, formulas and group headings work as in Obsidian.
|
||||
- encrypted-pages: a numeric `password` encrypts the page, and a custom `outputPath` works.
|
||||
- darkmode, reader-mode, syntax-highlighting and comments: no double handlers after a page is unlocked.
|
||||
- stacked-pages: links work under a base path.
|
||||
- breadcrumbs: `resolveFrontmatterTitle` is honoured.
|
||||
- canvas-page: a `#View` link selects that view.
|
||||
- search: fields left out of `fieldPriority` are searched, and excerpts keep their last word.
|
||||
- explorer: a note next to a folder of the same name stays listed, and folder options apply.
|
||||
- folder-page, og-image, description, table-of-contents, graph, obsidian-flavored-markdown and utils: smaller fixes.
|
||||
- latex: `customMacros` work with MathJax. ox-hugo: figure parameters in backticks.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Relative links and embeds keep their query string after SPA navigation and in popovers (`./viewer.html?file=a.pdf` no longer loses `?file=a.pdf`).
|
||||
@@ -28,13 +28,19 @@ You can help speed up fixing the problem by either
|
||||
1. providing a simple reproduction
|
||||
2. linking to your Quartz repository where the problem can be observed
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
**Quartz info**
|
||||
Run `npx quartz info` in your Quartz folder and paste its output here. It lists your Quartz version, Node/npm/OS and every plugin with its version — no content or site URL is included.
|
||||
|
||||
- Quartz Version: [e.g. v4.1.2]
|
||||
- `node` Version: [e.g. v18.16]
|
||||
- `npm` version: [e.g. v10.1.0]
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
```
|
||||
Paste the output of `npx quartz info` here
|
||||
```
|
||||
|
||||
(Quartz older than 5.1 doesn't have `npx quartz info`: give the Quartz version from `package.json` and the output of `git log -1 --format=%h`, plus your `node` and `npm` versions and OS.)
|
||||
|
||||
**Browser** (for display problems): [e.g. Firefox 140, Safari on iOS 18]
|
||||
|
||||
**Build output**
|
||||
If the build failed or printed warnings, paste the full output of `npx quartz build`, including the summary at the end.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -4,11 +4,36 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
# Plugins declare these as peer dependencies (preact by 42 plugins, vfile by 15), so a
|
||||
# major bump here passes `npm ci` but breaks plugins at runtime (#2586). Upgrade them
|
||||
# deliberately, together with the plugins.
|
||||
ignore:
|
||||
- dependency-name: "preact"
|
||||
update-types: ["version-update:semver-major"]
|
||||
- dependency-name: "vfile"
|
||||
update-types: ["version-update:semver-major"]
|
||||
- dependency-name: "unified"
|
||||
update-types: ["version-update:semver-major"]
|
||||
groups:
|
||||
# Separated so a risky third-party major cannot block ecosystem updates.
|
||||
quartz-ecosystem:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "@quartz-community/*"
|
||||
- "@quartz-themes/*"
|
||||
# Isolated because a compiler major needs a tsconfig migration of its own.
|
||||
typescript:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "typescript"
|
||||
production-dependencies:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "*"
|
||||
exclude-patterns:
|
||||
- "@quartz-community/*"
|
||||
- "@quartz-themes/*"
|
||||
- "typescript"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
@@ -11,24 +11,35 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build Preview
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- run: npm ci
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Check types and style
|
||||
run: npm run check
|
||||
@@ -37,7 +48,7 @@ jobs:
|
||||
run: npx quartz build -d docs -v
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: preview-build
|
||||
path: public
|
||||
+29
-11
@@ -3,10 +3,10 @@ name: Build and Test
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- v4
|
||||
- v5
|
||||
push:
|
||||
branches:
|
||||
- v4
|
||||
- v5
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -19,24 +19,35 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- run: npm ci
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Check types and style
|
||||
run: npm run check
|
||||
@@ -47,19 +58,26 @@ jobs:
|
||||
- name: Ensure Quartz builds, check bundle info
|
||||
run: npx quartz build --bundleInfo -d docs
|
||||
|
||||
- name: Check for a changeset
|
||||
if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' }}
|
||||
# Non-blocking: docs-only or internal changes don't need one.
|
||||
run: |
|
||||
npx changeset status --since=origin/v5 >/dev/null 2>&1 \
|
||||
|| echo "::warning::No changeset in this PR. If it changes how Quartz behaves, run 'npx changeset' (see .changeset/README.md)."
|
||||
|
||||
publish-tag:
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v4' }}
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v5' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
- name: Get package version
|
||||
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
|
||||
- name: Create release tag
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
name: Dependabot Auto-merge
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build and Test"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
auto-merge:
|
||||
if: >-
|
||||
github.repository == 'jackyzha0/quartz' &&
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'pull_request' &&
|
||||
github.event.workflow_run.actor.login == 'dependabot[bot]' &&
|
||||
contains(github.event.workflow_run.head_branch, 'quartz-ecosystem')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Resolve pull request
|
||||
id: pr
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
number=$(gh pr list --state open --json number,headRefOid \
|
||||
--jq "map(select(.headRefOid == \"${HEAD_SHA}\")) | .[0].number // empty")
|
||||
if [ -z "$number" ]; then
|
||||
echo "No open PR matches ${HEAD_SHA}; nothing to merge."
|
||||
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "number=${number}" >> "$GITHUB_OUTPUT"
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Require every check on the commit to have succeeded
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
runs=$(gh api "repos/${GH_REPO}/commits/${HEAD_SHA}/check-runs" --paginate \
|
||||
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "")"')
|
||||
echo "$runs"
|
||||
bad=$(printf '%s\n' "$runs" | awk -F'\t' '
|
||||
$2 != "completed" { print; next }
|
||||
$3 != "success" && $3 != "neutral" && $3 != "skipped" { print }
|
||||
')
|
||||
if [ -n "$bad" ]; then
|
||||
echo "Refusing to merge - not all checks succeeded:"
|
||||
printf '%s\n' "$bad"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Confirm update is not a major bump
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
title=$(gh pr view "$PR_NUMBER" --json title --jq .title)
|
||||
echo "PR title: $title"
|
||||
if printf '%s' "$title" | grep -qiE 'major'; then
|
||||
echo "Refusing to merge a major update; needs human review."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Merge
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: gh pr merge "$PR_NUMBER" --squash --delete-branch
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
name: Deploy Preview to Cloudflare Pages
|
||||
steps:
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
id: preview-build-artifact
|
||||
with:
|
||||
name: preview-build
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
name: Deploy v5 Preview
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v5
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
jobs:
|
||||
deploy-v5:
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' }}
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy v5 to Cloudflare Pages
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Check types and style
|
||||
run: npm run check
|
||||
|
||||
- name: Build Quartz
|
||||
run: npx quartz build -d docs -v
|
||||
|
||||
- name: Deploy to Cloudflare Pages
|
||||
uses: AdrianGonz97/refined-cf-pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectName: quartz
|
||||
deploymentName: v5 Branch Preview
|
||||
branch: v5
|
||||
directory: public
|
||||
@@ -2,10 +2,10 @@ name: Docker build & push image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [v4]
|
||||
branches: [v5]
|
||||
tags: ["v*"]
|
||||
pull_request:
|
||||
branches: [v4]
|
||||
branches: [v5]
|
||||
paths:
|
||||
- .github/workflows/docker-build-push.yaml
|
||||
- quartz/**
|
||||
@@ -21,15 +21,15 @@ jobs:
|
||||
echo "OWNER_LOWERCASE=${OWNER,,}" >> ${GITHUB_ENV}
|
||||
env:
|
||||
OWNER: "${{ github.repository_owner }}"
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Inject slug/short variables
|
||||
uses: rlespinasse/github-slug-action@v5.4.0
|
||||
uses: rlespinasse/github-slug-action@v5.7.1
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
install: true
|
||||
driver-opts: |
|
||||
@@ -37,9 +37,9 @@ jobs:
|
||||
network=host
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@v4.0.0
|
||||
uses: sigstore/cosign-installer@v4.1.3
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- name: Extract metadata tags and labels on PRs
|
||||
if: github.event_name == 'pull_request'
|
||||
id: meta-pr
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
|
||||
tags: |
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
- name: Extract metadata tags and labels for main, release or tag
|
||||
if: github.event_name != 'pull_request'
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
flavor: |
|
||||
latest=auto
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
build-args: |
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
name: Release
|
||||
|
||||
# Versioning with changesets (see .changeset/README.md):
|
||||
# 1. While .changeset/*.md files are pending on v5, keep a "chore: release Quartz" PR open that
|
||||
# bumps package.json and writes CHANGELOG.md.
|
||||
# 2. When that PR is merged (no pending changesets left), tag the commit vX.Y.Z and publish a
|
||||
# GitHub release with the CHANGELOG section. Quartz is not published to npm.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v5
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
actions: write # start the Docker build for the new tag
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Create or update the release PR
|
||||
id: changesets
|
||||
uses: changesets/action@v2
|
||||
with:
|
||||
version-script: npm run version-packages
|
||||
pr-title: "chore: release Quartz"
|
||||
commit-message: "chore: release Quartz"
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Tag and publish the GitHub release
|
||||
if: steps.changesets.outputs.has-changesets == 'false'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Each step can be re-run: an existing tag on this commit, or an existing release, is
|
||||
# kept, and the Docker build is started again (a failed run used to stop at "already
|
||||
# exists" on the next attempt).
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
TAG="v$VERSION"
|
||||
# The commit the tag points at on GitHub (empty when there is no tag yet); an annotated
|
||||
# tag is followed to its commit.
|
||||
tag_commit() {
|
||||
local ref type sha
|
||||
ref=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" --jq '.object.type + " " + .object.sha' 2>/dev/null) || return 0
|
||||
read -r type sha <<<"$ref"
|
||||
if [ "$type" = "tag" ]; then
|
||||
sha=$(gh api "repos/$GITHUB_REPOSITORY/git/tags/$sha" --jq '.object.sha')
|
||||
fi
|
||||
echo "$sha"
|
||||
}
|
||||
EXISTING=$(tag_commit)
|
||||
if [ -n "$EXISTING" ] && [ "$EXISTING" != "$GITHUB_SHA" ]; then
|
||||
if git merge-base --is-ancestor "$EXISTING" "$GITHUB_SHA" 2>/dev/null; then
|
||||
echo "$TAG was released at $EXISTING — nothing to release."
|
||||
exit 0
|
||||
fi
|
||||
echo "::error::$TAG already exists but points at $EXISTING, which is not this commit ($GITHUB_SHA) or one of its ancestors. Check the tag (delete it if it is wrong), then re-run this workflow."
|
||||
exit 1
|
||||
fi
|
||||
# Only versions produced by `changeset version` are released (guards against tagging
|
||||
# an arbitrary commit with a version that was never released through this workflow).
|
||||
awk -v v="## $VERSION" '$0 == v {found=1; next} found && /^## / {exit} found' CHANGELOG.md > release-notes.md || true
|
||||
if [ ! -s release-notes.md ]; then
|
||||
echo "CHANGELOG.md has no section for $VERSION — not tagging."
|
||||
exit 0
|
||||
fi
|
||||
# The tag is a lightweight ref straight to the merged release commit, created here
|
||||
# before the release. GitHub signs the commits it merges, so the tag shows as verified.
|
||||
# Letting `gh release create` make the tag instead gives an unsigned annotated tag
|
||||
# object (tagger: whoever merged the release PR), which GitHub marks "Unverified"
|
||||
# (jackyzha0/quartz#2455). `git describe --tags` reads lightweight tags as well.
|
||||
if [ -z "$EXISTING" ]; then
|
||||
gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$TAG" -f sha="$GITHUB_SHA" >/dev/null
|
||||
else
|
||||
echo "$TAG already points at this commit — keeping it."
|
||||
fi
|
||||
if gh release view "$TAG" >/dev/null 2>&1; then
|
||||
echo "The $TAG release already exists — keeping it."
|
||||
else
|
||||
gh release create "$TAG" --verify-tag --title "Quartz $VERSION" --notes-file release-notes.md
|
||||
fi
|
||||
# A tag created with GITHUB_TOKEN doesn't trigger `on: push: tags`, so the Docker workflow
|
||||
# never built the versioned images; start it for the tag explicitly. Started with
|
||||
# `--ref vX.Y.Z`, the run's GITHUB_REF is refs/tags/vX.Y.Z, which is all
|
||||
# docker/metadata-action's `type=semver` tags need (it checks the ref, not the event).
|
||||
gh workflow run docker-build-push.yaml --ref "$TAG"
|
||||
@@ -9,3 +9,6 @@ tsconfig.tsbuildinfo
|
||||
private/
|
||||
.replit
|
||||
replit.nix
|
||||
.quartz/
|
||||
quartz/cli/tui/dist/
|
||||
.turbo/
|
||||
+1
-1
@@ -1 +1 @@
|
||||
v22.16.0
|
||||
v22.22.0
|
||||
+15
-1
@@ -3,5 +3,19 @@
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"tabWidth": 2,
|
||||
"semi": false
|
||||
"semi": false,
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.canvas",
|
||||
"options": {
|
||||
"parser": "json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "*.base",
|
||||
"options": {
|
||||
"parser": "yaml"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
# @jackyzha0/quartz
|
||||
|
||||
## 5.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 55311cb: Links: `disableBrokenWikilinks` is on by default. Internal links to pages that don't exist get the `broken` class, as Obsidian marks unresolved links (`is-unresolved`), so Quartz's and Obsidian themes' unresolved-link styles apply. Tag and folder pages, which are generated later, count as existing. Set `links.disableBrokenWikilinks: false` for the old behaviour.
|
||||
- 857de3b: Quartz now requires Node.js 22.22 or later (was 22), for chokidar 6, which watches content in `--serve` mode. chokidar 6 confirms each change against the file system before rebuilding and fixes missed and duplicate change events.
|
||||
- df11e31: Experimental `extends` in `quartz.config.yaml`: `extends: default` (or a path) starts from `quartz.config.default.yaml` and applies only the changes in your file. `configuration` and `layout` merge key by key, plugin entries merge with the default entry of the same plugin. Configs without `extends` behave exactly as before.
|
||||
- 09a6b03: `contentIndex.json` entries have `dateFromFrontmatter: true` when their `date` is the one set in the page's frontmatter for the configured date type (not from git or the file system), so client-side components can tell explicit dates apart, e.g. for folder dates in the explorer.
|
||||
- d5dad62: `contentIndex.json` entries now include the page's `date` (the one `defaultDateType` selects) as an ISO 8601 string, so client-side components such as the explorer can sort by date. Pages without a date have no `date` field.
|
||||
- 2209ee6: Layout conditions: add `is-index` (only on the home page) and `is-folder-index` (only on folder index pages), and let `not-<condition>` negate any condition, built-in or registered (`not-has-tags`, `not-has-backlinks`, …).
|
||||
- c770681: Transclusions use Obsidian's embed markup: a `div.markdown-embed-title` (the note's title, for a whole-note embed; it was an `h1`), then the content in `div.markdown-embed-content > div.markdown-preview-view.markdown-rendered`, then the link to the original. Obsidian themes' embed styles apply (embed titles, padding, maximum height). The title looks as before without a theme. Obsidian's icon link to the note (`a.markdown-embed-link`, Lucide's maximize-2) follows; Quartz hides it, and Obsidian themes, through @quartz-themes/core, show it in the embed's corner.
|
||||
- c229350: Plugin entries can declare `before:` / `after:` (plugin names). They are checked against `order`: between plugins with the same order they decide, and a contradiction, a cycle or an unknown name stops the build with a clear error. `extends:` also accepts an `https://` URL, fetched with a timeout and cached in `.quartz-cache/extends/` for offline builds (`QUARTZ_EXTENDS_OFFLINE=1`).
|
||||
- b25eba0: New opt-in `configuration.slugs.stripDiacritics`: strips accents and other diacritics from generated slugs (`české/čeština.md` → `/ceske/cestina`). Links, embeds, aliases, permalinks, tags and folder pages resolve to the stripped addresses; heading anchors keep their diacritics. Turning it on changes the URLs of existing pages; their old addresses redirect to the new ones. Only Latin letters change: they lose their accents and fold to ASCII (`ł` → `l`, `ø` → `o`, `ß` → `ss`, `æ` → `ae`); other scripts (Korean, Japanese, Chinese, Greek, Cyrillic, Indic, Hebrew, Arabic, …) are left as written. Plugins that make slugs follow the option when they bundle `@quartz-community/utils` 1.3 or later, as the plugins updated in this release do (1.3.1 for the ASCII folding).
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- f7b41e7: Block anchors are `#^id`, as in Obsidian: `@quartz-community/utils` 1.3.2 and `@quartz-community/rehype-obsidian` 1.6.0, bundled by obsidian-flavored-markdown 2.5.3, github-flavored-markdown 2.2.2, canvas-page 1.1.4, note-properties 1.2.3 and bases-page 1.5.5, give blocks `id="^id"` and link to them as `#^id`. A block and a heading with the same name (`^para-1`, `## Para 1`) no longer share an id, so `[[#^para-1]]` and `[[#Para 1]]` each reach their own target. canvas-page also scopes the ids of text nodes rendered with `textNodeMarkdown: basic`.
|
||||
- 3df0062: Block anchors are `#^id`: with @quartz-community/utils 1.3.2 and rehype-obsidian 1.6.0, blocks get the id `^id` and links to them `#^id` (was `#id`), as in Obsidian, so block `^para-1` and heading `## Para 1` no longer share an id. A block transclusion finds its block whatever the case of its `^id` (`![[note#^Para-1]]`), and the popover scrolls to a block it links to.
|
||||
- 2b061ab: Links: links to files Quartz emits, such as `[feed](/index.xml)`, `/sitemap.xml`, `/static/icon.png` or `/404.html`, are no longer marked `broken`. A link is only marked when its target is known to be missing: a page that doesn't exist, or a vault file (image, audio, video, PDF, canvas, base) the content doesn't have. Other files may come from an emitter, so they are left unmarked.
|
||||
- 734e1b8: Links to pages removed by a filter (drafts, ExplicitPublish) are now marked `broken` (with `data-filtered="<filter>"`), like links to pages that don't exist — they 404 on the site.
|
||||
- 9de19e3: `extends` (experimental): `npx quartz plugin list`, `status`, `doctor`, `install`, `prune` and `npx quartz info` read the merged configuration, as the build does. Before, they saw only the entries in your own file, so `list` showed a handful of plugins and `doctor` warned that overlay entries without `enabled` are disabled. `enable`, `disable` and `config` now work on plugins from a base by adding or changing your own entry for them (only that change is written; the merged configuration never is), `config --unset` resets an option a base sets with `null`, and `remove` refuses a plugin that comes from a base. `npx quartz build --serve` also rebuilds when a local base file changes.
|
||||
- a51b7df: `extends` (experimental): presets in a list now stack. With `extends: [./a.yaml, ./b.yaml]`, where both extend `default`, everything `a.yaml` changed was lost, because `b.yaml` was merged on top with all of `default` again. Each file of the `extends` chain is now applied once, after the bases it extends, so the order is `default` → `a.yaml` → `b.yaml` → your file, and later entries win only where they change the same thing.
|
||||
|
||||
Also: a plugin source with a `subdir` and no `name` is matched by repository and folder, so an entry for one plugin of a monorepo no longer changes another; `extends: []` extends nothing; an empty base file is an empty config; `HTTPS://` URLs are accepted; and `plugins:` that isn't a list gets a clear error.
|
||||
|
||||
- b2241c3: Layout conditions: `is-folder-index` is false on tag pages. The all-tags page (`tags/index`) matched it, so components meant for folder pages showed there; nothing under `tags/` counts as a folder index now.
|
||||
- cc253be: Footnote references and back-links keep the `internal` class but no longer get `internal-link`: Obsidian doesn't treat them as note links, and Obsidian themes' link styles (underline, colour) overrode their footnote styles.
|
||||
- 71454c7: Markdown links in frontmatter with an angle-bracket destination, which Obsidian writes for paths with spaces (`[Exec Briefing](<./Exec Briefing.md>)`), resolve to the note instead of a missing `….md` page, so the note gets the backlink and graph edge.
|
||||
- 8be4d8e: Markdown links in frontmatter are read as CommonMark reads them: angle-bracket destinations with parentheses (`[b](<Note (2024).md>)`), balanced parentheses in plain destinations (`[d](Note_(2024).md)`), titles in `"…"`, `'…'` or `(…)` (`[c](<My Note.md> "t")`), and backslash escapes. They pointed at `note-(2024` and `my-note.md-t`, so the linked note got no backlink or graph edge.
|
||||
- c33b6cf: @quartz-community/graph 1.0.5: the graph scales to large sites. On 3,000 notes and 33,000 links, the global graph opens in 0.5 s instead of 2.5 s, and it stops using the CPU once its layout settles. It also loads d3 and PixiJS as pinned, integrity-checked versions, with PixiJS's minified build (200 KB instead of 2.5 MB on every page).
|
||||
- 6ce31a4: - `@quartz-community/graph` 1.0.7: the local graph on folder index pages shows the folder's connections instead of a single node.
|
||||
- `@quartz-community/utils` 1.2.1: `unescapeHTML` decodes each entity once, so a page description that mentions `<br>` keeps it in the page's meta tags instead of turning it into `<br>`.
|
||||
- 9d6cdba: Pages get a canonical link (`<link rel="canonical">`, the page's URL as the sitemap lists it), and `og:url` uses the same URL: `folder/` instead of `folder/index`, and the site root for the home page. `og:site_name` is a `property` (it was a `name`, which Open Graph readers ignore). Notes are `og:type: article`, with `article:modified_time` and, when the frontmatter has a date, `article:published_time`. The home page and folder and tag pages stay `website`.
|
||||
|
||||
The `fonts.gstatic.com` preconnect is a CORS connection, which the font files can reuse, and the unused `cdnjs.cloudflare.com` preconnect is gone.
|
||||
|
||||
- c79adab: Each component's CSS is parsed on its own before the component stylesheet is put together, so a missing `}` or an unclosed comment in one plugin's CSS no longer swallows the rules of every component after it, and a stray `}` no longer fails the build; a syntax error is reported with the component's name.
|
||||
- 3b78d16: Frontmatter is read with js-yaml 5, using YAML 1.2's core schema (the values Quartz read before are unchanged). Frontmatter with only comments now has no properties, as in Obsidian, instead of being reported as invalid frontmatter.
|
||||
- a55f25f: The page frames mark their regions for assistive technology: the centre column is a `<main>` (it was a `div.center`; the classes are unchanged) and the default frame's sidebars are `<aside>` elements. Screen readers can jump to the page's content, and the page looks the same.
|
||||
- 7714325: Heading transclusions and their footnotes look through Obsidian's per-block wrappers (`div.el-h2 > h2`), which `@quartz-community/rehype-obsidian` now renders around each of a note's top-level blocks. `blockOf()` (in `components/transcludeScope.ts`) returns the block inside a wrapper, for other code that walks a page's top-level blocks.
|
||||
- b4d7358: Obsidian's fold arrows in headings and list items (`.heading-collapse-indicator`, `.list-collapse-indicator`, rendered by rehype-obsidian for Obsidian themes) are hidden unless obsidian-flavored-markdown's `foldHeadings` / `foldLists` turn folding on.
|
||||
- 0bab8ea: @quartz-community/obsidian-flavored-markdown 2.4.0 (Obsidian's block wrappers, heading and list folding, missing-attachment embeds, Pele diagrams) and @quartz-community/og-image 1.1.2 (no build failure on emoji variants such as the footnote back-link `↩︎`).
|
||||
- db7484e: @quartz-themes/core 3.2.0 (Obsidian's block wrappers styled natively, property inputs, fold arrows) and the plugin releases that carry Obsidian's markup:
|
||||
|
||||
- latex 1.1.0: maths in Obsidian's math elements;
|
||||
- note-properties 1.2.0: Obsidian's properties markup;
|
||||
- search 1.1.0: the quick switcher's classes, excerpts as written;
|
||||
- explorer 1.1.2: Obsidian's folder rows;
|
||||
- table-of-contents 1.0.4: the collapsed table of contents no longer clips its header;
|
||||
- graph 1.0.4: colours follow Obsidian themes;
|
||||
- syntax-highlighting 1.0.4: the copy button's stylesheet in the base layer;
|
||||
- canvas-page 1.0.4: heading embeds look through the block wrappers.
|
||||
|
||||
- fd744c0: The `obsidian` template folds headings and lists (obsidian-flavored-markdown's `foldHeadings` and `foldLists`), as Obsidian does by default.
|
||||
- 7b4da1c: A note whose name ends in "index" (`reindex.md`) is an `og:type: article` again. The home page and folder index pages were told apart by the slug ending in `index`, not by its last segment, so such notes were `website` and had no article dates.
|
||||
- bc0e393: Plugin order: `before:` / `after:` naming a plugin that is built into Quartz now (`crawl-links`, `remove-draft`, `content-index`) passed validation but was ignored. They now mean the built-in that replaced them (`links`, `drafts`, `contentIndex`), so `before: crawl-links` orders the plugin before link processing, and is checked against its `order` like `before: links`.
|
||||
- 52af9f1: `PageList` entries are `h2` headings under the page's `h1` (they were `h3`, which skipped a level for screen readers), at the `h3`'s size, as in `@quartz-community/folder-page` and `@quartz-community/tag-page`.
|
||||
- f646ffe: Plugin fixes from the pre-release audit:
|
||||
|
||||
- `@quartz-community/latex` 1.1.2: KaTeX's stylesheet applies on pages whose maths comes from a transclusion or a popover, and after SPA navigation (it stayed print-only).
|
||||
- `@quartz-community/obsidian-flavored-markdown` 2.5.2: bundles rehype-obsidian 1.5.1 and remark-obsidian 2.2.4, so same-page block links (`[[#^id]]`) work, only real YouTube hosts become embeds, large notes use less memory, and under `preset: strict` other plugins' text rewrites survive in notes with callouts; `math: false` works under `strict` with the LaTeX plugin; Markdown-link embeds with a query or in reference style are transcluded.
|
||||
- `@quartz-community/github-flavored-markdown` 2.2.1: `replacements` leaves autolink text alone, applies to wikilink aliases, and honours backslash escapes; `data-heading` keeps the heading as written.
|
||||
- `@quartz-community/canvas-page` 1.1.2 and `@quartz-community/tag-page` 1.0.7: file nodes find headings as Obsidian writes them (`#Sub Section`), embeds in text nodes are filled in, text-node tags get tag pages, and ids are unique per node; the tag index lists pages as `h3` under each tag.
|
||||
- `@quartz-community/search` 1.1.2: Enter on a result navigates without a full reload, `#tags` match with `slugs.stripDiacritics`, and searches ignore accents (`creme` finds "Crème").
|
||||
- `@quartz-community/explorer` 1.2.2: keeps the current page open after a `render` event without details (encrypted pages), and each explorer's phone button is named after its title.
|
||||
- `@quartz-community/bases-page` 1.5.4: view tabs follow the WAI-ARIA tabs pattern (arrow keys, unique ids).
|
||||
- `@quartz-community/graph` 1.0.8: no animation loop while the graph is idle, closed or removed.
|
||||
- `@quartz-community/created-modified-date` 1.0.5: stand-in dates are marked, so they stay out of `contentIndex.json`, and git dates work for a symlinked vault in a content folder outside git.
|
||||
- `@quartz-community/og-image` 1.1.3, `@quartz-community/ox-hugo` 1.0.3, `@quartz-community/breadcrumbs` 1.0.5, `@quartz-community/folder-page` 1.1.3, `@quartz-community/note-properties` 1.2.2: descriptions decoded once and keycap/flag emoji in social images; captioned figures and indented code in ox-hugo; utils 1.3.1 (Latin-only `stripDiacritics`).
|
||||
|
||||
- 8c61245: Plugin updates:
|
||||
|
||||
- `@quartz-community/explorer` 1.2.0: `sort` option (rules applied in sequence, e.g. folders first, then newest) and `rootFolder` option, so several explorers on one page work side by side; the `order` option is applied; scroll fixes (the bottom fade, the scroll position across SPA navigation with `layout.sidebars.left: scroll`, and opening a page no longer scrolls the page itself).
|
||||
- `@quartz-community/obsidian-flavored-markdown` 2.5.0: notes, canvases and bases embedded with a Markdown link (``) are transcluded, as in Obsidian; `math` option (`false` leaves dollar signs as text). With `@quartz-community/rehype-obsidian` 1.5.1: same-page block links (`[[#^id]]`) reach their block, and only images on YouTube become YouTube embeds.
|
||||
- `@quartz-community/github-flavored-markdown` 2.2.0: `singleTilde` option (`false` strikes only `~~text~~`, as Obsidian does) and `replacements` option (for example Quartz 4's arrows), empty by default.
|
||||
- `@quartz-community/canvas-page` 1.1.0: the mouse wheel and trackpad pan the canvas, as in Obsidian (`wheelBehavior`); text nodes are rendered with the site's Markdown plugins, so Mermaid diagrams, callouts and math work in them (`textNodeMarkdown`).
|
||||
- `@quartz-community/utils` 1.3.0: the `stripDiacritics` slug option reaches plugins too; links in embedded folder notes point at the right directory.
|
||||
- `@quartz-community/created-modified-date` 1.0.4: git dates resolve when `content/` is a symlink to a vault in another git repository.
|
||||
- `@quartz-community/ox-hugo` 1.0.2: the Markdown rewrites leave code alone and no longer match across unrelated text.
|
||||
|
||||
- 96fc9c1: Plugin updates for accessibility and page speed:
|
||||
|
||||
- Text in the table of contents, footer, folder and tag listings, search button and Bases group headings meets WCAG AA contrast in light and dark mode. Under an Obsidian theme from quartz-themes (`@quartz-themes/core` 3.2.1), the search button and Bases group headings keep the theme's faint text colour.
|
||||
- Page listings in folder and tag pages use `<h2>` titles (at the previous size), so headings no longer skip a level.
|
||||
- Valid ARIA and unique ids in the table of contents, explorer, backlinks, heading anchors and Bases views.
|
||||
- The graph loads d3 and PixiJS only when it scrolls into view (or when the global graph opens), instead of on every page.
|
||||
- KaTeX's stylesheet no longer blocks rendering on pages without math.
|
||||
- `@quartz-community/remark-obsidian` 2.2.3: the `legacy` parser no longer uses memory that grows with the square of the note's length on notes with many tables, lists or other blocks.
|
||||
|
||||
- 661b56a: Release tags are verified on GitHub: the release workflow creates each `vX.Y.Z` tag as a lightweight tag on the merged release commit (which GitHub signs) instead of letting the release create an unsigned annotated tag. It also starts the Docker build for the tag, so versioned images (`5.3.0`, `5.3`) are published for each release (none were built for 5.1.0–5.2.2).
|
||||
- 799b8e3: Component styles are one stylesheet (`component-<hash>.css`, in the `quartz-base` layer as before) instead of one per component. Pages load about 20 fewer render-blocking stylesheets (29 to 11 on the docs site), and the styles they compute are unchanged.
|
||||
- e0f1e03: A scroll made just before Back (less than 150 ms) is no longer lost: Forward returns to where the reader scrolled.
|
||||
- 3ab4503: With SPA navigation, Back and Forward return to where the reader was on each page. The router keeps each history entry's scroll position and restores it after swapping the page in. The browser restored the position while the previous page was still on screen, so it came out wrong: Back after a table-of-contents link stayed at the heading, and Back to a page landed at its top or bottom. Back and Forward between headings of the same page now only scroll, instead of reloading the page, and a reload keeps the position.
|
||||
- 0d05ef7: Build-time stand-in dates are no longer written as real dates. A page whose date no source gives (for example `defaultDateType: published` and no `published:`, or an invalid one) gets the build time from the date plugin; `contentIndex.json` now leaves its `date` out, and `article:published_time` / `article:modified_time` are only set for real dates (an invalid `published:` gave the build time). RSS and the sitemap keep the build time. created-modified-date 1.0.5 lists its stand-ins in `file.data.fallbackDates`; with older versions a `published` date only counts when the frontmatter sets it.
|
||||
- dd667ee: `slugs.stripDiacritics` reaches plugins and the browser: bases-page 1.5.3, breadcrumbs 1.0.4, canvas-page 1.1.1, explorer 1.2.1, folder-page 1.1.2, note-properties 1.2.1 and obsidian-flavored-markdown 2.5.1 bundle `@quartz-community/utils` 1.3, so their links, tag pages from inline tags, canvas file nodes and base views use the stripped addresses. Quartz also passes the option to scripts in the browser, so the explorer places folders and pages with accents where the build put them.
|
||||
- 093d233: The templates' colours meet WCAG AA contrast (4.5:1) on their backgrounds. Light `gray` goes from #b8b8b8 to #727272 (was 1.9:1), dark `gray` from #646464 to #7f7f7f (was 3.1:1), and light `tertiary`, the link hover colour, from #84a59d to #587971 (was 2.5:1). Text selection mixes 40% of `tertiary` instead of 60%, so text stays readable on it in both modes. Existing sites keep the colours in their own `quartz.config.yaml`.
|
||||
- 7c3df89: Type checking (`npm run check`) uses TypeScript 7. `tsconfig.json` switches `moduleResolution` from `node` (removed in TypeScript 7) to `bundler`, which reads packages' `exports`: custom code that imports a package's internal files may need to import from the package itself.
|
||||
- af36801: Links to a folder or tag page that isn't generated (a folder whose notes are all drafts or that holds only images, a tag no published page uses) are marked broken, and in watch mode a page whose links to a page that was published or filtered out change is re-emitted, so its marks don't go stale.
|
||||
|
||||
## 5.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ee1cdff: Updates `@quartz-themes/core` to 3.1.1: the Obsidian template (`theme: default`) works again (since 3.0 the plugin failed to initialise looking "default" up as a community theme); `default`, `obsidian` and `Obsidian default` use Obsidian's built-in theme.
|
||||
|
||||
## 5.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3f8104f: Fonts: explicitly configured `body`, `code` and `interface` fonts now apply with an Obsidian theme. They are also written to Obsidian's `--font-*-override` variables on `body`, which the theme's styles read; before, the theme's own `body` font variables won over Quartz's `:root` ones.
|
||||
- c392e17: Fonts: the `interface` font and per-heading fonts (`h1` … `h6`) are now loaded from Google Fonts (or self-hosted with `fontOrigin: selfHosted`) like the other fonts; before, they only rendered if installed locally. A font with a single weight now loads that weight (`weights: [700]` loaded 400), and a single-weight italic font no longer makes the Google Fonts request fail.
|
||||
- 7531e67: On phones and tablets, one too-wide item in the header row (a long page title, or an Obsidian theme's styled header) no longer widens the page past the screen. The content column is `minmax(0, 1fr)` instead of `auto` (also in the full-width and minimal frames), and text in the phone header row may break anywhere.
|
||||
- 95e96b4: Updates `@quartz-themes/core` to 3.1, which converts any Obsidian community theme at build time: name a theme as Obsidian lists it (`Minimal`, `AnuPpuccin`), a GitHub repository, a URL or a local `theme.css`; Style Settings exports and CSS snippets apply as in Obsidian. Theme ids from 2.x (`tokyo-night`) keep working; `aspects`, `include`, `calloutStyle` and `fonts` were removed, and the `@quartz-themes/<theme>` packages are no longer needed. Quartz keeps its own page layout under a theme, `themeFonts: false` uses the site's Quartz fonts, and a theme's embedded fonts ship as separate files. See [ThemesCore](https://quartz.jzhao.xyz/plugins/ThemesCore).
|
||||
|
||||
## 5.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 4ed26b3: `quartz build --config <path>` (or `-C`) reads the site configuration from another file than `./quartz.config.yaml`, so the config can live with the content outside the Quartz folder, and one Quartz install can build several content repositories (#2646). With `--watch`/`--serve`, changes to that file trigger a rebuild.
|
||||
- 607ccb8: Theme support for Obsidian themes: plugin factories may be async (Quartz awaits them); font loading is built in as `configuration.fonts` (formerly the `@quartz-community/quartz-fonts` plugin, whose config entry is applied automatically); callouts and transclusions render as `<div>` like in Obsidian; popovers carry Obsidian's `hover-popover`/`markdown-embed` classes.
|
||||
- 9705969: Transformers can declare `renderTransforms`: transforms of a page's content when it is rendered, `before` transclusions are inlined and page types' `treeTransforms` run (bases are filled in), and `after` them, on the finished content. encrypted-pages uses them to encrypt a note's finished content, so bases and transclusions in encrypted notes show when unlocked (quartz-community/encrypted-pages#2).
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ed4f653: Bases (bases-page 1.4.0) render closer to Obsidian:
|
||||
|
||||
- custom summaries are evaluated, and summaries show their name and appear per group;
|
||||
- `html()`, `image()`, `icon()`, regular expressions and `file.backlinks` work in formulas;
|
||||
- `kanban` views, `groupOrder`, grouped list and cards views, and the list and row height options work.
|
||||
|
||||
- 99685cf: Bases inside a transcluded note render that note's own base, and links in bases follow `configuration.links` (external-link icon, new tab, lazy images, popovers) (bases-page 1.5.1).
|
||||
- 9a04652: Bases columns are labelled with the property's name, as in Obsidian (`priority`, `file name`), instead of title-cased (`Priority`, `Name`); bases-page's new `propertyLabels: title` option keeps the title-cased labels (bases-page 1.5.0).
|
||||
- 9c46b01: Updates `@quartz-community/obsidian-flavored-markdown` to 2.3.1, which renders callout titles in `.callout-title-inner` without a `<p>`, as in Obsidian (themes put the title below its icon otherwise). Callout titles are styled on `.callout-title-inner` itself (colour, margin, line height); the `> p` rule stays for sites on an older obsidian-flavored-markdown.
|
||||
- cdc5a02: Updates dependencies with minor and patch releases: `@clack/prompts` 1.9.0, `@napi-rs/simple-git` 1.2.0, `isomorphic-git` 1.44.18, `minimatch` 11.0.9, `preact-render-to-string` 6.8.3 and `prettier` 3.10.1.
|
||||
- 8578f2f: Permalinks work on large sites: sites of 192 or more files are parsed in worker threads, which didn't receive the permalinks, so a note with a `permalink` was published at its file path (#2644). A permalink with `.` or `..` segments is ignored with a warning instead of writing pages outside the output folder (#2641). With `prettyLinks`, a wikilink to a note whose name has a space or a non-ASCII letter reads as the note's name without its folder, as other links do (#2643).
|
||||
- 166d09b: `quartz plugin install` moves a plugin to its pinned commit even when the plugin's build left tracked files changed (its `package-lock.json`). In CI, a plugin cache restored through `restore-keys` kept those changes, and installing an updated plugin failed with "Please commit your changes or stash them" (#2639).
|
||||
- 6f872d4: Updates `@quartz-community/alias-redirects` to 1.0.4 (aliases that point outside the site are skipped, #2641) and `@quartz-community/note-properties` to 1.1.5 (links in properties to missing pages get the `broken` class with `disableBrokenWikilinks`, #2635).
|
||||
- 0ab525c: Updated plugins that rely on Quartz 5.1 and now declare it (`quartzVersion: ">=5.1.0"`): encrypted-pages 1.2.0, explicit-publish 1.2.0, unlisted-pages 1.2.0, obsidian-flavored-markdown 2.2.0, folder-page 1.1.0 and bases-page 1.3.0.
|
||||
- 49d0563: Transcluded content no longer duplicates ids. Headings and footnotes inside a transclusion get ids unique on the page, and the links inside it go to them, so the host's footnotes and a `[[#Heading]]` link inside a transclusion jump to the right place. A same-page link whose target isn't in the transcluded section links to the transcluded page. A heading transclusion (`![[note#Heading]]`) holds only the footnotes it references instead of the page's whole footnotes section.
|
||||
|
||||
## 5.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- eab5c53: A page type's `generate` can be async: it may return a promise of its virtual pages, which Quartz awaits in full and incremental builds. Page types that create pages from other files (like `.mdx`) can now run content through the site's transformers or bundle with esbuild; previously a promise crashed the build with "virtualPages is not iterable" (#2575).
|
||||
- f768b1e: Clearer failures: errors thrown by a plugin now name the plugin (package, version, source), what it was doing (transforming, filtering, emitting, rendering a component) and the file or page, list problems Quartz already knew about that plugin (incompatible Quartz version, missing required data), and say how to check and where to report it. Plugin stack frames are no longer hidden. Warnings from loading the config are repeated in a summary at the end of the build, together with a note about links to pages that are not on the site (including links to drafts).
|
||||
- f768b1e: Frontmatter parsing, link resolution, draft handling and the content index are now built into Quartz (configured under `configuration.frontmatter`, `.links`, `.drafts` and `.contentIndex`) instead of being plugins that silently broke the site when disabled. Existing `crawl-links`, `remove-draft` and `content-index` entries keep working and are applied automatically; `npx quartz plugin doctor --fix` moves them into `configuration`. Plugins can add fields to `contentIndex.json` with an `extendContentIndex` hook, and emitters can reuse the built index via `ctx.contentIndex`. The effective built-in settings are available to plugins as `ctx.cfg.configuration.<key>`.
|
||||
- e4ebd28: Markdown renders as it does in Obsidian: Quartz now uses ObsidianFlavoredMarkdown 2.0 and GitHubFlavoredMarkdown 2.0.
|
||||
|
||||
- **Line breaks changed:** a single line break inside a paragraph now renders as `<br>`, as in Obsidian's default reading view. Set `strictLineBreaks: true` in the ObsidianFlavoredMarkdown options to keep the previous behaviour (a space).
|
||||
- ObsidianFlavoredMarkdown parses with Obsidian's own parser by default (`preset: "legacy"`). Use `preset: "strict"` for TOML (`+++`) frontmatter or plugins that add their own Markdown syntax.
|
||||
- Also new: callouts parsed like Obsidian, inline footnotes (`text^[note]`), image sizes on Markdown images (``), Mermaid diagrams that follow the theme's colours, an opt-in Pele diagram renderer, and inline tags that only link to tag pages that exist.
|
||||
- GitHubFlavoredMarkdown now runs before ObsidianFlavoredMarkdown (order 30, then 40), as in the default config. If your config sets `order` for either plugin, keep GitHubFlavoredMarkdown first.
|
||||
|
||||
See the plugins' changelogs for details.
|
||||
|
||||
- 15b8eef: Permalinks work as in Obsidian Publish (jackyzha0/quartz#2572): `permalink: page` makes the note's address `/page`, whatever its file path. Links to the note, backlinks, the graph, the sitemap, RSS and the content index use the permalink, links inside the note still resolve relative to its file, and the note's file path redirects to the permalink (with AliasRedirects, like `aliases`). Previously the permalink was only a redirect to the file path. A permalink that is already another page's address is ignored with a warning. In navigation (the content trie used by the explorer, folder pages and breadcrumbs) the note stays in its folder, as on Obsidian Publish sites.
|
||||
- c84f348: Plugins can ship files with the site: `externalResources()` may return `assets: [{ from, to }]` (a file or directory on disk), which Quartz copies to `static/plugins/<to>`. Client scripts find them through the new `window.quartzStaticUrl` page global (absolute URL of `static/`, valid across SPA navigations). Use it for large or optional client code loaded with `import()` only where needed, instead of inline scripts, which every page downloads. Invalid or conflicting targets and missing sources are build warnings.
|
||||
- f768b1e: Plugins can declare what they provide and need (`quartz.capabilities`); the build warns when a required provider is missing (e.g. "backlinks requires data `links` … enable configuration.links"). Rendered plugin components carry `data-quartz-plugin` / `data-quartz-component` attributes, so you can tell which plugin rendered which part of a page. `fetchData` resolves to `{}` instead of rejecting when `contentIndex.json` is missing.
|
||||
- f768b1e: Plugin management: plugin commands exit non-zero on failure, CLI edits keep comments in `quartz.config.yaml`, lockfile pins are honoured everywhere, npm plugins show up in `plugin list`, `plugin add` detects duplicates, misspelled plugin options are flagged, and the new `plugin doctor` checks config, lockfile and installs. `plugin config --set a.b=1` now writes a nested key.
|
||||
- 3c18be8: Plugins can be marked deprecated with `quartz.deprecated` (a message naming the replacement) in their `package.json`. Quartz warns while a deprecated plugin is enabled — when the build loads the config (repeated in the end-of-build summary), in `plugin add` and in `plugin doctor` — and suggests removing it. The deprecated `hard-line-breaks` plugin is no longer listed in the default config and templates: ObsidianFlavoredMarkdown 2.0+ handles line breaks (`strictLineBreaks`).
|
||||
- 50203da: Plugins that fail to load (can't be installed, throw on import, export no plugin) are reported as errors with the plugin, version, the file and line where it failed and what to do, and listed again at the top of the end-of-build summary. Previously some of these failures were silent. Locally the build continues without them; in CI (`CI` set) it fails unless `QUARTZ_ALLOW_BROKEN_PLUGINS=1`. Fixed along the way: the entry module of npm-installed component plugins (and npm plugins without a declared category) was never imported, so their `init(options)` never ran.
|
||||
- 01bc5c5: Updated default plugins (see each plugin's changelog for details):
|
||||
|
||||
- **Changed heading ids:** with SmartyPants on (the default), a heading containing `--` now gets the same id as on GitHub: `## Range 1--2` → `range-1--2` (was `range-12`). Links that hard-code the old id need updating; `[[page#Range 1--2]]` keeps working. Links Obsidian writes to headings containing `:`, `|`, `^`, `#` or `\` now reach them, and heading ids, links and table-of-contents entries share one slug function (GitHubFlavoredMarkdown 2.1.0, TableOfContents, CrawlLinks, utils 1.1).
|
||||
- **Bases now behave as in Obsidian 1.15** (BasesPage 1.2.0, checked against real Obsidian): subtracting dates gives a duration (`(due - today()).days`); nested tags match (`file.tags.contains("#project")` finds `#project/x`); dates display in the site's locale, and `date()` reads only ISO-style dates; cards use Obsidian's aspect ratio and layout; `link()` with any URL is an external link; a base opens on its first view; tags link to their tag pages; `this.<property>` in an embedded base reads the embedding note. Base views also list canvas and Excalidraw files with their real paths, `this` in an embedded base is that note, and Quartz's generated pages (404, tags, folder listings) no longer appear as notes. **Changed:** `file.tags` keeps `#` and the original case, the `tags` property no longer includes inline tags, `hasTag(a, b)` matches any of its tags, the root folder is `/`, text `contains` ignores case, and the cards' `imageAspectRatio` is height/width (it was inverted). `file.name` is as in Obsidian: a Markdown note's name has no extension (`Note`), other files keep theirs (`Plan.canvas`); `file.fullname` has the extension for every file.
|
||||
- Folder pages list folders that hold only canvas, base or other generated pages (FolderPage).
|
||||
- A footnote referenced only from a table cell past the table's columns is rendered, as in Obsidian (ObsidianFlavoredMarkdown 2.1.1, with remark-obsidian 2.2.0: faster parsing and fixes for deeply nested notes and `\r\n` line endings).
|
||||
- A short wikilink to an Obsidian folder note (`[[Topic]]` for `Topic/Topic.md`) reaches the folder page (utils 1.1).
|
||||
- NoteProperties no longer bundles gray-matter's `eval`-based JavaScript frontmatter engine.
|
||||
|
||||
- f768b1e: Plugin version requirements are enforced: a plugin's `quartzVersion` (`package.json` → `quartz.quartzVersion`, any semver range) is checked when the config loads (a warning locally; in CI — `CI` set — the build fails unless `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1`), by `plugin add` and by `plugin doctor`, with a message saying whether to update Quartz or the plugin. Previously the field was never checked (and the old checker read `">=5.0.0"` as `0.0.0`).
|
||||
- 6210f28: Prefetching: Quartz fetches pages before their links are followed, so they open at once. New `configuration.prefetch`:
|
||||
|
||||
- `viewport` (default): links on screen are fetched while the browser is idle, and links pointed at, focused or touched first.
|
||||
- `hover`: only links pointed at, focused or touched.
|
||||
- `"off"`.
|
||||
|
||||
It works with and without SPA routing. With SPA routing, fetched pages are kept in memory (five minutes, at most 40) and used by both page navigation and popover previews, which no longer download a page the router fetches again. Without it, Quartz asks the browser to prefetch (Speculation Rules, or `<link rel="prefetch">`). Nothing is prefetched from links to other sites, files, or pages the site doesn't have, or with Data Saver on or a 2G connection (except links pointed at). Add `data-no-prefetch` to a link to exclude it. See https://quartz.jzhao.xyz/features/prefetching
|
||||
|
||||
- 3103485: New `configuration.publishAssets: "referenced"` (default `"all"`): only copy the images, PDFs and other files that published pages link to or embed, so files that only unpublished notes use stay private (#2531, from #2544). References are matched against published (slugified) file names and include `<object data>` SVG embeds, `srcset` and URL-encoded paths.
|
||||
- f768b1e: New `npx quartz info` command: prints the Quartz version (with `git describe`, branch and local changes), Node/npm/OS, the config file, built-ins and every plugin with its version, source and compatibility, as a Markdown block to paste into bug reports. The build banner and `plugin doctor` also show where the checkout is relative to the last release.
|
||||
- 08c2857: New `layout.sidebars` option: how each sidebar handles content taller than the screen. `fit` (default, unchanged) keeps it one screen tall and components shrink and scroll themselves; `scroll` keeps it in view and lets it scroll itself, so nothing is ever out of reach; `static` lets it scroll away with the page. Page types can override it (`byPageType.<type>.sidebars`). New `docs` template for documentation sites (`npx quartz create --template docs`), with both sidebars `static`. Frames receive the modes as a `sidebars` prop and put them on sidebar elements as `data-sidebar-mode`, which plugins can target in CSS.
|
||||
- d66968c: `npx quartz upgrade` shows the release notes of every version between the old and the new Quartz, then runs the new version's checks: it restores plugins, runs `plugin doctor` (plugin entries that are built in now, plugins that don't support the new version …) and lists plugin updates. Plugin install/restore skip plugins that are built into Quartz now, and `plugin doctor --fix` also removes their unused lockfile pins.
|
||||
- fe6a3ea: Pages that page types render from files (`.base`, `.canvas`, Excalidraw drawings) follow the site's publish filters (quartz-community/bases-page#11). The filters see each such page with the frontmatter its page type gives it and `file.data.referencedBy`, the published pages that link to it; a page a filter rejects is not emitted and not listed in the content index, sitemap, RSS, folder pages, explorer or search, and can't be embedded. Before, every such file was published regardless of the filters. New transformer hook `virtualPageHtmlPlugins(ctx, content)`: rehype plugins run on these pages' rendered bodies, which never pass through `htmlPlugins`, so plugins such as encrypted-pages can encrypt them.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ac8cc4b: A plugin that lists a plugin now built into Quartz in `quartz.dependencies` (`@quartz-community/crawl-links`, `remove-draft` or `content-index`) no longer fails the build with "requires crawl-links. Run: npx quartz plugin add …". The built-in (`configuration.links`, `drafts`, `contentIndex`) satisfies the dependency. A warning is shown when that built-in is disabled. `npx quartz plugin doctor` checks the same way.
|
||||
- f8b5638: More build errors caused by content are reported as content problems ("fix the file and build again") instead of "This is likely a Quartz bug": frontmatter that holds a single value or a list instead of properties, Markdown files and assets Quartz can't read (permission denied, a directory named like a note). Plugins can do the same by throwing an `Error` with `quartzContent = true` (see "Reporting problems in content" in Making plugins).
|
||||
- e8a192e: Plugins can declare `window.quartzStaticUrl` and `window.quartzPrefetch` in `capabilities.requires.globals` without a false "nothing provides it" warning: Quartz counts both as its own (`quartzPrefetch` unless `prefetch` is off).
|
||||
- 85d2b43: A plugin whose dependency is configured but disabled gets the intended warning ("depends on X which is disabled") instead of failing the build with "requires X. Run: npx quartz plugin add X".
|
||||
- 28fcb64: When a build stops on an error, Quartz stops esbuild before exiting. esbuild runs as a child process that writes to the same terminal; left running, it could print "fatal error: all goroutines are asleep - deadlock!" and a long goroutine dump after Quartz's error message.
|
||||
- 913f9f0: The folder hierarchy used by folder pages and breadcrumbs now includes the pages of page types that render files (`.base`, `.canvas`, …): folder pages list them, and a folder that holds only such pages has its own node (#2576). Documented that while a page type's `generate` runs, `ctx.virtualPages` holds the virtual pages of the page types before it.
|
||||
- 5507de3: French: "Vue graphique" and "Table des matières" use French capitalisation (jackyzha0/quartz#2513).
|
||||
- 2ef60c6: Embedding a section by the anchor Obsidian writes for its heading works when that anchor differs from the heading's id: `![[note#Colon unspaced]]` now embeds `## Colon:unspaced`. It needs GitHubFlavoredMarkdown 2.1.0 or later, which marks those anchors on the heading.
|
||||
- f768b1e: Layout fixes: the `has-backlinks` condition works, `byPageType.exclude` matches npm plugin sources, layout overrides in `quartz.ts` are applied, `position: footer` is accepted by the config schema, and typos in positions, display values, frames or page types produce a "did you mean" warning instead of silently dropping the component. `quartz build --verbose` prints a layout report.
|
||||
- fc86552: Links as in Obsidian 1.15.0:
|
||||
|
||||
- A Markdown link whose path is not valid percent-encoding (`[x](%zz)`, `[x](a%E2.md)`) is an external link. Before, it failed the whole build with `URI malformed`.
|
||||
- Link paths are NFC-normalized, so a link spelled with a decomposed `é` reaches `café.md`.
|
||||
- An image of a file the site doesn't have, with no alt text, gets its percent-decoded path as alt (`` → “missing pic.png”), as Obsidian names a missing embed.
|
||||
- A wikilink's `^id` no longer names its paragraph (Obsidian Flavored Markdown).
|
||||
|
||||
- 671ca49: Security updates: `sharp` 0.35.5 (GHSA-wq5f-xc86-pv6w), `toml` 5 (prototype pollution and DoS advisories; TOML frontmatter parses the same, and now also accepts plain dates like `date = 2024-01-02`) and `minimatch` 11 (GHSA-g3hv-75wg-m249; `ignorePatterns` match the same). The plugin schema's `layout.position` lists exactly the positions Quartz renders. `npx quartz tui` points to the right install command (`github:quartz-community/tui`).
|
||||
- b7998bb: Pages no longer scroll sideways on phones: long words (a page title such as "ObsidianFlavoredMarkdown", long inline code) break where they don't fit, and the right sidebar's components (graph, backlinks) wrap below each other when they don't fit side by side.
|
||||
- b2da325: Security: frontmatter can no longer run code during a build. A note starting with `---js` or `---javascript` had its frontmatter evaluated as JavaScript (gray-matter's default engine), so building content you didn't write, such as a pull request preview, could run arbitrary code. Quartz now refuses JavaScript frontmatter with an error naming the file. Invalid frontmatter (for example broken YAML) is now reported as a problem in that file instead of as a Quartz bug.
|
||||
- e41ebf6: Plugin option checks use the option schemas first-party plugins ship. These are declared as `quartz.optionSchema`, the name Quartz Syncer reads, as a flat map of option to type (`{ limit: { type: "number" }, mode: { type: "enum", values: [...] } }`). Before, only a JSON Schema in `quartz.configSchema` was read, so no first-party plugin's schema was used. A misspelled option, an enum value that isn't allowed, or a value of the wrong type is now a warning. A value of the same type as the plugin's default is always accepted, even where a schema disagrees.
|
||||
- edb64cd: Tag pages honour the TagPage `numPages` and `sort` options (tag-page 1.0.4); before, they always used the defaults. Plugin client scripts can use `window.quartzStaticUrl` and `window.quartzPrefetch` with the declarations in `@quartz-community/types` 1.3.1.
|
||||
- 28581e8: On Windows, regenerating `.quartz/plugins/index.ts` (`npm run install-plugins`, which also runs before every `npm run build`) no longer skips npm plugins with "dist/index.d.ts could not be found", which left exports such as `ExternalPlugin.Explorer` undefined. The package's location was read from a `file:` URL's pathname (`/C:/…`), which is not a Windows path.
|
||||
- ba5a9a6: Option checks know the FolderPage `prefixFolders`, TagPage `prefixTags` and Latex `customMacros` options (folder-page 1.0.4, tag-page 1.0.5, latex 1.0.2 declare them in their manifests).
|
||||
- e44f2b0: `quartz.ts` overrides (`ExternalPlugin.Explorer({...})`) work for npm plugins and for component plugins (#2565): overrides are registered under the key the loader looks up (the package name for npm plugins), and component constructors re-exported from a plugin's sub-module are wrapped too. The wrapper also returns what the plugin returns, so `ExternalPlugin.X(...)` works both as a statement and as a component in a layout override. `quartz plugin …` commands no longer drop npm plugins from the generated `.quartz/plugins/index.ts`; both generators are now one shared module.
|
||||
- 8854aeb: Plugin fixes for Windows: relative aliases (`./old`, `../x`) redirect to the right page (alias-redirects 1.0.3), and git dates of notes in folders are read from git instead of the filesystem (created-modified-date 1.0.3).
|
||||
- f687f58: Plugins use Quartz's own Preact instead of each bundling a copy, so components can use hooks and context across plugins (a component using `preact/hooks` with another plugin's components crashed), and plugin bundles are smaller. The default plugins and the plugin template are updated; a third-party plugin made from the template before this release still bundles its own copy until it updates its `tsup.config.ts` (see quartz-community/plugin-template).
|
||||
- 2a4ab67: The Roam Research plugin works with ObsidianFlavoredMarkdown on, as in the default config (roam 1.1.0). `{{[[TODO]]}}`, `{{[[DONE]]}}`, `[[>]]` and `{{[[video]]: …}}` no longer render as wikilinks, and `__italic__` is italic instead of bold.
|
||||
- 8eae6a1: Security: plugin commands no longer build shell commands from plugin sources, refs, pinned commits or package names (#2571). git and npm run with argument arrays, refs/commits/URLs/package names are validated (so a value can't be read as an option either), and generated plugin imports are written as escaped string literals. A source such as `github:owner/repo#main;cmd` used to run `cmd`; it is now rejected as an invalid ref. Also fixes restoring a plugin pinned in `quartz.lock.json` to a commit that is no longer its branch tip (#2559).
|
||||
- 3e4a50a: SPA navigation follows redirects correctly: when a link is redirected (for example `folder` → `folder/` on static hosts, or an alias page's canonical link), relative links on the new page resolve against where it really is, and the address bar shows that URL. Links on folder pages and parent tag pages reached through slash-less links pointed one level too high.
|
||||
- 7236249: Sites created with `npx quartz create` from a template (default, blog, docs, obsidian, ttrpg) run GitHubFlavoredMarkdown before ObsidianFlavoredMarkdown (orders 30 and 40), as the default config does and 5.1 requires. The templates still had the old orders (40 and 30). The obsidian and ttrpg templates no longer set `parseArrows`, which ObsidianFlavoredMarkdown doesn't have.
|
||||
- f5ef8f7: A local plugin source written with Windows separators (`.\my-plugin`, `..\plugins\my-plugin`) is recognised as a local path. Before, it was read as a git or npm source and failed with "Expected github:owner/repo".
|
||||
|
||||
Pretty links shorten link text the same way on every OS: Windows also cut it at a backslash (`[[a\b]]` showed `b`).
|
||||
+8
-1
@@ -1,8 +1,15 @@
|
||||
FROM node:22-slim AS builder
|
||||
|
||||
# install git to install plugins
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json .
|
||||
COPY package-lock.json* .
|
||||
RUN npm ci
|
||||
COPY .npmrc* .
|
||||
COPY quartz/ ./quartz/
|
||||
COPY quartz.lock.json* .
|
||||
RUN npm install; npx quartz plugin install
|
||||
|
||||
FROM node:22-slim
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Quartz v4
|
||||
# Quartz v5
|
||||
|
||||
> “[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
|
||||
|
||||
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
filters:
|
||||
and:
|
||||
- file.ext == "md"
|
||||
formulas:
|
||||
doc_type: |
|
||||
if(file.hasTag("plugin/transformer"), "transformer",
|
||||
if(file.hasTag("plugin/emitter"), "emitter",
|
||||
if(file.hasTag("plugin/filter"), "filter",
|
||||
if(file.hasTag("component"), "component",
|
||||
if(file.inFolder("features"), "feature",
|
||||
if(file.inFolder("advanced"), "advanced",
|
||||
if(file.inFolder("plugins"), "plugin",
|
||||
if(file.inFolder("getting-started"), "getting-started",
|
||||
if(file.inFolder("cli"), "cli", "guide")))))))))
|
||||
last_modified: file.mtime.relative()
|
||||
section: |
|
||||
if(file.inFolder("plugins"), "plugins",
|
||||
if(file.inFolder("features"), "features",
|
||||
if(file.inFolder("advanced"), "advanced",
|
||||
if(file.inFolder("getting-started"), "getting-started",
|
||||
if(file.inFolder("cli"), "cli",
|
||||
if(file.inFolder("tags"), "tags", "core"))))))
|
||||
properties:
|
||||
title:
|
||||
displayName: Title
|
||||
formula.doc_type:
|
||||
displayName: Type
|
||||
formula.last_modified:
|
||||
displayName: Updated
|
||||
formula.section:
|
||||
displayName: Section
|
||||
views:
|
||||
- type: table
|
||||
name: All Documentation
|
||||
groupBy:
|
||||
property: formula.section
|
||||
direction: ASC
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.doc_type
|
||||
- formula.section
|
||||
- formula.last_modified
|
||||
sort:
|
||||
- property: formula.doc_type
|
||||
direction: ASC
|
||||
- property: file.name
|
||||
direction: ASC
|
||||
columnSize:
|
||||
file.name: 185
|
||||
note.title: 268
|
||||
formula.doc_type: 146
|
||||
formula.section: 276
|
||||
- type: table
|
||||
name: Plugins
|
||||
filters:
|
||||
or:
|
||||
- file.hasTag("plugin/transformer")
|
||||
- file.hasTag("plugin/emitter")
|
||||
- file.hasTag("plugin/filter")
|
||||
groupBy:
|
||||
property: formula.doc_type
|
||||
direction: ASC
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.doc_type
|
||||
- formula.last_modified
|
||||
- type: table
|
||||
name: Components & Features
|
||||
filters:
|
||||
or:
|
||||
- file.hasTag("component")
|
||||
- file.inFolder("features")
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.doc_type
|
||||
- formula.last_modified
|
||||
- type: list
|
||||
name: Recently Updated
|
||||
order:
|
||||
- file.name
|
||||
- formula.last_modified
|
||||
limit: 15
|
||||
- type: table
|
||||
name: Core Guides
|
||||
filters:
|
||||
not:
|
||||
- file.inFolder("plugins")
|
||||
- file.inFolder("features")
|
||||
- file.inFolder("advanced")
|
||||
- file.inFolder("getting-started")
|
||||
- file.inFolder("cli")
|
||||
- file.inFolder("tags")
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.last_modified
|
||||
- type: board
|
||||
name: By Type (Board)
|
||||
groupBy:
|
||||
property: formula.doc_type
|
||||
direction: ASC
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.last_modified
|
||||
- type: gallery
|
||||
name: Gallery
|
||||
order:
|
||||
- title
|
||||
- formula.doc_type
|
||||
- formula.section
|
||||
limit: 30
|
||||
- type: cards
|
||||
name: Cards
|
||||
order:
|
||||
- file.name
|
||||
- title
|
||||
- formula.doc_type
|
||||
- formula.section
|
||||
- formula.last_modified
|
||||
limit: 24
|
||||
- type: cards
|
||||
name: Image Cards
|
||||
filters:
|
||||
and:
|
||||
- file.folder == "plugins"
|
||||
- "!image.isEmpty()"
|
||||
order:
|
||||
- file.name
|
||||
image: note.image
|
||||
cardSize: 220
|
||||
imageAspectRatio: 1
|
||||
@@ -0,0 +1,321 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "group-node-types",
|
||||
"type": "group",
|
||||
"x": -30,
|
||||
"y": 260,
|
||||
"width": 1220,
|
||||
"height": 460,
|
||||
"color": "6",
|
||||
"label": "Node Types"
|
||||
},
|
||||
{
|
||||
"id": "group-config",
|
||||
"type": "group",
|
||||
"x": -30,
|
||||
"y": 1180,
|
||||
"width": 1220,
|
||||
"height": 360,
|
||||
"color": "2",
|
||||
"label": "Configuration"
|
||||
},
|
||||
{
|
||||
"id": "group-colors",
|
||||
"type": "group",
|
||||
"x": -30,
|
||||
"y": 790,
|
||||
"width": 1220,
|
||||
"height": 320,
|
||||
"color": "4",
|
||||
"label": "Preset Colors"
|
||||
},
|
||||
{
|
||||
"id": "group-edges",
|
||||
"type": "group",
|
||||
"x": -30,
|
||||
"y": 1610,
|
||||
"width": 1220,
|
||||
"height": 320,
|
||||
"color": "3",
|
||||
"label": "Edges & Connections"
|
||||
},
|
||||
{
|
||||
"id": "title",
|
||||
"type": "text",
|
||||
"text": "# CanvasPage Plugin\n\nThis plugin renders [JSON Canvas](https://jsoncanvas.org) (`.canvas`) files as interactive, pannable and zoomable canvas pages. It supports the full [JSON Canvas 1.0 spec](https://jsoncanvas.org/spec/1.0/).\n\nInstall: `npx quartz plugin add github:quartz-community/canvas-page`",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"width": 560,
|
||||
"height": 200,
|
||||
"color": "5"
|
||||
},
|
||||
{
|
||||
"id": "text-node-demo",
|
||||
"type": "text",
|
||||
"text": "## Text Nodes\n\nText nodes render **Markdown** content with GFM support:\n\n- **Bold** and *italic* text\n- ~~Strikethrough~~ text\n- [External links](https://jsoncanvas.org)\n- `Inline code` blocks\n- Lists (like this one)\n\n### Headings Work Too\n\nAll standard Markdown syntax is rendered at build time.",
|
||||
"x": 0,
|
||||
"y": 300,
|
||||
"width": 360,
|
||||
"height": 280,
|
||||
"color": "1"
|
||||
},
|
||||
{
|
||||
"id": "file-node-info",
|
||||
"type": "text",
|
||||
"text": "## File Nodes\n\nFile nodes reference other pages in your vault. They appear as clickable links and support **popover previews** on hover.\n\nThe node below links to the CanvasPage documentation:",
|
||||
"x": 400,
|
||||
"y": 300,
|
||||
"width": 360,
|
||||
"height": 160,
|
||||
"color": "2"
|
||||
},
|
||||
{
|
||||
"id": "file-node-demo",
|
||||
"type": "file",
|
||||
"file": "plugins/CanvasPage.md",
|
||||
"x": 400,
|
||||
"y": 500,
|
||||
"width": 360,
|
||||
"height": 80,
|
||||
"color": "4"
|
||||
},
|
||||
{
|
||||
"id": "link-node-info",
|
||||
"type": "text",
|
||||
"text": "## Link Nodes\n\nLink nodes reference external URLs. The node below links to the JSON Canvas specification:",
|
||||
"x": 800,
|
||||
"y": 300,
|
||||
"width": 360,
|
||||
"height": 120,
|
||||
"color": "3"
|
||||
},
|
||||
{
|
||||
"id": "link-node-demo",
|
||||
"type": "link",
|
||||
"url": "https://jsoncanvas.org/spec/1.0/",
|
||||
"x": 800,
|
||||
"y": 460,
|
||||
"width": 360,
|
||||
"height": 80,
|
||||
"color": "5"
|
||||
},
|
||||
{
|
||||
"id": "color-1",
|
||||
"type": "text",
|
||||
"text": "**Color 1** — Red",
|
||||
"x": 0,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "1"
|
||||
},
|
||||
{
|
||||
"id": "color-2",
|
||||
"type": "text",
|
||||
"text": "**Color 2** — Orange",
|
||||
"x": 200,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "2"
|
||||
},
|
||||
{
|
||||
"id": "color-3",
|
||||
"type": "text",
|
||||
"text": "**Color 3** — Yellow",
|
||||
"x": 400,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "3"
|
||||
},
|
||||
{
|
||||
"id": "color-4",
|
||||
"type": "text",
|
||||
"text": "**Color 4** — Green",
|
||||
"x": 600,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "4"
|
||||
},
|
||||
{
|
||||
"id": "color-5",
|
||||
"type": "text",
|
||||
"text": "**Color 5** — Cyan",
|
||||
"x": 800,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "5"
|
||||
},
|
||||
{
|
||||
"id": "color-6",
|
||||
"type": "text",
|
||||
"text": "**Color 6** — Purple",
|
||||
"x": 1000,
|
||||
"y": 830,
|
||||
"width": 180,
|
||||
"height": 80,
|
||||
"color": "6"
|
||||
},
|
||||
{
|
||||
"id": "color-custom",
|
||||
"type": "text",
|
||||
"text": "**Custom hex color** — `#ff6600`",
|
||||
"x": 400,
|
||||
"y": 950,
|
||||
"width": 380,
|
||||
"height": 80,
|
||||
"color": "#ff6600"
|
||||
},
|
||||
{
|
||||
"id": "config-options",
|
||||
"type": "text",
|
||||
"text": "## Configuration Options\n\n- `enableInteraction` — Enable pan and zoom. Default: `true`\n- `initialZoom` — Initial zoom level. Default: `1`\n- `minZoom` — Minimum zoom level. Default: `0.1`\n- `maxZoom` — Maximum zoom level. Default: `5`\n- `defaultFullscreen` — Start in fullscreen mode. Default: `false`\n\nConfigure in `quartz.config.yaml`:\n\n```\nCanvasPage({ defaultFullscreen: false, initialZoom: 1 })\n```",
|
||||
"x": 0,
|
||||
"y": 1220,
|
||||
"width": 560,
|
||||
"height": 280
|
||||
},
|
||||
{
|
||||
"id": "config-fullscreen",
|
||||
"type": "text",
|
||||
"text": "## Fullscreen Mode\n\nClick the **expand button** (top-right corner) to toggle fullscreen mode. The canvas fills the entire viewport.\n\n- Press **Escape** to exit fullscreen\n- Set `defaultFullscreen: true` to start in fullscreen\n- The toggle button switches between expand and collapse icons\n\n## Quartz Integration\n\n- **Popover previews**: Hover over file nodes to see a preview\n- **Internal links**: File nodes link to pages in your vault\n- **Dark mode**: Canvas adapts to your theme settings",
|
||||
"x": 600,
|
||||
"y": 1220,
|
||||
"width": 560,
|
||||
"height": 280
|
||||
},
|
||||
{
|
||||
"id": "edge-source",
|
||||
"type": "text",
|
||||
"text": "## Edges\n\nEdges connect nodes with SVG paths. They support **labels**, **arrows**, and **colors**.",
|
||||
"x": 0,
|
||||
"y": 1650,
|
||||
"width": 300,
|
||||
"height": 120,
|
||||
"color": "1"
|
||||
},
|
||||
{
|
||||
"id": "edge-labeled",
|
||||
"type": "text",
|
||||
"text": "This edge has a **label** and an arrow marker.",
|
||||
"x": 450,
|
||||
"y": 1650,
|
||||
"width": 260,
|
||||
"height": 80,
|
||||
"color": "4"
|
||||
},
|
||||
{
|
||||
"id": "edge-colored",
|
||||
"type": "text",
|
||||
"text": "This edge has a **custom color** (`#ff6600`).",
|
||||
"x": 450,
|
||||
"y": 1780,
|
||||
"width": 260,
|
||||
"height": 80,
|
||||
"color": "2"
|
||||
},
|
||||
{
|
||||
"id": "edge-preset",
|
||||
"type": "text",
|
||||
"text": "Edges can use the same **preset colors** (1–6) as nodes, or custom **hex colors** like `#ff6600`.",
|
||||
"x": 850,
|
||||
"y": 1650,
|
||||
"width": 300,
|
||||
"height": 120,
|
||||
"color": "6"
|
||||
},
|
||||
{
|
||||
"id": "api-info",
|
||||
"type": "text",
|
||||
"text": "## API\n\n- **Category**: Page Type\n- **Function name**: `ExternalPlugin.CanvasPage()`\n- **Source**: [quartz-community/canvas-page](https://github.com/quartz-community/canvas-page)\n- **Install**: `npx quartz plugin add github:quartz-community/canvas-page`",
|
||||
"x": 0,
|
||||
"y": 2000,
|
||||
"width": 560,
|
||||
"height": 180
|
||||
},
|
||||
{
|
||||
"id": "spec-info",
|
||||
"type": "text",
|
||||
"text": "## JSON Canvas Spec\n\nThis plugin implements the [JSON Canvas 1.0](https://jsoncanvas.org/spec/1.0/) specification — an open file format for infinite canvas data.\n\nCanvas files use the `.canvas` extension and are standard JSON. They are natively supported by [Obsidian](https://obsidian.md).",
|
||||
"x": 600,
|
||||
"y": 2000,
|
||||
"width": 560,
|
||||
"height": 180
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"id": "edge-title-to-types",
|
||||
"fromNode": "title",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "group-node-types",
|
||||
"toSide": "top",
|
||||
"label": "supports"
|
||||
},
|
||||
{
|
||||
"id": "edge-info-to-file",
|
||||
"fromNode": "file-node-info",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "file-node-demo",
|
||||
"toSide": "top",
|
||||
"color": "4"
|
||||
},
|
||||
{
|
||||
"id": "edge-info-to-link",
|
||||
"fromNode": "link-node-info",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "link-node-demo",
|
||||
"toSide": "top",
|
||||
"color": "5"
|
||||
},
|
||||
{
|
||||
"id": "edge-types-to-colors",
|
||||
"fromNode": "group-node-types",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "group-colors",
|
||||
"toSide": "top"
|
||||
},
|
||||
{
|
||||
"id": "edge-colors-to-config",
|
||||
"fromNode": "group-colors",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "group-config",
|
||||
"toSide": "top"
|
||||
},
|
||||
{
|
||||
"id": "edge-config-to-edges",
|
||||
"fromNode": "group-config",
|
||||
"fromSide": "bottom",
|
||||
"toNode": "group-edges",
|
||||
"toSide": "top"
|
||||
},
|
||||
{
|
||||
"id": "edge-labeled-demo",
|
||||
"fromNode": "edge-source",
|
||||
"fromSide": "right",
|
||||
"toNode": "edge-labeled",
|
||||
"toSide": "left",
|
||||
"label": "labeled edge"
|
||||
},
|
||||
{
|
||||
"id": "edge-colored-demo",
|
||||
"fromNode": "edge-source",
|
||||
"fromSide": "right",
|
||||
"toNode": "edge-colored",
|
||||
"toSide": "left",
|
||||
"color": "#ff6600"
|
||||
},
|
||||
{
|
||||
"id": "edge-preset-demo",
|
||||
"fromNode": "edge-labeled",
|
||||
"fromSide": "right",
|
||||
"toNode": "edge-preset",
|
||||
"toSide": "left",
|
||||
"color": "6"
|
||||
}
|
||||
]
|
||||
}
|
||||
+119
-16
@@ -11,7 +11,7 @@ This question is best answered by tracing what happens when a user (you!) runs `
|
||||
1. After running `npx quartz build`, npm will look at `package.json` to find the `bin` entry for `quartz` which points at `./quartz/bootstrap-cli.mjs`.
|
||||
2. This file has a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) line at the top which tells npm to execute it using Node.
|
||||
3. `bootstrap-cli.mjs` is responsible for a few things:
|
||||
1. Parsing the command-line arguments using [yargs](http://yargs.js.org/).
|
||||
1. Parsing the command-line arguments using [yargs](http://yargs.js.org/). The `plugin` subcommand is also handled here for managing external plugins.
|
||||
2. Transpiling and bundling the rest of Quartz (which is in Typescript) to regular JavaScript using [esbuild](https://esbuild.github.io/). The `esbuild` configuration here is slightly special as it also handles `.scss` file imports using [esbuild-sass-plugin v2](https://www.npmjs.com/package/esbuild-sass-plugin). Additionally, we bundle 'inline' client-side scripts (any `.inline.ts` file) that components declare using a custom `esbuild` plugin that runs another instance of `esbuild` which bundles for the browser instead of `node`. Modules of both types are imported as plain text.
|
||||
3. Running the local preview server if `--serve` is set. This starts two servers:
|
||||
1. A WebSocket server on port 3001 to handle hot-reload signals. This tracks all inbound connections and sends a 'rebuild' message a server-side change is detected (either content or configuration).
|
||||
@@ -21,32 +21,135 @@ This question is best answered by tracing what happens when a user (you!) runs `
|
||||
4. In `build.ts`, we start by installing source map support manually to account for the query string cache busting hack we introduced earlier. Then, we start processing content:
|
||||
1. Clean the output directory.
|
||||
2. Recursively glob all files in the `content` folder, respecting the `.gitignore`.
|
||||
3. Parse the Markdown files.
|
||||
3. Collect every page's slug (`ctx.allSlugs`), taking frontmatter `permalink`s into account, so links can be resolved while parsing.
|
||||
4. Parse the Markdown files.
|
||||
1. Quartz detects the number of threads available and chooses to spawn worker threads if there are >128 pieces of content to parse (rough heuristic). If it needs to spawn workers, it will invoke esbuild again to transpile the worker script `quartz/worker.ts`. Then, a work-stealing [workerpool](https://www.npmjs.com/package/workerpool) is then created and batches of 128 files are assigned to workers.
|
||||
2. Each worker (or just the main thread if there is no concurrency) creates a [unified](https://github.com/unifiedjs/unified) parser based off of the plugins defined in the [[configuration]].
|
||||
3. Parsing has three steps:
|
||||
3. Parsing has these steps:
|
||||
1. Read the file into a [vfile](https://github.com/vfile/vfile).
|
||||
2. Applied plugin-defined text transformations over the content.
|
||||
3. Slugify the file path and store it in the data for the file. See the page on [[paths]] for more details about how path logic works in Quartz (spoiler: its complicated).
|
||||
3. Slugify the file path (or use its `permalink`) and store it in the data for the file. See the page on [[paths]] for more details about how path logic works in Quartz (spoiler: its complicated).
|
||||
4. Markdown parsing using [remark-parse](https://www.npmjs.com/package/remark-parse) (text to [mdast](https://github.com/syntax-tree/mdast)).
|
||||
5. Apply plugin-defined Markdown-to-Markdown transformations.
|
||||
5. Apply the transformers' Markdown-to-Markdown transformations, in plugin order. The [[built-in processing|built-in]] frontmatter parsing runs among them at order 0 and sets `file.data.frontmatter`.
|
||||
6. Convert Markdown into HTML using [remark-rehype](https://github.com/remarkjs/remark-rehype) ([mdast](https://github.com/syntax-tree/mdast) to [hast](https://github.com/syntax-tree/hast)).
|
||||
7. Apply plugin-defined HTML-to-HTML transformations.
|
||||
4. Filter out unwanted content using plugins.
|
||||
5. Emit files using plugins.
|
||||
1. Gather all the static resources (e.g. external CSS, JS modules, etc.) each emitter plugin declares.
|
||||
2. Emitters that emit HTML files do a bit of extra work here as they need to transform the [hast](https://github.com/syntax-tree/hast) produced in the parse step to JSX. This is done using [hast-util-to-jsx-runtime](https://github.com/syntax-tree/hast-util-to-jsx-runtime) with the [Preact](https://preactjs.com/) runtime. Finally, the JSX is rendered to HTML using [preact-render-to-string](https://github.com/preactjs/preact-render-to-string) which statically renders the JSX to HTML (i.e. doesn't care about `useState`, `useEffect`, or any other React/Preact interactive bits). Here, we also do a bunch of fun stuff like assemble the page [[layout]] from `quartz.layout.ts`, assemble all the inline scripts that actually get shipped to the client, and all the transpiled styles. The bulk of this logic can be found in `quartz/components/renderPage.tsx`. Other fun things of note:
|
||||
1. CSS is minified and transformed using [Lightning CSS](https://github.com/parcel-bundler/lightningcss) to add vendor prefixes and do syntax lowering.
|
||||
7. Apply the transformers' HTML-to-HTML transformations, in plugin order. The built-in link processing runs among them at order 60: it rewrites internal links and records `file.data.links`.
|
||||
5. Filter out unwanted content using filter plugins and the built-in drafts filter.
|
||||
6. Emit files using emitters, in three phases (`quartz/processors/emit.ts`):
|
||||
1. Gather all the static resources (e.g. external CSS, JS modules, etc.) that transformers and emitters declare. The `ComponentResources` emitter runs first and writes the site's CSS and scripts:
|
||||
1. CSS is minified and transformed using [Lightning CSS](https://github.com/parcel-bundler/lightningcss) to add vendor prefixes and do syntax lowering. Quartz's and the components' styles are put in the `quartz-base` cascade layer.
|
||||
2. Scripts are split into `beforeDOMLoaded` and `afterDOMLoaded` and are inserted in the `<head>` and `<body>` respectively.
|
||||
3. Finally, each emitter plugin is responsible for emitting and writing it's own emitted files to disk.
|
||||
6. If the `--serve` flag was detected, we also set up another file watcher to detect content changes (only `.md` files). We keep a content map that tracks the parsed AST and plugin data for each slug and update this on file changes. Newly added or modified paths are rebuilt and added to the content map. Then, all the filters and emitters are run over the resulting content map. This file watcher is debounced with a threshold of 250ms. On success, we send a client refresh signal using the passed in callback function.
|
||||
2. The `PageTypeDispatcher` emitter renders the HTML pages (`quartz/plugins/pageTypes/dispatcher.ts`):
|
||||
1. Each page type's `generate` runs, one after another in priority order, and returns virtual pages (folder and tag pages, `.base` and `.canvas` pages, …). They are collected in `ctx.virtualPages`. Pages that stand for a file (page types with `fileExtensions`) first go through the site's filters, with `file.data.referencedBy` set to the pages that link to them.
|
||||
2. The bodies of the virtual pages are rendered (so they can be embedded), and the transformers' `virtualPageHtmlPlugins` run on those of file-backed pages.
|
||||
3. Every content page is rendered by the first page type (highest priority) whose `match` accepts it, and every virtual page by the page type that generated it. Rendering transforms the [hast](https://github.com/syntax-tree/hast) produced in the parse step to JSX using [hast-util-to-jsx-runtime](https://github.com/syntax-tree/hast-util-to-jsx-runtime) with the [Preact](https://preactjs.com/) runtime, applies the transformers' `renderTransforms` (`before`), inlines transclusions, applies the page types' `treeTransforms` and the transformers' `renderTransforms` (`after`), assembles the page [[layout]] and [[layout#Page Frames|frame]], and renders the JSX to HTML using [preact-render-to-string](https://github.com/preactjs/preact-render-to-string) (statically: `useState`, `useEffect` and other interactive bits don't run). The bulk of this logic can be found in `quartz/components/renderPage.tsx`.
|
||||
3. The content index is built once from the published and virtual pages (`ctx.contentIndex`), then all other emitters run in parallel over the same content (virtual pages included). The built-in content index emitter writes `static/contentIndex.json`, the sitemap and the RSS feed; plugin emitters write their own files.
|
||||
7. If the `--serve` flag was detected, we also set up another file watcher to detect content changes (only `.md` files). We keep a content map that tracks the parsed AST and plugin data for each slug and update this on file changes. Newly added or modified paths are rebuilt and added to the content map. Then, all the filters and emitters are run over the resulting content map. This file watcher is debounced with a threshold of 250ms. On success, we send a client refresh signal using the passed in callback function.
|
||||
|
||||
## On the client
|
||||
|
||||
1. The browser opens a Quartz page and loads the HTML. The `<head>` also links to page styles (emitted to `public/index.css`) and page-critical JS (emitted to `public/prescript.js`)
|
||||
2. Then, once the body is loaded, the browser loads the non-critical JS (emitted to `public/postscript.js`)
|
||||
1. The browser opens a Quartz page and loads the HTML. The `<head>` also links to page styles (emitted to `public/index-<hash>.css`, plus a file per component stylesheet) and page-critical JS (emitted to `public/prescript-<hash>.js`). With `--serve`, the names have no hash.
|
||||
2. Then, once the body is loaded, the browser loads the non-critical JS (`public/postscript-<hash>.js`). In a production build it imports each component's `afterDOMLoaded` script (`static/scripts/`) in parallel, then the SPA router; with `--serve` it holds all of them.
|
||||
3. Once the page is done loading, the page will then dispatch a custom synthetic browser event `"nav"`. This is used so client-side scripts declared by components can 'setup' anything that requires access to the page DOM.
|
||||
1. If the [[SPA Routing|enableSPA option]] is enabled in the [[configuration]], this `"nav"` event is also fired on any client-navigation to allow for components to unregister and reregister any event handlers and state.
|
||||
2. If it's not, we wire up the `"nav"` event to just be fired a single time after page load to allow for consistency across how state is setup across both SPA and non-SPA contexts.
|
||||
3. A separate `"render"` event can be dispatched when the DOM is updated in-place without a full navigation (e.g. after content decryption). Components that attach listeners to content elements should listen for both `"nav"` and `"render"`.
|
||||
|
||||
The architecture and design of the plugin system was intentionally left pretty vague here as this is described in much more depth in the guide on [[making plugins|making your own plugin]].
|
||||
## Community Package Layering
|
||||
|
||||
Quartz v5 separates shared code into three community packages, each with a distinct responsibility:
|
||||
|
||||
- **`@quartz-community/types`** — Type definitions, interfaces, and the canonical `vfile` DataMap augmentation. This is the "contract" between Quartz and plugins. It has no runtime dependencies.
|
||||
- **`@quartz-community/utils`** — Shared utility functions (path manipulation, DOM helpers, sorting, date formatting, JSX conversion, etc.). Depends on `@quartz-community/types`.
|
||||
- **`@quartz-community/runtime`** — Browser-only utilities for client-side scripts (event handling, navigation, storage, script loading). Depends on both `types` and `utils`.
|
||||
|
||||
```
|
||||
types (no deps)
|
||||
↑
|
||||
utils (depends on types)
|
||||
↑
|
||||
runtime (depends on types + utils)
|
||||
↑
|
||||
plugins (depend on any combination)
|
||||
```
|
||||
|
||||
Plugins should import types from `@quartz-community/types`, utility functions from `@quartz-community/utils`, and browser utilities from `@quartz-community/runtime`. This layering ensures plugins don't depend on Quartz core.
|
||||
|
||||
## Plugin System
|
||||
|
||||
Quartz v5 introduces a community plugin system. Plugins are standalone packages: the default plugins are npm packages (dependencies of Quartz, installed in `node_modules`), other plugins can also be Git repositories or local folders, which are installed into `.quartz/plugins/`. Their named exports are re-exported through an auto-generated index file at `.quartz/plugins/index.ts`, which you import in a `quartz.ts` override as `ExternalPlugin`.
|
||||
|
||||
### Plugin Types
|
||||
|
||||
There are four processing plugin categories, plus Bases views:
|
||||
|
||||
- **Transformers**: Map over content (generate descriptions, syntax highlighting, Obsidian syntax)
|
||||
- **Filters**: Filter content (explicit publish, unlisted pages)
|
||||
- **Emitters**: Reduce over content (generate RSS, sitemaps, alias redirects, OG images)
|
||||
- **Page Types**: Define how pages are rendered. Each page type handles a specific kind of page (content notes, folder listings, tag listings, 404). Page types are ordinary entries in the `plugins` list of `quartz.config.yaml` whose manifest has the category `pageType`. The `PageTypeDispatcher` emitter routes pages to the appropriate page type plugin based on the content.
|
||||
- **Bases Views**: Custom view renderers for the `bases-page` plugin's database-like view system. Plugins can register new view types (e.g., timeline, kanban) via the `ViewRegistry`. See [[making plugins#Bases Views]] for details.
|
||||
|
||||
Frontmatter parsing, link processing, drafts and the content index are not plugins but [[built-in processing]].
|
||||
|
||||
Plugins can also provide components and frames. These roles are **not mutually exclusive** — a single plugin can be a transformer AND provide components (e.g., `table-of-contents`), or be a page type AND provide custom frames (e.g., `canvas-page`).
|
||||
|
||||
### Plugin Resolution
|
||||
|
||||
When a Git plugin is installed, e.g. with `npx quartz plugin add github:your-name/my-plugin`:
|
||||
|
||||
1. The repository is cloned into `.quartz/plugins/my-plugin/`
|
||||
2. If it ships a pre-built `dist/` (not gitignored), that is used as is and only its peer dependencies are linked to the site's `node_modules`. Otherwise its dependencies are installed and it is built using `tsup` (defined in the plugin's `tsup.config.ts`)
|
||||
3. An auto-generated `.quartz/plugins/index.ts` re-exports all installed plugins
|
||||
4. The plugin's commit hash is recorded in `quartz.lock.json`
|
||||
|
||||
npm plugins (such as the default `@quartz-community/explorer`) are imported from `node_modules` and are not cloned or built.
|
||||
|
||||
### Plugin CLI Commands
|
||||
|
||||
- `npx quartz plugin add github:quartz-community/<name>` — Install a community plugin
|
||||
- `npx quartz plugin install --latest` — Update all plugins to latest commits
|
||||
- `npx quartz plugin install` — Install plugins at the commits locked in `quartz.lock.json` (used in CI/CD); `--clean` only restores plugins whose directory is missing
|
||||
- `npx quartz plugin remove <name>` — Remove an installed plugin
|
||||
|
||||
### Plugin Structure
|
||||
|
||||
Each community plugin repository contains:
|
||||
|
||||
- `src/index.ts` — Plugin entry point exporting the plugin function
|
||||
- `tsup.config.ts` — Build configuration using tsup
|
||||
- `package.json` — Declares dependencies on `@quartz-community/types` and `@quartz-community/utils`, and the [[plugin manifest]] in its `quartz` field
|
||||
|
||||
The architecture and design of the plugin system was intentionally left pretty vague here as this is described in much more depth in the guide on [[making plugins|creating plugins]].
|
||||
|
||||
## Page Frames
|
||||
|
||||
Page frames control the inner HTML structure of each page. While the outer shell (`<html>`, `<head>`, `<body>`, `#quartz-root`) is always the same (required for [[SPA Routing]]), the frame determines how layout slots are arranged inside the page.
|
||||
|
||||
The frame system lives in `quartz/components/frames/` and consists of:
|
||||
|
||||
- `types.ts` — Defines the `PageFrame` and `PageFrameProps` interfaces
|
||||
- `DefaultFrame.tsx` — Three-column layout (left sidebar, center, right sidebar, footer)
|
||||
- `FullWidthFrame.tsx` — No sidebars, single center column
|
||||
- `MinimalFrame.tsx` — No sidebars, no header/beforeBody, just content and footer
|
||||
- `registry.ts` — `FrameRegistry` singleton for plugin-registered frames
|
||||
- `index.ts` — `resolveFrame()` function and built-in frame registry
|
||||
|
||||
### Frame Registry
|
||||
|
||||
The `FrameRegistry` (`quartz/components/frames/registry.ts`) is a singleton that stores frames registered by community plugins. It mirrors the design of the `ComponentRegistry`. Plugins declare frames in their `package.json` manifest under the `"quartz"."frames"` field, and these are loaded by `quartz/plugins/loader/frameLoader.ts` during plugin initialization.
|
||||
|
||||
### Frame Resolution
|
||||
|
||||
The rendering pipeline in `quartz/components/renderPage.tsx` delegates to the resolved frame's `render()` function. Frame resolution happens in the `PageTypeDispatcher` emitter (`quartz/plugins/pageTypes/dispatcher.ts`) using this priority:
|
||||
|
||||
1. YAML config: `layout.byPageType.<name>.template`
|
||||
2. Plugin-registered frame: looked up by name in the `FrameRegistry`
|
||||
3. Built-in frame: looked up by name in the `builtinFrames` map
|
||||
4. Fallback: `"default"`
|
||||
|
||||
The active frame name is set as a `data-frame` attribute on the `.page` element, enabling frame-specific CSS overrides in `quartz/styles/base.scss`.
|
||||
|
||||
### Plugin-Provided Frames
|
||||
|
||||
Community plugins can ship their own frames by exporting them from a `./frames` subpath and declaring them in the plugin manifest. For example, the `canvas-page` plugin provides a `"canvas"` frame with a fullscreen layout and togglable sidebar. See [[making plugins#Providing Custom Frames]] for implementation details.
|
||||
|
||||
See [[layout#Page Frames]] for user-facing documentation and [[making plugins#Page Types]] for how to set frames in page type plugins.
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Creating your own Quartz components
|
||||
title: Creating Component Plugins
|
||||
---
|
||||
|
||||
> [!warning]
|
||||
@@ -20,229 +20,341 @@ However, HTML doesn't let you create reusable templates. If you wanted to create
|
||||
|
||||
In effect, components allow you to write a JavaScript function that takes some data and produces HTML as an output. **While Quartz doesn't use React, it uses the same component concept to allow you to easily express layout templates in your Quartz site.**
|
||||
|
||||
## An Example Component
|
||||
## Community Component Plugins
|
||||
|
||||
### Constructor
|
||||
In v5, most components are community plugins — standalone repositories that export a `QuartzComponent`. These plugins are decoupled from the core Quartz repository, allowing for easier maintenance and sharing.
|
||||
|
||||
Component files are written in `.tsx` files that live in the `quartz/components` folder. These are re-exported in `quartz/components/index.ts` so you can use them in layouts and other components more easily.
|
||||
### Getting Started
|
||||
|
||||
Each component file should have a default export that satisfies the `QuartzComponentConstructor` function signature. It's a function that takes in a single optional parameter `opts` and returns a Quartz Component. The type of the parameters `opts` is defined by the interface `Options` which you as the component creator also decide.
|
||||
To create a new component plugin, you can use the official plugin template:
|
||||
|
||||
In your component, you can use the values from the configuration option to change the rendering behaviour inside of your component. For example, the component in the code snippet below will not render if the `favouriteNumber` option is below 0.
|
||||
```shell
|
||||
git clone https://github.com/quartz-community/plugin-template.git my-component
|
||||
cd my-component
|
||||
npm install
|
||||
```
|
||||
|
||||
```tsx {11-17}
|
||||
interface Options {
|
||||
### Plugin Structure
|
||||
|
||||
A component is a constructor: a function that takes the user's options and returns a `QuartzComponent`. Put it in `src/components/`:
|
||||
|
||||
```tsx title="src/components/MyComponent.tsx"
|
||||
import type { QuartzComponent, QuartzComponentConstructor } from "@quartz-community/types"
|
||||
|
||||
export interface MyComponentOptions {
|
||||
favouriteNumber: number
|
||||
}
|
||||
|
||||
const defaultOptions: Options = {
|
||||
const defaultOptions: MyComponentOptions = {
|
||||
favouriteNumber: 42,
|
||||
}
|
||||
|
||||
export default ((userOpts?: Options) => {
|
||||
const opts = { ...userOpts, ...defaultOpts }
|
||||
function YourComponent(props: QuartzComponentProps) {
|
||||
if (opts.favouriteNumber < 0) {
|
||||
return null
|
||||
}
|
||||
export default ((userOpts?: Partial<MyComponentOptions>) => {
|
||||
const opts = { ...defaultOptions, ...userOpts }
|
||||
|
||||
return <p>My favourite number is {opts.favouriteNumber}</p>
|
||||
const Component: QuartzComponent = () => {
|
||||
if (opts.favouriteNumber < 0) return null
|
||||
return <p class="my-component">My favourite number is {opts.favouriteNumber}</p>
|
||||
}
|
||||
|
||||
return YourComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
return Component
|
||||
}) satisfies QuartzComponentConstructor<Partial<MyComponentOptions>>
|
||||
```
|
||||
|
||||
Quartz loads components from the package's **`./components`** export, by the names listed in the manifest — not from the entry module, and not from a `default` export:
|
||||
|
||||
```ts title="src/components/index.ts"
|
||||
export { default as MyComponent } from "./MyComponent"
|
||||
export type { MyComponentOptions } from "./MyComponent"
|
||||
```
|
||||
|
||||
```json title="package.json"
|
||||
{
|
||||
"exports": {
|
||||
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
|
||||
"./components": {
|
||||
"types": "./dist/components/index.d.ts",
|
||||
"import": "./dist/components/index.js"
|
||||
}
|
||||
},
|
||||
"quartz": {
|
||||
"category": "component",
|
||||
"components": {
|
||||
"MyComponent": {
|
||||
"displayName": "My Component",
|
||||
"defaultPosition": "right",
|
||||
"defaultPriority": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The key in `quartz.components` must match the export name in `src/components/index.ts`; `defaultPosition` and `defaultPriority` place the component when the user's config doesn't (see [[plugin manifest#components]]). The plugin template's `tsup.config.ts` already builds the `components/index` entry.
|
||||
|
||||
Also re-export the constructor by name from the entry module, so users can call it in `quartz.ts` overrides (`ExternalPlugin.MyComponent(…)`, see [[#Installing Your Component]]). The generated `.quartz/plugins/index.ts` re-exports your entry module's named exports; `default` exports are left out.
|
||||
|
||||
```ts title="src/index.ts"
|
||||
export { MyComponent } from "./components"
|
||||
export type { MyComponentOptions } from "./components"
|
||||
```
|
||||
|
||||
### Props
|
||||
|
||||
The Quartz component itself (lines 11-17 highlighted above) looks like a React component. It takes in properties (sometimes called [props](https://react.dev/learn/passing-props-to-a-component)) and returns JSX.
|
||||
|
||||
All Quartz components accept the same set of props:
|
||||
|
||||
```tsx title="quartz/components/types.ts"
|
||||
// simplified for sake of demonstration
|
||||
```tsx
|
||||
export type QuartzComponentProps = {
|
||||
fileData: QuartzPluginData
|
||||
ctx: unknown
|
||||
externalResources: StaticResources
|
||||
fileData: QuartzPluginData & Record<string, unknown>
|
||||
cfg: GlobalConfiguration
|
||||
tree: Node<QuartzPluginData>
|
||||
allFiles: QuartzPluginData[]
|
||||
children: unknown
|
||||
tree: unknown
|
||||
allFiles: (QuartzPluginData & Record<string, unknown>)[]
|
||||
displayClass?: "mobile-only" | "desktop-only"
|
||||
[key: string]: unknown
|
||||
}
|
||||
```
|
||||
|
||||
- `fileData`: Any metadata [[making plugins|plugins]] may have added to the current page.
|
||||
- `ctx`: the [[making plugins|`BuildCtx`]] of the build (typed `unknown`; cast it to `BuildCtx` to read it).
|
||||
- `externalResources`: the page's CSS, scripts and head elements.
|
||||
- `fileData`: Any metadata plugins may have added to the current page.
|
||||
- `fileData.slug`: slug of the current page.
|
||||
- `fileData.frontmatter`: any frontmatter parsed.
|
||||
- `cfg`: The `configuration` field in `quartz.config.ts`.
|
||||
- `tree`: the resulting [HTML AST](https://github.com/syntax-tree/hast) after processing and transforming the file. This is useful if you'd like to render the content using [hast-util-to-jsx-runtime](https://github.com/syntax-tree/hast-util-to-jsx-runtime) (you can find an example of this in `quartz/components/pages/Content.tsx`).
|
||||
- `allFiles`: Metadata for all files that have been parsed. Useful for doing page listings or figuring out the overall site structure.
|
||||
- `displayClass`: a utility class that indicates a preference from the user about how to render it in a mobile or desktop setting. Helpful if you want to conditionally hide a component on mobile or desktop.
|
||||
- `cfg`: The `configuration` field in `quartz.config.yaml`.
|
||||
- `children`: child components, for components that wrap others (e.g. `Flex`).
|
||||
- `tree`: the resulting [HTML AST](https://github.com/syntax-tree/hast) (a hast `Root`) after processing and transforming the file.
|
||||
- `allFiles`: Metadata for all published pages, virtual pages included. Useful for doing page listings or figuring out the overall site structure.
|
||||
- `displayClass`: a utility class that indicates a preference from the user about how to render it in a mobile or desktop setting.
|
||||
|
||||
### Styling
|
||||
|
||||
Quartz components can also define a `.css` property on the actual function component which will get picked up by Quartz. This is expected to be a CSS string which can either be inlined or imported from a `.scss` file.
|
||||
In community plugins, styles are bundled with the plugin. You can define styles using the `.css` property on the component:
|
||||
|
||||
Note that inlined styles **must** be plain vanilla CSS:
|
||||
|
||||
```tsx {6-10} title="quartz/components/YourComponent.tsx"
|
||||
export default (() => {
|
||||
function YourComponent() {
|
||||
return <p class="red-text">Example Component</p>
|
||||
}
|
||||
|
||||
YourComponent.css = `
|
||||
p.red-text {
|
||||
color: red;
|
||||
}
|
||||
`
|
||||
|
||||
return YourComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
```tsx
|
||||
Component.css = `
|
||||
.my-component { color: red; }
|
||||
`
|
||||
```
|
||||
|
||||
Imported styles, however, can be from SCSS files:
|
||||
For SCSS, you can import it and assign it to the `.css` property. The build system will handle the transformation:
|
||||
|
||||
```tsx {1-2,9} title="quartz/components/YourComponent.tsx"
|
||||
// assuming your stylesheet is in quartz/components/styles/YourComponent.scss
|
||||
import styles from "./styles/YourComponent.scss"
|
||||
|
||||
export default (() => {
|
||||
function YourComponent() {
|
||||
return <p>Example Component</p>
|
||||
}
|
||||
|
||||
YourComponent.css = styles
|
||||
return YourComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
```tsx
|
||||
import styles from "./styles.scss"
|
||||
Component.css = styles
|
||||
```
|
||||
|
||||
> [!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
|
||||
Quartz puts component CSS in the `quartz-base` [cascade layer](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer), like its own base styles, so a site's `custom.scss` (unlayered) overrides it without needing more specific selectors.
|
||||
|
||||
What about interactivity? Suppose you want to add an-click handler for example. Like the `.css` property on the component, you can also declare `.beforeDOMLoaded` and `.afterDOMLoaded` properties that are strings that contain the script.
|
||||
#### Source attributes
|
||||
|
||||
```tsx title="quartz/components/YourComponent.tsx"
|
||||
export default (() => {
|
||||
function YourComponent() {
|
||||
return <button id="btn">Click me</button>
|
||||
}
|
||||
When Quartz renders a component provided by a plugin, it adds two attributes to the component's root element:
|
||||
|
||||
YourComponent.beforeDOMLoaded = `
|
||||
console.log("hello from before the page loads!")
|
||||
`
|
||||
|
||||
YourComponent.afterDOMLoaded = `
|
||||
document.getElementById('btn').onclick = () => {
|
||||
alert('button clicked!')
|
||||
}
|
||||
`
|
||||
return YourComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
```html
|
||||
<div class="graph" data-quartz-plugin="graph" data-quartz-component="Graph">…</div>
|
||||
```
|
||||
|
||||
> [!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.
|
||||
They let site owners and theme authors find out which plugin produced a part of the page (use your browser's inspector) and give a stable hook for styling, e.g. `[data-quartz-plugin="graph"] { … }`. The attributes are only added when your component returns a single HTML element; components returning `null`, text, a fragment or another component are rendered unchanged. Existing attributes are never modified.
|
||||
|
||||
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.
|
||||
### Internationalization
|
||||
|
||||
The `.afterDOMLoaded` script executes once the page has been completely loaded. This is a good place to setup anything that should last for the duration of a site visit (e.g. getting something saved from local storage).
|
||||
Component plugins should use the i18n pattern for any user-facing strings. See [[making plugins#Internationalization (i18n)]] for the full setup guide.
|
||||
|
||||
If you need to create an `afterDOMLoaded` script that depends on _page specific_ elements that may change when navigating to a new page, you can listen for the `"nav"` event that gets fired whenever a page loads (which may happen on navigation if [[SPA Routing]] is enabled).
|
||||
Quick reference:
|
||||
|
||||
```tsx
|
||||
import { i18n } from "../i18n"
|
||||
|
||||
const MyComponent: QuartzComponent = ({ cfg }) => {
|
||||
const t = i18n(cfg.locale ?? "en-US").components.myComponent
|
||||
return <h2>{t.title}</h2>
|
||||
}
|
||||
```
|
||||
|
||||
Always provide at least an `en-US` locale as the fallback. Additional locales are optional but encouraged for international reach.
|
||||
|
||||
### Scripts and Interactivity
|
||||
|
||||
For interactivity, you can declare `.beforeDOMLoaded` and `.afterDOMLoaded` properties on the component. These should be strings containing the JavaScript to be executed in the browser.
|
||||
|
||||
- `.beforeDOMLoaded`: Executed _before_ the page is done loading (from `<head>`), for early initialization such as applying a saved theme before the page is painted.
|
||||
- `.afterDOMLoaded`: Executed once the page has been completely loaded.
|
||||
|
||||
Each script runs once per full page load, not on every SPA navigation. Don't rely on scripts sharing a scope or running in a particular order:
|
||||
|
||||
- In a production build, each `afterDOMLoaded` script is a separate ES module, and all of them are imported in parallel; only the SPA router (which dispatches the first `nav`) is imported after them.
|
||||
- In `quartz build --serve`, all `afterDOMLoaded` scripts are bundled into one file, each wrapped in its own function.
|
||||
|
||||
Share state between components through `window` or DOM attributes, and do page setup in a `nav` listener rather than at the top level.
|
||||
|
||||
If you need to create an `afterDOMLoaded` script that depends on page-specific elements that may change when navigating, listen for the `"nav"` event:
|
||||
|
||||
```ts
|
||||
document.addEventListener("nav", () => {
|
||||
// do page specific logic here
|
||||
// e.g. attach event listeners
|
||||
const toggleSwitch = document.querySelector("#switch") as HTMLInputElement
|
||||
toggleSwitch.addEventListener("change", switchTheme)
|
||||
window.addCleanup(() => toggleSwitch.removeEventListener("change", switchTheme))
|
||||
if (toggleSwitch) {
|
||||
toggleSwitch.addEventListener("change", switchTheme)
|
||||
window.addCleanup(() => toggleSwitch.removeEventListener("change", switchTheme))
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
You can also add the equivalent of a `beforeunload` event for [[SPA Routing]] via the `prenav` event.
|
||||
You can also use the `"prenav"` event, which fires before the page is replaced during SPA navigation.
|
||||
|
||||
The `"render"` event fires when the DOM has been updated in-place without a full navigation — for example, after content decryption or dynamic DOM modifications by other plugins. If your component attaches event listeners to content elements, listen for `"render"` in addition to `"nav"` to ensure re-initialization:
|
||||
|
||||
```ts
|
||||
document.addEventListener("prenav", () => {
|
||||
// executed after an SPA navigation is triggered but
|
||||
// before the page is replaced
|
||||
// one usage pattern is to store things in sessionStorage
|
||||
// in the prenav and then conditionally load then in the consequent
|
||||
// nav
|
||||
})
|
||||
function setupMyComponent() {
|
||||
const elements = document.querySelectorAll(".my-interactive")
|
||||
for (const el of elements) {
|
||||
el.addEventListener("click", handleClick)
|
||||
window.addCleanup(() => el.removeEventListener("click", handleClick))
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("nav", setupMyComponent)
|
||||
document.addEventListener("render", setupMyComponent)
|
||||
```
|
||||
|
||||
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 during SPA navigation.
|
||||
|
||||
Quartz itself never dispatches `"render"`; plugins that change the page do (e.g. encrypted pages after decryption). Since other components re-run their setup on it, make your `render` handler safe to run more than once.
|
||||
|
||||
#### Links your script adds
|
||||
|
||||
[[prefetching|Prefetching]] and [[popover previews]] look for links on `nav`, and again on `render`. If your script inserts links after `nav` (lists built from `contentIndex.json`, content fetched later), dispatch `render` once they are in the page so they are prefetched and get popovers. Mark links with
|
||||
|
||||
- `data-no-prefetch` to keep them from being prefetched,
|
||||
- `data-router-ignore` to make them full page loads instead of SPA navigations (they aren't prefetched either),
|
||||
- `data-no-popover="true"` to give them no popover.
|
||||
|
||||
When your script needs another page's HTML, get it through the prefetch cache with `window.quartzPrefetch?.load(url)` (set unless prefetching is off; declared in the globals of `@quartz-community/types` 1.3.1+), so a page the reader is about to open is fetched once:
|
||||
|
||||
```ts title="related.inline.ts"
|
||||
import { normalizeRelativeURLs } from "@quartz-community/utils/dom"
|
||||
|
||||
async function pageHtml(url: URL): Promise<string | undefined> {
|
||||
// with prefetching on, use its cache (or fetch through it, so the page is fetched once)
|
||||
if (window.quartzPrefetch) return (await window.quartzPrefetch.load(url))?.text
|
||||
const res = await fetch(url)
|
||||
return res.ok ? await res.text() : undefined
|
||||
}
|
||||
|
||||
document.addEventListener("nav", async () => {
|
||||
const container = document.querySelector<HTMLElement>(".my-related")
|
||||
if (!container?.dataset.src) return
|
||||
const url = new URL(container.dataset.src, window.location.href)
|
||||
const html = await pageHtml(url)
|
||||
if (!html) return
|
||||
const doc = new DOMParser().parseFromString(html, "text/html")
|
||||
normalizeRelativeURLs(doc, url.toString()) // its links are relative to that page
|
||||
container.replaceChildren(...doc.querySelectorAll("article a.internal"))
|
||||
// the links were added after `nav`: let prefetching and popovers pick them up
|
||||
document.dispatchEvent(new CustomEvent("render", { detail: {} }))
|
||||
})
|
||||
```
|
||||
|
||||
#### Importing Code
|
||||
|
||||
Of course, it isn't always practical (nor desired!) to write your code as a string literal in the component.
|
||||
In community plugins, TypeScript scripts should be transpiled at build time. The plugin template includes an `inlineScriptPlugin` in `tsup.config.ts` that automatically transpiles `.inline.ts` files imported as text:
|
||||
|
||||
Quartz supports importing component code through `.inline.ts` files.
|
||||
```tsx title="src/index.ts"
|
||||
import script from "./script.inline.ts"
|
||||
|
||||
```tsx title="quartz/components/YourComponent.tsx"
|
||||
// @ts-ignore: typescript doesn't know about our inline bundling system
|
||||
// so we need to silence the error
|
||||
import script from "./scripts/graph.inline"
|
||||
|
||||
export default (() => {
|
||||
function YourComponent() {
|
||||
return <button id="btn">Click me</button>
|
||||
}
|
||||
|
||||
YourComponent.afterDOMLoaded = script
|
||||
return YourComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
const Component: QuartzComponent = (props) => {
|
||||
return <button id="btn">Click me</button>
|
||||
}
|
||||
Component.afterDOMLoaded = script
|
||||
```
|
||||
|
||||
```ts title="quartz/components/scripts/graph.inline.ts"
|
||||
// any imports here are bundled for the browser
|
||||
import * as d3 from "d3"
|
||||
The `inlineScriptPlugin` handles transpiling TypeScript to browser-compatible JavaScript during the build step, allowing you to write type-safe client-side code.
|
||||
|
||||
document.getElementById("btn").onclick = () => {
|
||||
alert("button clicked!")
|
||||
### Installing Your Component
|
||||
|
||||
Once your component is published (e.g., to GitHub or npm), users can install it using the Quartz CLI:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:your-username/my-component
|
||||
```
|
||||
|
||||
Then, they can add it to their `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:your-username/my-component
|
||||
enabled: true
|
||||
options:
|
||||
favouriteNumber: 42
|
||||
layout:
|
||||
position: left
|
||||
priority: 60
|
||||
```
|
||||
|
||||
For advanced usage via the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
byPageType: {
|
||||
content: {
|
||||
left: [ExternalPlugin.MyComponent({ favouriteNumber: 42 })],
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Receiving YAML Options in Component-Only Plugins
|
||||
|
||||
Component plugins that also belong to a processing category (transformer, filter, emitter, page type) receive options through their factory function automatically. However, **component-only plugins** — those whose manifest declares only `"category": ["component"]` — are loaded via side-effect import and don't go through the factory path.
|
||||
|
||||
To receive YAML options in a component-only plugin, export an `init` function from your entry point:
|
||||
|
||||
```ts title="src/index.ts"
|
||||
export function init(options?: Record<string, unknown>): void {
|
||||
// options contains merged defaultOptions + user's YAML options
|
||||
const myFlag = (options?.myFlag as boolean) ?? false
|
||||
// Use options to configure registrations, global state, etc.
|
||||
}
|
||||
```
|
||||
|
||||
Additionally, like what is shown in the example above, you can import packages in `.inline.ts` files. This will be bundled by Quartz and included in the actual script.
|
||||
Quartz's config-loader calls `init()` after importing the module, passing the merged result of your manifest's `defaultOptions` and the user's `options` from `quartz.config.yaml`. The merge follows the same `{ ...defaultOptions, ...userOptions }` pattern used for processing plugins — user values take precedence.
|
||||
|
||||
### Using a Component
|
||||
Declare your defaults in `package.json`:
|
||||
|
||||
After creating your custom component, re-export it in `quartz/components/index.ts`:
|
||||
|
||||
```ts title="quartz/components/index.ts" {4,10}
|
||||
import ArticleTitle from "./ArticleTitle"
|
||||
import Content from "./pages/Content"
|
||||
import Darkmode from "./Darkmode"
|
||||
import YourComponent from "./YourComponent"
|
||||
|
||||
export { ArticleTitle, Content, Darkmode, YourComponent }
|
||||
```
|
||||
|
||||
Then, you can use it like any other component in `quartz.layout.ts` via `Component.YourComponent()`. See the [[configuration#Layout|layout]] section for more details.
|
||||
|
||||
As Quartz components are just functions that return React components, you can compositionally use them in other Quartz components.
|
||||
|
||||
```tsx title="quartz/components/AnotherComponent.tsx"
|
||||
import YourComponentConstructor from "./YourComponent"
|
||||
|
||||
export default (() => {
|
||||
const YourComponent = YourComponentConstructor()
|
||||
|
||||
function AnotherComponent(props: QuartzComponentProps) {
|
||||
return (
|
||||
<div>
|
||||
<p>It's nested!</p>
|
||||
<YourComponent {...props} />
|
||||
</div>
|
||||
)
|
||||
```json title="package.json"
|
||||
{
|
||||
"quartz": {
|
||||
"category": ["component"],
|
||||
"defaultOptions": {
|
||||
"myFlag": false
|
||||
}
|
||||
}
|
||||
|
||||
return AnotherComponent
|
||||
}) satisfies QuartzComponentConstructor
|
||||
}
|
||||
```
|
||||
|
||||
If your plugin does not export `init`, it continues to work as a pure side-effect import — this is fully backward compatible.
|
||||
|
||||
## Internal Components
|
||||
|
||||
Quartz also has internal components that provide layout utilities. These live in `quartz/components/` and are primarily used for structural purposes:
|
||||
|
||||
- `Component.Head()` — renders the `<head>` tag
|
||||
- `Component.Spacer()` — adds flexible space
|
||||
- `Component.Flex()` — flexible layout container
|
||||
- `Component.MobileOnly()` — shows component only on mobile
|
||||
- `Component.DesktopOnly()` — shows component only on desktop
|
||||
- `Component.ConditionalRender()` — conditionally renders based on page data
|
||||
|
||||
See [[layout-components]] for more details on these utilities.
|
||||
|
||||
> [!hint]
|
||||
> Look in `quartz/components` for more examples of components in Quartz as reference for your own components!
|
||||
> Look at existing community plugins like [Explorer](https://github.com/quartz-community/explorer) or [Darkmode](https://github.com/quartz-community/darkmode) for real-world examples.
|
||||
@@ -1,3 +1,13 @@
|
||||
---
|
||||
title: "Advanced"
|
||||
---
|
||||
|
||||
This section covers advanced topics for users who want to extend or deeply customize Quartz.
|
||||
|
||||
- **[[architecture]]** — How Quartz works under the hood: the parse, filter, and emit pipeline
|
||||
- **[[making plugins]]** — Build your own transformer, filter, emitter, page type, or component plugin
|
||||
- **[[plugin manifest]]** — Reference for the `quartz` field of a plugin's `package.json`
|
||||
- **[[plugin capabilities]]** — Declare what a plugin provides to and needs from other plugins
|
||||
- **[[creating components]]** — Create custom layout components with JSX
|
||||
- **[[paths]]** — How Quartz resolves and transforms file paths
|
||||
- **[[versioning]]** — Version numbers, plugin compatibility (`quartzVersion`) and releases
|
||||
+772
-123
File diff suppressed because it is too large.
Load diff
+21
-2
@@ -15,7 +15,7 @@ Luckily, we can mimic nominal typing using [brands](https://www.typescriptlang.o
|
||||
type FullSlug = string
|
||||
|
||||
// we do
|
||||
type FullSlug = string & { __brand: "full" }
|
||||
type FullSlug = string & { _brand: "FullSlug" }
|
||||
|
||||
// that way, the following will fail typechecking
|
||||
const slug: FullSlug = "some random string"
|
||||
@@ -25,7 +25,7 @@ While this prevents most typing mistakes _within_ our nominal typing system (e.g
|
||||
|
||||
Thus, we still need to be careful when casting from a string to one of these nominal types in the 'entrypoints', illustrated with hexagon shapes in the diagram below.
|
||||
|
||||
The following diagram draws the relationships between all the path sources, nominal path types, and what functions in `quartz/path.ts` convert between them.
|
||||
The following diagram draws the relationships between all the path sources, nominal path types, and what functions convert between them. In Quartz core they live in `quartz/util/path.ts`; plugins import the same functions from `@quartz-community/utils` (the types `FilePath`, `FullSlug` and `SimpleSlug` from `@quartz-community/types`).
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
@@ -49,3 +49,22 @@ Here are the main types of slugs with a rough description of each type of path:
|
||||
- `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.
|
||||
|
||||
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`.
|
||||
|
||||
## A page's slug
|
||||
|
||||
`slugifyFilePath()` lowercases, replaces spaces with `-` and normalizes Unicode to NFC (so `café.md` written in NFD, as macOS does, gets the same slug). But a page isn't always published at the slug of its file path: a note with a `permalink` in its frontmatter is published at that address instead (see [[built-in processing]]). Always use `file.data.slug` (or `fileData.slug` in components) for a page's address, and `file.data.relativePath` / `filePath` for its file; don't recompute the slug from the path.
|
||||
|
||||
## Links
|
||||
|
||||
To resolve a link the way Quartz does, use `transformLink(src, target, { strategy, allSlugs })`: `src` is the current page's slug, `strategy` is the site's `configuration.links.markdownLinkResolution` (`absolute`, `relative` or `shortest`) and `allSlugs` is `ctx.allSlugs`. It decodes percent-encoding, applies the same slug rules as `slugifyFilePath()` and resolves folder notes. A Markdown link whose path doesn't percent-decode (`[x](%zz)`) is external in Obsidian and in Quartz; check with `linkPathDecodes(link)` before treating a link as internal. `splitAnchor(link)` splits off the `#anchor` and slugs it as a heading anchor.
|
||||
|
||||
## Headings and anchors
|
||||
|
||||
Heading ids follow the GitHub rule (`github-slugger`, as `rehype-slug` and the table of contents use): lowercase, punctuation removed, spaces replaced by `-`, other letters and digits kept. Plugins that give headings ids or link to headings must use the helpers from `@quartz-community/utils`, so ids and anchors match:
|
||||
|
||||
- `slugHeading(text)`: the id of a heading with this text;
|
||||
- `HeadingSlugger`: slugs all headings of one page in order and numbers repeats (`foo`, `foo-1`, …) — create one per page;
|
||||
- `obsidianHeadingAnchor(text)`: the anchor Obsidian writes for a heading (it replaces `:`, `|`, `^`, `#` and `\` with spaces); slug it with `slugHeading` and add it as an extra id when it differs;
|
||||
- `resolveAnchorHref(href, ids)`: points a same-page `#anchor` at an id that exists on the page (an id as written, or a heading's text); a block reference `#^name` always points at the block (`#^name`), never at a heading;
|
||||
- `blockAnchor(name)`: the anchor of the block `^name`, `#^name` (lowercased). Blocks have the id `^name`, so they never share an id with a heading;
|
||||
- `slugTag(tag)`: the slug of a tag, as used for tag pages.
|
||||
@@ -0,0 +1,119 @@
|
||||
---
|
||||
title: Plugin capabilities
|
||||
---
|
||||
|
||||
Quartz plugins cooperate through channels the type system can't see:
|
||||
|
||||
- `file.data` keys (e.g. built-in [[CrawlLinks|link processing]] writes `links`, [[plugins/Backlinks|backlinks]] reads it),
|
||||
- DOM classes queried by client scripts (OFM's mermaid script looks for syntax-highlighting's `.clipboard-button`),
|
||||
- browser globals and document events (`fetchData`, `addCleanup`, `nav`, `themechange`),
|
||||
- emitted files (`static/contentIndex.json`, read by search, explorer and graph),
|
||||
- CSS custom properties.
|
||||
|
||||
When the provider of one of these is disabled, the consumer usually breaks _silently_: an empty backlinks list, wikilinks that 404, or — worst — `draft: true` pages being published because no plugin parsed the frontmatter. **Capabilities** let a plugin declare what it provides and needs, so `quartz build` can say what is wrong:
|
||||
|
||||
```
|
||||
⚠ Plugin "backlinks" requires data "links", but no enabled plugin provides it — enable "configuration.links". (the backlinks list is always empty)
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> Capabilities are opt-in and advisory. Plugins without them behave exactly as before, and an unsatisfied requirement is a warning, never a build failure.
|
||||
|
||||
## Declaring capabilities
|
||||
|
||||
Add `capabilities` to the `quartz` field of your plugin's `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"quartz": {
|
||||
"name": "backlinks",
|
||||
"capabilities": {
|
||||
"provides": {},
|
||||
"requires": {
|
||||
"data": [
|
||||
{
|
||||
"name": "links",
|
||||
"from": "quartz:links",
|
||||
"reason": "the backlinks list is always empty"
|
||||
}
|
||||
]
|
||||
},
|
||||
"optional": {
|
||||
"data": [
|
||||
{
|
||||
"name": "frontmatter",
|
||||
"from": "quartz:frontmatter",
|
||||
"reason": "titles fall back to file names"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Section | Meaning | Unsatisfied → |
|
||||
| ---------- | ------------------------------------------------------------------------- | ---------------------- |
|
||||
| `provides` | What this plugin makes available. Plain strings. | — |
|
||||
| `requires` | Needed for the plugin to work correctly. | build warning |
|
||||
| `optional` | Used when present; the plugin degrades gracefully (you must handle that). | info (not printed yet) |
|
||||
|
||||
Each section maps a **kind** to a list:
|
||||
|
||||
| Kind | Names | Example |
|
||||
| --------- | ------------------------------------------------------------- | ---------------------------- |
|
||||
| `data` | `file.data` / `fileData` keys (vfile `DataMap`) | `"links"` |
|
||||
| `dom` | CSS selector rendered into pages or added by a script | `".clipboard-button"` |
|
||||
| `globals` | browser globals defined by scripts | `"fetchData"` |
|
||||
| `events` | `document` CustomEvents dispatched | `"themechange"` |
|
||||
| `files` | emitted paths relative to the site root (leading `/` ignored) | `"static/contentIndex.json"` |
|
||||
| `cssVars` | CSS custom properties defined | `"--secondary"` |
|
||||
|
||||
A requirement is either a name, or `{ "name", "from"?, "reason"? }`:
|
||||
|
||||
- `from` — plugin name(s) (the manifest `name`, e.g. `"syntax-highlighting"`) known to provide it. It is used for the "enable …" hint, **and** a requirement counts as satisfied whenever a plugin named in `from` is enabled, even if that plugin predates capability declarations. Always set `from` for first-party providers: it keeps new consumers working with old providers. [[built-in processing|Built-ins]] are named `quartz:frontmatter`, `quartz:links`, `quartz:drafts` and `quartz:contentIndex` (the names of the plugins they replaced, `crawl-links`, `remove-draft` and `content-index`, work too).
|
||||
- `reason` — what breaks without it, appended to the warning.
|
||||
|
||||
Names are matched exactly (after trimming). Unknown kinds or malformed entries are ignored and reported, never fatal.
|
||||
|
||||
### Provided by Quartz itself
|
||||
|
||||
These never need a provider plugin (`coreCapabilities()` in `quartz/plugins/loader/capabilities.ts`):
|
||||
|
||||
- data: `slug`, `filePath`, `relativePath`
|
||||
- dom: `#quartz-body`, `.page`, `.center`, `article`, `.popover-hint`, `.sidebar`
|
||||
- globals: `fetchData`, `addCleanup`, `spaNavigate`, `quartzStaticUrl`, `quartzPrefetch` (the last is only set while [[prefetching]] is on)
|
||||
- events: `nav` (always), `prenav` (only with `enableSPA`)
|
||||
|
||||
Note that `fetchData` is a promise for `static/contentIndex.json`, which Quartz emits by default ([[ContentIndex|built-in content index]]). Declare `files: ["static/contentIndex.json"]` if you read it. Since Quartz 5.1, `fetchData` resolves to `{}` (with a console warning) when the file is missing, instead of rejecting.
|
||||
|
||||
## How the check works
|
||||
|
||||
`loadQuartzConfig()` calls `validatePluginCapabilities()` after loading manifests:
|
||||
|
||||
1. Collect `provides` of core and every **enabled** plugin.
|
||||
2. For each enabled plugin with `capabilities`, check each `requires` / `optional` entry. Satisfied if provided, or if a plugin listed in `from` is enabled.
|
||||
3. Only if something is missing, also read the manifests of **disabled** entries in `quartz.config.yaml` to suggest which one to enable.
|
||||
4. Warnings are printed once per process (main thread only).
|
||||
|
||||
The check is static: it cannot see option-dependent behaviour (e.g. `syntax-highlighting` with `clipboard: false` still "provides" `.clipboard-button`) or pipeline order: for that, set [[plugin manifest#defaultOrder|`defaultOrder`]] (and [[plugin manifest#dependencies|`dependencies`]]: a missing dependency or one ordered after your plugin fails the build, a disabled one is a warning).
|
||||
|
||||
## Writing robust consumers
|
||||
|
||||
Declaring a requirement is not a substitute for handling its absence. For `optional` (and ideally `requires`) capabilities:
|
||||
|
||||
- Guard DOM lookups: `const btn = pre.querySelector(".clipboard-button"); if (btn) { … }` — never `getComputedStyle(maybeNull)`.
|
||||
- Default data: `file.data.links ?? []`, `fileData.dates?.created`.
|
||||
- Wrap `await fetchData` in `try`/`catch` and accept an empty object.
|
||||
|
||||
## Built-ins as providers
|
||||
|
||||
Quartz's [[built-in processing]] steps take part in the check like plugins: when enabled, built-in frontmatter provides `frontmatter`, `aliases` and `frontmatterLinks`, built-in links provides `links`, and the built-in content index provides `static/contentIndex.json`. Built-in links also provides the DOM classes `.internal`, `.external` and `.broken`, and the content index `sitemap.xml`. When one is turned off, warnings suggest `configuration.<key>` (a `from: "crawl-links"` or `"quartz:links"` hint is shown as `configuration.links`).
|
||||
|
||||
The same declarations decide replacement: an enabled plugin that `provides` `data: ["frontmatter"]`, `data: ["links"]` or `files: ["static/contentIndex.json"]` replaces the matching built-in. Built-in drafts can't be replaced.
|
||||
|
||||
## Who declares capabilities
|
||||
|
||||
In Quartz 5.1, these first-party plugins declare capabilities: `backlinks`, `description`, `syntax-highlighting`, `obsidian-flavored-markdown` and `search` (and the plugins replaced by built-ins: `note-properties`, `crawl-links`, `remove-draft`, `content-index`). Plugins without declarations are never checked and never cause warnings, so third-party plugins can add them at their own pace.
|
||||
|
||||
Not implemented (yet): printing unsatisfied `optional` requirements, turning warnings into errors, ordering checks between transformers, and option-aware `provides`. The capability types are not exported from `@quartz-community/types`; the schema above is the contract.
|
||||
@@ -0,0 +1,160 @@
|
||||
---
|
||||
title: Plugin manifest
|
||||
---
|
||||
|
||||
The `quartz` field of a plugin's `package.json` is its **manifest**: it tells Quartz what kind of plugin it is, where it runs in the pipeline, which components and frames it ships and what it needs. Quartz reads it from the installed package (`node_modules/<package>/package.json` for npm plugins, `.quartz/plugins/<name>/package.json` for Git and local plugins). See [[making plugins]] for how to write the plugin itself.
|
||||
|
||||
```json title="package.json"
|
||||
{
|
||||
"name": "@you/my-plugin",
|
||||
"version": "1.2.0",
|
||||
"description": "Adds reading times",
|
||||
"exports": {
|
||||
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
|
||||
"./components": {
|
||||
"types": "./dist/components/index.d.ts",
|
||||
"import": "./dist/components/index.js"
|
||||
}
|
||||
},
|
||||
"quartz": {
|
||||
"name": "my-plugin",
|
||||
"displayName": "My Plugin",
|
||||
"category": ["transformer", "component"],
|
||||
"quartzVersion": ">=5.1.0",
|
||||
"defaultOrder": 70,
|
||||
"defaultEnabled": true,
|
||||
"defaultOptions": { "wordsPerMinute": 200 },
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"properties": { "wordsPerMinute": { "type": "number" } },
|
||||
"additionalProperties": false
|
||||
},
|
||||
"components": {
|
||||
"ReadingTime": {
|
||||
"displayName": "Reading time",
|
||||
"description": "Shows how long a page takes to read",
|
||||
"defaultPosition": "beforeBody",
|
||||
"defaultPriority": 40
|
||||
}
|
||||
},
|
||||
"capabilities": {
|
||||
"provides": { "data": ["readingTime"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Default |
|
||||
| ----------------- | -------------------------------------- | ------------------------------- |
|
||||
| `name` | `string` | the package / directory name |
|
||||
| `displayName` | `string` | `name` |
|
||||
| `description` | `string` | the package's `description` |
|
||||
| `category` | category, or an array of categories | detected from the entry module |
|
||||
| `quartzVersion` | semver range | none (works with every version) |
|
||||
| `deprecated` | `string` | none |
|
||||
| `dependencies` | `string[]` (plugin sources) | `[]` |
|
||||
| `defaultOrder` | `number` | `50` |
|
||||
| `defaultEnabled` | `boolean` | `true` |
|
||||
| `defaultOptions` | object | `{}` |
|
||||
| `configSchema` | JSON Schema of the options object | none |
|
||||
| `components` | `{ [exportName]: { displayName, … } }` | none |
|
||||
| `frames` | `{ [exportName]: { exportName } }` | none |
|
||||
| `requiresInstall` | `boolean` | `false` |
|
||||
| `capabilities` | `{ provides?, requires?, optional? }` | none |
|
||||
|
||||
`author` and `homepage` fall back to the package's own fields; the bug-report link Quartz prints when a plugin fails comes from the package's `bugs` or `repository` field.
|
||||
|
||||
### `name`, `displayName`, `description`
|
||||
|
||||
`name` is the short name Quartz uses in error messages and that other plugins name in the `from` of their [[plugin capabilities|capability]] requirements. `displayName` (used in dependency errors) and `description` describe the plugin to people, e.g. in the TUI.
|
||||
|
||||
### Version
|
||||
|
||||
Quartz uses the package's `version`. A `quartz.version` field (the plugin template used to ship one) is only used when the package has no `version`, so you don't need to keep it in sync.
|
||||
|
||||
### `category`
|
||||
|
||||
One of `"transformer"`, `"filter"`, `"emitter"`, `"pageType"` or `"component"`, or an array for a plugin that is several things at once (e.g. `["transformer", "component"]`). For each processing category (everything except `component`), Quartz looks for the plugin's factory in the entry module (`.`): the `default` export, else a `plugin` export, else the only exported function, else the exported function that returns an instance with that category's methods when called without options. A plugin with several processing categories should therefore not have a `default` export, since Quartz would use it for every category.
|
||||
|
||||
A plugin whose categories are all `"component"` is loaded differently: Quartz imports its entry module for its side effects, calls its `init(options)` export if there is one (see [[creating components#Receiving YAML Options in Component-Only Plugins|receiving YAML options]]) and loads its components.
|
||||
|
||||
Without a `category`, Quartz tries to detect it from the entry module; if it can't and the plugin declares no components, the plugin is skipped with an error. Set it.
|
||||
|
||||
### `quartzVersion`
|
||||
|
||||
The Quartz versions the plugin works with, as a semver range (`">=5.1.0"`). Locally a mismatch is a warning; in CI the build fails. See [[versioning#For plugin authors]].
|
||||
|
||||
### `deprecated`
|
||||
|
||||
A message saying why the plugin is deprecated and what replaces it. Quartz 5.1+ warns while the plugin is enabled (during the build, in `plugin add` and in `plugin doctor`); the plugin keeps working.
|
||||
|
||||
### `dependencies`
|
||||
|
||||
Other plugins that must run for this one to work, as plugin sources. Each one is matched **exactly** against the `source` of the entries in `quartz.config.yaml`: `"@quartz-community/foo"` doesn't match an entry `github:quartz-community/foo`, so use the form the default config uses (the npm package name for official plugins). The build **fails** when a dependency isn't in the config at all, when it runs later than the plugin (its order is higher), or when dependencies form a cycle. A dependency that is in the config but disabled is a warning.
|
||||
|
||||
Don't declare `crawl-links`, `remove-draft` or `content-index`: they are [[built-in processing]] since Quartz 5.1, which treats such a dependency as satisfied by the built-in, but Quartz 5.0 fails the build when the plugin is not in the config. Declare what you need from them as [[plugin capabilities|capabilities]] instead (`requires: { data: ["links"] }`), and order your plugin after them with `defaultOrder`.
|
||||
|
||||
### `defaultOrder`
|
||||
|
||||
Where the plugin runs among plugins of the same category, lower first, when the user's config entry sets no `order`. Built-ins take part in the same scale (on equal order a built-in runs first). For transformers:
|
||||
|
||||
| Order | Transformer |
|
||||
| ----- | ---------------------------------------------- |
|
||||
| 0 | built-in frontmatter (`file.data.frontmatter`) |
|
||||
| 10 | `created-modified-date` |
|
||||
| 20 | `syntax-highlighting` |
|
||||
| 30 | `github-flavored-markdown` |
|
||||
| 40 | `obsidian-flavored-markdown` |
|
||||
| 50 | default |
|
||||
| 60 | built-in links (`file.data.links`) |
|
||||
| 70 | `description` |
|
||||
|
||||
A transformer that reads `file.data.links` must do so in `htmlPlugins` (it isn't set yet while `markdownPlugins` run) and have an order above 60. Filters and emitters run in order too (the built-in drafts filter and content index emitter are at 50), although emitters run in parallel.
|
||||
|
||||
### `defaultEnabled`, `defaultOptions`
|
||||
|
||||
`npx quartz plugin add` writes the plugin's entry with `enabled: defaultEnabled`, `order: defaultOrder` and `options: defaultOptions`, so a later change to `defaultOrder` only reaches entries without an `order`. When Quartz loads the plugin, it merges the options as `{ ...defaultOptions, ...options from quartz.config.yaml, ...options from quartz.ts }` and passes the result to the factory (or to `init`).
|
||||
|
||||
### `configSchema`
|
||||
|
||||
A JSON Schema for the options object. Quartz warns about likely mistakes in a plugin's `options` when it loads the config and in `npx quartz plugin doctor`:
|
||||
|
||||
- an option name that looks like a typo of a known one (`did you mean …?`), or any unknown option when the schema sets `"additionalProperties": false`;
|
||||
- a value of the wrong type (`properties.<name>.type`, with `"integer"` counted as a number);
|
||||
- a value not in `properties.<name>.enum`.
|
||||
|
||||
Options are known from `properties` and from the keys of `defaultOptions`; without a schema, types are inferred from `defaultOptions`, and a value of the same type as an option's default is always accepted.
|
||||
|
||||
First-party plugins declare their options as `optionSchema` instead, a flat map of option name to type that [Quartz Syncer](https://github.com/saberzero1/quartz-syncer) also uses for its settings. Quartz reads it the same way, with `"enum"` plus `values` for a choice:
|
||||
|
||||
```json title="package.json"
|
||||
"optionSchema": {
|
||||
"limit": { "type": "number", "description": "How many notes to list" },
|
||||
"mode": { "type": "enum", "values": ["light", "dark"] },
|
||||
"showTags": { "type": "boolean" }
|
||||
}
|
||||
```
|
||||
|
||||
### `components`
|
||||
|
||||
The components the plugin provides, keyed by export name. Quartz imports them from the package's **`./components`** export (not the entry module) and registers each name it finds there; a name missing from `./components` is reported as a warning. Each entry can set:
|
||||
|
||||
- `displayName`, `description`: describe the component, e.g. in the TUI;
|
||||
- `defaultPosition`: the layout slot used when the user's `layout:` block has no `position` (`header`, `left`, `right`, `beforeBody`, `afterBody` or `footer`). Without either, the component isn't placed;
|
||||
- `defaultPriority`: the order within that slot when the user sets none (default 50, lower first).
|
||||
|
||||
See [[creating components]].
|
||||
|
||||
### `frames`
|
||||
|
||||
[[layout#Page Frames|Page frames]] the plugin provides, keyed by export name, loaded from the package's `./frames` export. See [[making plugins#Providing Custom Frames]].
|
||||
|
||||
### `requiresInstall`
|
||||
|
||||
Set it when the plugin needs native packages that can't be bundled (e.g. `sharp`). Quartz then installs the plugin's `peerDependencies` (except the packages it shares with plugins, like Preact) into the site when it installs the plugin from Git. See [[making plugins#Plugins with Native Dependencies]].
|
||||
|
||||
### `capabilities`
|
||||
|
||||
What the plugin provides to and needs from other plugins (`file.data` keys, DOM classes, globals, events, files, CSS variables), so Quartz can warn when a provider is missing. See [[plugin capabilities]].
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Versioning and releases
|
||||
description: What Quartz's version number means, how plugins declare the Quartz versions they support, and how releases are made.
|
||||
---
|
||||
|
||||
Quartz follows [semantic versioning](https://semver.org): `MAJOR.MINOR.PATCH`.
|
||||
|
||||
- **patch** (5.1.**1**) — bug fixes.
|
||||
- **minor** (5.**2**.0) — new features and new APIs for plugins. Existing sites and plugins keep working.
|
||||
- **major** (**6**.0.0) — breaking changes, with an upgrade guide.
|
||||
|
||||
Each release is a git tag (`v5.1.0`) with a [GitHub release](https://github.com/jackyzha0/quartz/releases) listing the changes, also in `CHANGELOG.md`. Quartz itself is not published to npm — your site is a clone of the repository, so its version is the one in `package.json`.
|
||||
|
||||
## Which version am I on?
|
||||
|
||||
```shell
|
||||
npx quartz info
|
||||
```
|
||||
|
||||
prints the version, where your checkout is relative to the last release, your environment and your plugins as a block you can paste into an issue or support question. The version shows as e.g. `5.1.0 (v5.1.0-4-g1a2b3c4-dirty)`: 4 commits after the `v5.1.0` release, at commit `1a2b3c4`, with local changes. `npx quartz build` and `npx quartz plugin doctor` print it too.
|
||||
|
||||
When asking for help, please include this output — a version number is much more useful than a commit hash of your fork.
|
||||
|
||||
## Plugin compatibility
|
||||
|
||||
Plugins declare the Quartz versions they work with in their `package.json`:
|
||||
|
||||
```json title="package.json"
|
||||
{
|
||||
"quartz": {
|
||||
"quartzVersion": ">=5.1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Any [npm semver range](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#dependencies) works (`>=5.1.0`, `^5.1.0`, `>=5.1.0 <7`). Quartz checks it
|
||||
|
||||
- when the build loads your config: locally a warning (repeated in the end-of-build summary); in CI (when the `CI` environment variable is set, as on GitHub Actions, GitLab CI, Netlify, Vercel or Cloudflare Pages) the build fails, so an incompatible plugin doesn't get deployed. Set `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1` to build anyway,
|
||||
- in `npx quartz plugin add` and `npx quartz plugin doctor` (an error for enabled plugins),
|
||||
|
||||
and says whether to update Quartz (`npx quartz upgrade`) or the plugin. If an incompatible plugin later fails, the error message mentions the version mismatch as a likely cause.
|
||||
|
||||
### For plugin authors
|
||||
|
||||
- Set `quartzVersion` to the **oldest Quartz version your plugin works with**. Raise it when you start using a newer API — for example a plugin that relies on [[built-in processing]] (core-parsed frontmatter, `ctx.contentIndex`, `extendContentIndex`), an async page type `generate`, `virtualPageHtmlPlugins`, `assets` or `window.quartzStaticUrl` needs `">=5.1.0"`; one that relies on `renderTransforms` needs `">=5.2.0"` (or treats the hook as optional, as Quartz 5.1 never calls it). The [plugin template](https://github.com/quartz-community/plugin-template) starts with `">=5.0.0"`.
|
||||
- Prefer a lower bound (`>=5.1.0`) over a caret range: minor Quartz releases don't break plugins, so `^5` would only add an upper bound you'd have to bump at every major release. Add an upper bound when you know a major version breaks you.
|
||||
- Raising `quartzVersion` is a breaking change for users on older Quartz versions: release it as a new major (or at least minor) version of your plugin and say so in its changelog.
|
||||
- Pre-releases count: Quartz `5.2.0-beta.1` satisfies `>=5.1.0`.
|
||||
- To retire a plugin, set `quartz.deprecated` in its `package.json` to a message saying what replaces it (for example `"Line breaks are handled by ObsidianFlavoredMarkdown 2.0+ …"`). Quartz 5.1+ warns when the plugin is enabled (in the build summary, `plugin add` and `plugin doctor`) and suggests removing it; the plugin keeps working.
|
||||
|
||||
## Contributing: changesets
|
||||
|
||||
Quartz uses [changesets](https://github.com/changesets/changesets). A pull request that changes how Quartz behaves should include one:
|
||||
|
||||
```shell
|
||||
npx changeset
|
||||
```
|
||||
|
||||
Choose `patch`, `minor` or `major` and describe the change for users. On every push to `v5` a "chore: release Quartz" pull request collects the pending changesets, bumps `package.json` and updates `CHANGELOG.md`; merging it tags the release and publishes the GitHub release notes. CI warns (without failing) when a pull request has no changeset.
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
title: Authoring Content
|
||||
---
|
||||
|
||||
All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've [[index#🪴 Get Started|setup Quartz]] already, this folder should already be initialized. Any Markdown in this folder will get processed by Quartz.
|
||||
|
||||
It is recommended that you use [Obsidian](https://obsidian.md/) as a way to edit and maintain your Quartz. It comes with a nice editor and graphical interface to preview, edit, and link your local files and attachments.
|
||||
|
||||
Got everything setup? Let's [[build]] and preview your Quartz locally!
|
||||
|
||||
## Syntax
|
||||
|
||||
As Quartz uses Markdown files as the main way of writing content, it fully supports Markdown syntax. By default, Quartz also ships with a few syntax extensions like [Github Flavored Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) (footnotes, strikethrough, tables, tasklists) and [Obsidian Flavored Markdown](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown) ([[callouts]], [[wikilinks]]).
|
||||
|
||||
Additionally, Quartz also allows you to specify additional metadata in your notes called **frontmatter**.
|
||||
|
||||
```md title="content/note.md"
|
||||
---
|
||||
title: Example Title
|
||||
draft: false
|
||||
tags:
|
||||
- example-tag
|
||||
---
|
||||
|
||||
The rest of your content lives here. You can use **Markdown** here :)
|
||||
```
|
||||
|
||||
Some common frontmatter fields that are natively supported by Quartz:
|
||||
|
||||
- `title`: Title of the page. If it isn't provided, Quartz will use the name of the file as the title.
|
||||
- `description`: Description of the page used for link previews.
|
||||
- `permalink`: A custom URL for the page that will remain constant even if the path to the file changes.
|
||||
- `aliases`: Other names for this note. This is a list of strings.
|
||||
- `tags`: Tags for this note.
|
||||
- `draft`: Whether to publish the page or not. This is one way to make [[private pages|pages private]] in Quartz.
|
||||
- `date`: A string representing the day the note was published. Normally uses `YYYY-MM-DD` format.
|
||||
|
||||
See [[Frontmatter]] for a complete list of frontmatter.
|
||||
|
||||
## 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`.
|
||||
|
||||
## Customization
|
||||
|
||||
Frontmatter parsing for `title`, `tags`, `aliases` and `cssclasses` is a functionality of the [[Frontmatter]] plugin, `date` is handled by the [[CreatedModifiedDate]] plugin and `description` by the [[Description]] plugin. See the plugin pages for customization options.
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: "Building your Quartz"
|
||||
---
|
||||
|
||||
Once you've [[index#🪴 Get Started|initialized]] Quartz, let's see what it looks like locally:
|
||||
|
||||
```bash
|
||||
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`.
|
||||
>
|
||||
> Most of these have sensible defaults but you can override them if you have a custom setup:
|
||||
>
|
||||
> - `-d` or `--directory`: the content folder. This is normally just `content`
|
||||
> - `-v` or `--verbose`: print out extra logging information
|
||||
> - `-o` or `--output`: the output folder. This is normally just `public`
|
||||
> - `--serve`: run a local hot-reloading server to preview your Quartz
|
||||
> - `--port`: what port to run the local preview server on
|
||||
> - `--concurrency`: how many threads to use to parse notes
|
||||
|
||||
> [!warning] Not to be used for production
|
||||
> Serve mode is intended for local previews only.
|
||||
> For production workloads, see the page on [[hosting]].
|
||||
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: quartz build
|
||||
aliases:
|
||||
- build
|
||||
---
|
||||
|
||||
The `build` command transforms your Markdown content into a static HTML website. It processes your files through the configured plugins and outputs the final site to a directory of your choice.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Shorthand | Description | Default |
|
||||
| ----------------- | --------- | ---------------------------------------------------------------------------------- | ------------------ |
|
||||
| `--directory` | `-d` | The content folder | `content` |
|
||||
| `--config` | `-C` | Path to the config file to load (see [[#Custom config file]]) | quartz.config.yaml |
|
||||
| `--verbose` | `-v` | Print detailed build information (see [[#Verbose output]]) | `false` |
|
||||
| `--output` | `-o` | The directory where the built site will be saved | `public` |
|
||||
| `--serve` | | Start a local development server | `false` |
|
||||
| `--watch` | | Rebuild the site when files change | `false` |
|
||||
| `--port` | | The port for the development server | `8080` |
|
||||
| `--wsPort` | | The port for the WebSocket hot-reload server | `3001` |
|
||||
| `--baseDir` | | Base path the development server serves the site under | `""` (none) |
|
||||
| `--remoteDevHost` | | Hostname for the hot-reload WebSocket when not developing on localhost | `""` (`localhost`) |
|
||||
| `--bundleInfo` | | Print an analysis of Quartz's own esbuild bundle (files and sizes) to the terminal | `false` |
|
||||
| `--concurrency` | `-c` | Number of worker threads to use for building | CPU core count |
|
||||
|
||||
## Examples
|
||||
|
||||
### Basic Build
|
||||
|
||||
Generate your site into the `public` folder.
|
||||
|
||||
```shell
|
||||
npx quartz build
|
||||
```
|
||||
|
||||
### Development Mode
|
||||
|
||||
Start a local server and watch for changes. This is the most common way to preview your site while writing.
|
||||
|
||||
```shell
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
### Custom Output and Port
|
||||
|
||||
Build to a specific folder and run the server on a different port.
|
||||
|
||||
```shell
|
||||
npx quartz build --serve --output dist --port 3000
|
||||
```
|
||||
|
||||
### Performance Tuning
|
||||
|
||||
If you have a very large vault, you can limit the number of concurrent workers to save memory.
|
||||
|
||||
```shell
|
||||
npx quartz build --concurrency 2
|
||||
```
|
||||
|
||||
### Custom config file
|
||||
|
||||
By default Quartz loads `quartz.config.yaml` from the current working directory. Use `--config` (or `-C`) to point at a config file elsewhere — for example when the config lives alongside your content rather than inside the Quartz install.
|
||||
|
||||
```shell
|
||||
npx quartz build --config ../my-vault/quartz.config.yaml
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> The shorthand for `--config` is an uppercase `-C`. A lowercase `-c` is the shorthand for `--concurrency`, so the two are distinct.
|
||||
|
||||
### Verbose output
|
||||
|
||||
`npx quartz build --verbose` also prints:
|
||||
|
||||
- the plugins loaded, in the order they run (transformers, filters, emitters, page types)
|
||||
- the [[built-in processing|built-ins]] and whether each is on (with its order) or off, and why
|
||||
- a layout report: which components each page type renders in each slot (see [[layout#Checking your layout]])
|
||||
- every link to a page that is not on the site (including links to drafts) — without `--verbose` the end-of-build summary counts them and shows a few examples
|
||||
- every file each emitter writes
|
||||
|
||||
### In CI
|
||||
|
||||
When the `CI` environment variable is set (GitHub Actions, Cloudflare Pages, Netlify, Vercel, … set it), the build fails on plugins that fail to load or that need a newer Quartz, instead of warning. Set `QUARTZ_ALLOW_BROKEN_PLUGINS=1` or `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1` to build anyway. See [[troubleshooting#Reading build output]].
|
||||
|
||||
## Serve vs Watch
|
||||
|
||||
The `--serve` and `--watch` flags control different behaviors:
|
||||
|
||||
- **`--serve`** starts a local development server AND automatically watches for changes (implies `--watch`). This is the recommended mode for local development.
|
||||
- **`--watch`** only watches for file changes and rebuilds automatically, without starting a server. This is useful for CI pipelines or custom server setups where you want automatic rebuilds but handle serving separately.
|
||||
|
||||
In most cases, you want `--serve`:
|
||||
|
||||
```shell
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
The `--serve` flag starts a local web server. This server is intended for development and previewing only. It is not designed for production use. For information on how to deploy your site, see [[hosting]].
|
||||
|
||||
### Hot Reloading
|
||||
|
||||
When running with `--serve`, Quartz automatically enables `--watch`. It uses a WebSocket connection (on the port specified by `--wsPort`) to notify your browser when a file has changed. The browser will then automatically refresh to show the latest version of your content.
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
title: quartz create
|
||||
---
|
||||
|
||||
The `create` command initializes a new Quartz project. It helps you set up your content folder, choose a configuration template, set your site's base URL, and configure how Quartz should handle your Markdown files.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Shorthand | Description |
|
||||
| ------------- | --------- | -------------------------------------------------------------------------- |
|
||||
| `--template` | `-t` | Configuration template (`default`, `obsidian`, `ttrpg`, `blog`, or `docs`) |
|
||||
| `--directory` | `-d` | The content folder to set up (default: `content`) |
|
||||
| `--source` | `-s` | The source directory of your Markdown files |
|
||||
| `--strategy` | `-X` | How to handle the source files (`new`, `copy`, or `symlink`) |
|
||||
| `--links` | `-l` | How to resolve internal links (`absolute`, `shortest`, or `relative`) |
|
||||
| `--baseUrl` | `-b` | Base URL for your site (e.g. `mysite.github.io/quartz`) |
|
||||
| `--verbose` | `-v` | Enable detailed logging |
|
||||
|
||||
## Templates
|
||||
|
||||
When you run `quartz create`, you can choose a configuration template that pre-configures Quartz for your use case. The selected template always overwrites `quartz.config.yaml`, even if one already exists. After applying the template, Quartz automatically runs plugin resolution to install any plugins the template requires and remove any that are no longer referenced.
|
||||
|
||||
- **Default**: A clean Quartz setup with sensible defaults. Best for starting from scratch.
|
||||
- **Obsidian**: Optimized for Obsidian vaults with full Obsidian Flavored Markdown support (wikilinks, callouts, mermaid diagrams, etc.). Automatically sets link resolution to `shortest` and skips the link resolution prompt.
|
||||
- **TTRPG**: Builds on the Obsidian template with the addition of the [Leaflet bases plugin](https://github.com/Requiae/quartz-leaflet-bases-plugin) and [ITS Theme](https://github.com/saberzero1/quartz-themes) (`its-theme.ttrpg-dnd`). Great for D&D and TTRPG wikis. Also skips the link resolution prompt.
|
||||
- **Blog**: A blog-focused setup with [recent notes](https://github.com/quartz-community/recent-notes) enabled (showing the 5 most recent posts with tags) and [comments](https://github.com/quartz-community/comments) enabled via giscus. You'll need to fill in the `TODO:` placeholder values in `quartz.config.yaml` with your own giscus repository details.
|
||||
- **Documentation**: The default setup with both sidebars set to scroll away with the page ([[layout#Sidebar modes|`layout.sidebars`]]: `static`), so long navigation and tables of contents are never cut off.
|
||||
|
||||
## Base URL
|
||||
|
||||
During setup, Quartz will ask for the base URL of your site. This is the URL where your site will be deployed (e.g. `mysite.github.io/quartz`).
|
||||
|
||||
- Do **not** include the protocol (`https://`) — if you do, it will be automatically stripped.
|
||||
- Trailing slashes are also removed automatically.
|
||||
- See [[configuration]] for more details on how `baseUrl` is used.
|
||||
|
||||
## Strategies
|
||||
|
||||
When you run `quartz create`, you must choose a strategy for your content:
|
||||
|
||||
- **new**: Creates a fresh, empty content folder. Use this if you are starting a new project from scratch.
|
||||
- **copy**: Copies all files from your source directory into the Quartz content folder. This is the safest option for existing vaults as it doesn't touch your original files.
|
||||
- **symlink**: Creates a symbolic link from the Quartz content folder to your source directory. Any changes you make in your source directory (e.g. in Obsidian) will be immediately reflected in Quartz.
|
||||
|
||||
## Link Resolution
|
||||
|
||||
Quartz needs to know how to interpret the internal links in your Markdown files:
|
||||
|
||||
- **shortest**: Resolves links to the closest matching file name. This is the default for Obsidian.
|
||||
- **absolute**: Resolves links relative to the root of your content folder.
|
||||
- **relative**: Resolves links relative to the current file's location.
|
||||
|
||||
> [!note]
|
||||
> When using the **Obsidian** or **TTRPG** templates, link resolution is automatically set to `shortest` and the prompt is skipped.
|
||||
|
||||
## Interactive Walkthrough
|
||||
|
||||
If you run `npx quartz create` without any arguments, it will guide you through an interactive setup:
|
||||
|
||||
1. **Choose a template**: Select a configuration template (`Default`, `Obsidian`, `TTRPG`, `Blog`, or `Documentation`).
|
||||
2. **Select a strategy**: Choose between `new`, `copy`, or `symlink`.
|
||||
3. **Enter base URL**: Provide the URL where your site will be hosted.
|
||||
4. **Select link resolution**: Choose how your links are formatted (skipped for Obsidian and TTRPG templates).
|
||||
5. **Finish**: Quartz will set up the directory structure, create your configuration, and automatically install any plugins referenced in the template.
|
||||
|
||||
## Example: Importing an Obsidian Vault
|
||||
|
||||
To create a Quartz project that links directly to an existing Obsidian vault:
|
||||
|
||||
```shell
|
||||
npx quartz create --template obsidian --strategy symlink --source ~/Documents/MyVault
|
||||
```
|
||||
|
||||
This command tells Quartz to use the Obsidian template (with full OFM support and shortest link resolution), look at your vault in `~/Documents/MyVault`, and use symbolic links so changes are synced.
|
||||
|
||||
## Example: Setting Up a Blog
|
||||
|
||||
To quickly set up a blog with recent notes and comments:
|
||||
|
||||
```shell
|
||||
npx quartz create --template blog --strategy new --baseUrl myblog.github.io
|
||||
```
|
||||
|
||||
After setup, edit `quartz.config.yaml` to fill in your giscus repository details in the comments plugin section.
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: CLI Reference
|
||||
---
|
||||
|
||||
The Quartz CLI is the primary way to interact with your Quartz project. It provides commands for creating new projects, building static sites, syncing with GitHub, and managing plugins.
|
||||
|
||||
You can run the CLI using `npx quartz`.
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Command | Description | Example |
|
||||
| --------- | ------------------------------------------------------- | ------------------------ |
|
||||
| `create` | Initialize a new Quartz project with template selection | `npx quartz create` |
|
||||
| `build` | Generate static HTML files | `npx quartz build` |
|
||||
| `sync` | Sync content with GitHub | `npx quartz sync` |
|
||||
| `upgrade` | Upgrade Quartz to the latest version (alias: `update`) | `npx quartz upgrade` |
|
||||
| `plugin` | Manage Quartz plugins (install, add, remove, etc.) | `npx quartz plugin list` |
|
||||
| `tui` | Launch the interactive plugin manager | `npx quartz tui` |
|
||||
| `info` | Print version, environment and plugins for bug reports | `npx quartz info` |
|
||||
|
||||
## Commands
|
||||
|
||||
- [[create|create]]: Initialize a new Quartz project with a choice of templates (default, obsidian, ttrpg, blog, docs) and base URL configuration.
|
||||
- [[build|build]]: Build your Quartz site into static HTML. Includes a development server.
|
||||
- [[sync|sync]]: Push and pull changes between your local machine and GitHub.
|
||||
- [[upgrade|upgrade]]: Upgrade the Quartz framework to the latest version. Also available as `npx quartz update`.
|
||||
- [[restore|restore]]: Recover your content folder from the local cache.
|
||||
- [[cli/plugin|plugin]]: Install, add, remove, prune, and configure plugins. Use `plugin install` with flags for lockfile/config sync, updates, and checks, and `plugin doctor` to diagnose plugin problems.
|
||||
- [[tui|tui]]: Use a terminal interface to manage plugins and layout.
|
||||
- `info`: Print your Quartz version (with its git state), Node/npm/OS, the config file, built-ins and every plugin with its version, source and compatibility, as a Markdown block to paste into bug reports. See [[versioning]].
|
||||
|
||||
## Global Flags
|
||||
|
||||
These flags are accepted by every Quartz command:
|
||||
|
||||
| Flag | Shorthand | Description | Default |
|
||||
| --------------- | --------- | ------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| `--directory` | `-d` | The content folder (relative to your Quartz project) | `content` |
|
||||
| `--verbose` | `-v` | Enable detailed logging for debugging | `false` |
|
||||
| `--concurrency` | `-c` | Max parallel workers for operations that run in parallel (e.g. `build`, `plugin install`, `plugin add`) | CPU core count |
|
||||
|
||||
Commands that don't perform parallel work accept `-c` as a no-op, so it's always safe to pass. See [[build#Performance Tuning|build]] and [[cli/plugin#Installing on low-end hardware|plugin]] for practical examples.
|
||||
|
||||
## Help and Versioning
|
||||
|
||||
To see a full list of available flags for any command, use the `--help` flag.
|
||||
|
||||
```shell
|
||||
npx quartz --help
|
||||
npx quartz build --help
|
||||
```
|
||||
|
||||
To check which version of Quartz you are currently running, use the `--version` flag.
|
||||
|
||||
```shell
|
||||
npx quartz --version
|
||||
```
|
||||
@@ -0,0 +1,351 @@
|
||||
---
|
||||
title: quartz plugin
|
||||
---
|
||||
|
||||
The `plugin` command is the heart of the Quartz v5 plugin management system. it allows you to install, configure, and update plugins directly from the command line.
|
||||
|
||||
Quartz plugins come from two kinds of sources:
|
||||
|
||||
- **npm packages** (`@quartz-community/explorer`) — the default plugins. They are installed into `node_modules/` by `npm install` / `npm ci` and versioned by `package.json` and `package-lock.json`.
|
||||
- **Git repositories and local directories** (`github:owner/repo`, `./my-plugin`) — cloned or symlinked into `.quartz/plugins/`. Their exact commits are pinned in `quartz.lock.json`.
|
||||
|
||||
Wherever a command takes a plugin name you can use the full name (`@quartz-community/explorer`), the source as written in `quartz.config.yaml`, or the short name (`explorer`). Misspelled names get a "did you mean" suggestion.
|
||||
|
||||
Every subcommand exits with a non-zero status when something fails (a clone, a build, an unknown plugin name), so `npx quartz plugin install && npx quartz build` stops in CI instead of building a site with missing plugins.
|
||||
|
||||
## Subcommands
|
||||
|
||||
### list
|
||||
|
||||
List all configured plugins: Git/local plugins with their pinned commit, npm plugins with their installed version, and any plugins that are in `quartz.config.yaml` but not installed yet.
|
||||
|
||||
```shell
|
||||
npx quartz plugin list
|
||||
```
|
||||
|
||||
### add
|
||||
|
||||
Add a new plugin from npm or a Git repository. The plugin is installed (Git plugins are pinned in `quartz.lock.json`, npm packages recorded in `package.json`), and added to `quartz.config.yaml` with its default options — enabled unless the plugin is disabled by default.
|
||||
|
||||
```shell
|
||||
npx quartz plugin add @quartz-community/graph # an npm package, as the default config uses
|
||||
npx quartz plugin add github:username/repo
|
||||
npx quartz plugin add username/repo # same as github:username/repo
|
||||
```
|
||||
|
||||
To install from a specific branch or ref, append `#ref` to the source:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:username/repo#my-branch
|
||||
npx quartz plugin add git+https://github.com/username/repo.git#my-branch
|
||||
npx quartz plugin add https://github.com/username/repo.git#my-branch
|
||||
```
|
||||
|
||||
You can also add a plugin from a local directory. This is useful for local development or airgapped environments:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add ./path/to/my-plugin
|
||||
npx quartz plugin add ../sibling-plugin
|
||||
npx quartz plugin add /absolute/path/to/plugin
|
||||
```
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`, so any changes you make to the source directory are reflected immediately without re-installing.
|
||||
|
||||
When a branch is specified, it is stored in the lockfile. All subsequent commands (`install`, `prune`) will respect that branch automatically. Use `install --latest` to fetch the latest commit from that branch.
|
||||
|
||||
`plugin add` will not create duplicate entries: if a plugin with the same name is already configured (for example `@quartz-community/graph` when you add `github:someone/graph`), it is skipped with a hint. Remove the existing plugin first, or use `--as <name>` to install the second one under a different name. If the plugin is already present in `.quartz/plugins/` but missing from the config (e.g. after you deleted its entry by hand), `add` adds it back to the config without re-cloning.
|
||||
|
||||
> [!tip]
|
||||
> `plugin add` also accepts `--concurrency` / `-c` to limit how many remote repositories are cloned and built at the same time. This is the same flag documented under [[#install]] and is useful when adding several plugins at once on low-end hardware.
|
||||
|
||||
### remove
|
||||
|
||||
Remove a plugin: deletes its entry from `quartz.config.yaml`, and for Git/local plugins also its directory in `.quartz/plugins/` and its lockfile entry.
|
||||
|
||||
```shell
|
||||
npx quartz plugin remove plugin-name
|
||||
npx quartz plugin remove explorer # short name of @quartz-community/explorer
|
||||
```
|
||||
|
||||
For npm plugins the package stays in `node_modules/` (most of them ship with Quartz). If another configured plugin declares a dependency on the one you removed, a warning tells you so.
|
||||
|
||||
### install
|
||||
|
||||
Install plugins for your Quartz project. By default, this installs all plugins listed in your `quartz.lock.json` file, at exactly the pinned commits (including plugins installed from a repository subdirectory).
|
||||
|
||||
```shell
|
||||
npx quartz plugin install
|
||||
```
|
||||
|
||||
If there is no `quartz.lock.json` yet, `install` falls back to installing the Git/local plugins from `quartz.config.yaml` and writes the lockfile — commit it to pin those versions. If only npm plugins are configured there is nothing to do and the command says so. When `quartz.config.yaml` lists Git plugins that are missing from the lockfile, `install` prints them with a hint to run `install --from-config`.
|
||||
|
||||
> [!note]
|
||||
> `npx quartz build` also installs any configured Git plugin that is missing from `.quartz/plugins/`, and checks out the commit pinned in `quartz.lock.json` when there is one. Running `plugin install` first is still recommended in CI, because it fails loudly when a plugin cannot be installed.
|
||||
|
||||
#### Flags
|
||||
|
||||
- `--from-config`: Synchronize plugins with `quartz.config.yaml` instead of the lockfile. This will install missing plugins and prune orphaned ones.
|
||||
- `--latest`: Fetch the latest version of plugins from their remote sources instead of using the version in the lockfile.
|
||||
- `--clean`: Only restore plugins whose directory is missing; existing directories are left untouched.
|
||||
- `--dry-run`: Preview the changes without actually installing or removing any files.
|
||||
- `--concurrency`, `-c`: Maximum number of plugins to clone, fetch, and build in parallel. Defaults to the number of CPU cores. Lower this (e.g. `-c 1` or `-c 2`) on memory- or CPU-constrained machines where the default parallelism causes failures, OOMs, or hangs. See [[#Installing on low-end hardware]] below.
|
||||
|
||||
#### Positional Arguments
|
||||
|
||||
- `[names..]`: Optional list of specific plugin names to install or update.
|
||||
|
||||
```shell
|
||||
# Update specific plugins to latest
|
||||
npx quartz plugin install --latest plugin-a plugin-b
|
||||
|
||||
# Preview what would be installed from config
|
||||
npx quartz plugin install --from-config --dry-run
|
||||
```
|
||||
|
||||
### enable / disable
|
||||
|
||||
Toggle a plugin's status in your `quartz.config.yaml` without removing its files.
|
||||
|
||||
```shell
|
||||
npx quartz plugin enable plugin-name
|
||||
npx quartz plugin disable plugin-name
|
||||
```
|
||||
|
||||
The CLI edits `quartz.config.yaml` in place: your comments, quoting and key order are preserved, and the file is only rewritten when something actually changed.
|
||||
|
||||
### config
|
||||
|
||||
View or modify the options of a specific plugin.
|
||||
|
||||
```shell
|
||||
# View the options you set, plus the plugin defaults you have not overridden
|
||||
npx quartz plugin config explorer
|
||||
|
||||
# Set values (repeatable; values are parsed as JSON when possible)
|
||||
npx quartz plugin config explorer --set folderDefaultState=open --set useSavedState=false
|
||||
|
||||
# Nested option keys use dots
|
||||
npx quartz plugin config graph --set localGraph.depth=2
|
||||
|
||||
# Remove an option so the plugin default applies again
|
||||
npx quartz plugin config explorer --unset folderDefaultState
|
||||
```
|
||||
|
||||
Options are checked against the plugin's documented defaults (the `defaultOptions` and optional `configSchema` in its manifest). A likely typo or a value of the wrong type prints a warning, for example:
|
||||
|
||||
```
|
||||
⚠ @quartz-community/explorer: unknown option "folderDefaultStat" — did you mean "folderDefaultState"?
|
||||
⚠ @quartz-community/explorer: option "useSavedState" should be a boolean (default: true), got string "yes"
|
||||
```
|
||||
|
||||
The same warnings are printed at the start of `npx quartz build`, along with misspelled entry keys such as `enable:` instead of `enabled:`. They never stop the build.
|
||||
|
||||
### doctor
|
||||
|
||||
Check your plugin setup without changing anything:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor
|
||||
npx quartz plugin doctor --verbose # also show informational notes
|
||||
npx quartz plugin doctor --fix # move settings of plugins that are now built into Quartz
|
||||
```
|
||||
|
||||
`doctor` reports, with a suggested fix for each problem:
|
||||
|
||||
- YAML syntax errors in `quartz.config.yaml`
|
||||
- misspelled or invalid entry keys (`enable:`, `option:`, `layout.positon`), non-boolean `enabled` values, and entries without `enabled` (treated as disabled)
|
||||
- unparseable sources and plugins configured twice
|
||||
- npm plugins that are not installed, and Git/local plugins that are not installed, not pinned in `quartz.lock.json`, checked out at a different commit than the lockfile pins, or whose source changed
|
||||
- broken local plugin symlinks and plugins without a built entry point (`dist/`)
|
||||
- option typos and type mismatches, and declared plugin dependencies that are missing or disabled
|
||||
- plugins that don't support your Quartz version (their `quartzVersion`, see [[versioning#Plugin compatibility]])
|
||||
- deprecated plugins (their `quartz.deprecated` message names the replacement)
|
||||
- entries for plugins that are now [[built-in processing|built into Quartz]] (`crawl-links`, `remove-draft`, `content-index`) and note-properties' `delimiters`/`language` options; `--fix` moves them into `configuration` (`links`, `drafts`, `contentIndex`, `frontmatter`), keeping your comments, and removes the now unused pins from `quartz.lock.json`
|
||||
- lockfile entries that are no longer configured (clean up with `prune`)
|
||||
|
||||
It exits with status 1 when it finds errors, so it can run as a CI check.
|
||||
|
||||
### prune
|
||||
|
||||
Remove installed plugins that are no longer referenced in your `quartz.config.yaml`. This is useful for cleaning up after removing plugin entries from your configuration.
|
||||
|
||||
> [!note]
|
||||
> Running `plugin install --from-config` also removes orphaned plugins as part of its synchronization. Use `prune` when you only want to clean up without installing anything new.
|
||||
|
||||
```shell
|
||||
npx quartz plugin prune
|
||||
```
|
||||
|
||||
Use `--dry-run` to preview which plugins would be removed without making changes:
|
||||
|
||||
```shell
|
||||
npx quartz plugin prune --dry-run
|
||||
```
|
||||
|
||||
## Common Workflows
|
||||
|
||||
### Adding and Enabling a Plugin
|
||||
|
||||
`plugin add` installs the plugin and enables it right away (unless the plugin is disabled by default — the command then tells you how to enable it):
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:quartz-community/example
|
||||
npx quartz plugin enable example # only needed for plugins that are disabled by default
|
||||
```
|
||||
|
||||
### Something is not working
|
||||
|
||||
Start with:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor
|
||||
```
|
||||
|
||||
### Updating Everything
|
||||
|
||||
To keep your plugins fresh:
|
||||
|
||||
```shell
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
### Installing on low-end hardware
|
||||
|
||||
By default, `plugin install` and `plugin add` clone, fetch, and build plugins in parallel across all your CPU cores. On memory-constrained machines (low-end laptops, Raspberry Pi, small VPS instances, restrictive CI runners) this can exhaust RAM or overwhelm the system because each worker may kick off its own `npm install` / `npm run build` at the same time.
|
||||
|
||||
> [!note]
|
||||
> Most community plugins now ship with a pre-built `dist/` directory. When Quartz finds this, it skips the installation and build steps entirely, making the process much faster and lighter on resources. This section is primarily relevant for plugins in development or those that don't provide pre-built distribution.
|
||||
|
||||
If `plugin install` fails, hangs, or OOMs on your machine, lower the concurrency with `--concurrency` / `-c`:
|
||||
|
||||
```shell
|
||||
# Install one plugin at a time (safest, slowest)
|
||||
npx quartz plugin install --latest -c 1
|
||||
|
||||
# Two at a time — usually a good balance on 4 GB machines
|
||||
npx quartz plugin install --latest --concurrency 2
|
||||
```
|
||||
|
||||
The same flag works on `plugin add` and the other plugin subcommands that perform parallel work:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:quartz-community/some-plugin -c 1
|
||||
```
|
||||
|
||||
### Managing Configuration
|
||||
|
||||
If you want to change a plugin setting without opening the YAML file:
|
||||
|
||||
```shell
|
||||
npx quartz plugin config explorer --set useSavedState=true
|
||||
```
|
||||
|
||||
### Cleaning Up Unused Plugins
|
||||
|
||||
If you've removed plugins from your config and want to clean up leftover files:
|
||||
|
||||
```shell
|
||||
npx quartz plugin prune --dry-run # preview first
|
||||
npx quartz plugin prune # remove orphaned plugins
|
||||
```
|
||||
|
||||
### Setting Up from Config
|
||||
|
||||
When setting up on a new machine or in CI, `install --from-config` ensures your installed plugins match your config — installing missing plugins and removing any that are no longer referenced:
|
||||
|
||||
```shell
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
### Testing with Branches
|
||||
|
||||
If a plugin author has a fix or feature on a separate branch, you can install it directly without waiting for a release to the default branch:
|
||||
|
||||
```shell
|
||||
# Install from a feature branch
|
||||
npx quartz plugin add github:username/repo#fix/some-bug
|
||||
|
||||
# Later, switch back to the default branch by re-adding without a ref
|
||||
npx quartz plugin remove repo
|
||||
npx quartz plugin add github:username/repo
|
||||
```
|
||||
|
||||
The branch ref is tracked in `quartz.lock.json`, so `install --latest` will continue to follow the specified branch until the plugin is re-added without one.
|
||||
|
||||
Both `prune` and `install --from-config` will fall back to `quartz.config.default.yaml` if no `quartz.config.yaml` is present.
|
||||
|
||||
### Local Plugin Development
|
||||
|
||||
For local plugin development or airgapped environments, you can add a plugin from a local directory:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add ./my-local-plugin
|
||||
```
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`, so changes reflect immediately. When you run `install --latest`, local plugins are rebuilt (npm install + npm run build) without any git operations.
|
||||
|
||||
> [!note]
|
||||
> Local symlinked plugins typically use this build-on-install fallback because the `dist/` directory is usually gitignored during development.
|
||||
|
||||
The `install --latest --dry-run` command will show local plugins with a "local" status instead of checking for remote updates.
|
||||
|
||||
To switch a local plugin back to a git source:
|
||||
|
||||
```shell
|
||||
npx quartz plugin remove my-local-plugin
|
||||
npx quartz plugin add github:username/my-local-plugin
|
||||
```
|
||||
|
||||
### Subdirectory (Monorepo) Plugins
|
||||
|
||||
Some plugins live in a subdirectory of a larger repository rather than at the root. For these, you can specify the plugin source as an object in `quartz.config.yaml` with a `subdir` field:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/username/monorepo.git"
|
||||
subdir: plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
This tells Quartz to clone the full repository but install only the contents of the specified subdirectory.
|
||||
|
||||
You can combine `subdir` with `ref` to pin a branch or tag, and `name` to override the plugin directory name:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/username/monorepo.git"
|
||||
subdir: packages/my-plugin
|
||||
ref: v2.0
|
||||
name: my-plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
See [[configuration#Advanced Source Options|Advanced Source Options]] for the full reference on object source fields.
|
||||
|
||||
> [!note]
|
||||
> The `plugin add` CLI command works with string sources. To use the object source format with `subdir`, edit `quartz.config.yaml` directly, then run `npx quartz plugin install --from-config` to install it.
|
||||
|
||||
## Migration from Deprecated Commands
|
||||
|
||||
| Old command | New equivalent |
|
||||
| ------------------------------------- | --------------------------------------------------- |
|
||||
| `npx quartz plugin restore` | `npx quartz plugin install --clean` |
|
||||
| `npx quartz plugin update` | `npx quartz plugin install --latest` |
|
||||
| `npx quartz plugin update my-plugin` | `npx quartz plugin install --latest my-plugin` |
|
||||
| `npx quartz plugin check` | `npx quartz plugin install --latest --dry-run` |
|
||||
| `npx quartz plugin resolve` | `npx quartz plugin install --from-config` |
|
||||
| `npx quartz plugin resolve --dry-run` | `npx quartz plugin install --from-config --dry-run` |
|
||||
|
||||
The old commands still work as hidden aliases but will print a deprecation warning.
|
||||
|
||||
## Plugin Status
|
||||
|
||||
Running the plugin command without any subcommand shows a status dashboard of all installed plugins, including whether updates are available:
|
||||
|
||||
```shell
|
||||
npx quartz plugin
|
||||
```
|
||||
|
||||
This displays each plugin with its source, commit (or npm version), enabled/disabled status, and checks Git plugins for available updates in parallel. npm plugins are updated together with Quartz (`npx quartz upgrade`). A misspelled subcommand (e.g. `npx quartz plugin lst`) is reported as an error with a suggestion instead of falling back to this dashboard. For the full interactive management interface, use [[tui|npx quartz tui]] instead.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: quartz restore
|
||||
---
|
||||
|
||||
The `restore` command is a safety mechanism that allows you to recover your **content folder** from a local cache. This command only affects your Markdown files and does not restore plugins or configuration.
|
||||
|
||||
To restore plugins to a specific state, use [[cli/plugin|npx quartz plugin install]].
|
||||
|
||||
## When to Use
|
||||
|
||||
You should use `restore` if:
|
||||
|
||||
- A `quartz upgrade` failed and corrupted your content.
|
||||
- You accidentally deleted files in your content folder.
|
||||
- You encountered complex merge conflicts that you want to undo.
|
||||
|
||||
## How it Works
|
||||
|
||||
Quartz maintains a hidden cache of your content folder. Every time you run certain commands, Quartz ensures that a backup of your Markdown files exists. The `restore` command simply copies these files back into your main content directory.
|
||||
|
||||
```shell
|
||||
npx quartz restore
|
||||
```
|
||||
|
||||
## Example Workflow
|
||||
|
||||
If an update fails and leaves your project in a broken state:
|
||||
|
||||
1. **Restore**: Run `npx quartz restore` to bring back your content.
|
||||
2. **Clean**: Use Git to reset any other broken code files.
|
||||
3. **Retry**: Attempt the update again or manually apply the changes you need.
|
||||
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: quartz sync
|
||||
---
|
||||
|
||||
The `sync` command automates the process of pushing your local changes to GitHub and pulling updates from your remote repository. It simplifies the Git workflow for users who want to keep their site updated without running manual Git commands.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Shorthand | Description | Default |
|
||||
| ------------- | --------- | ----------------------------------- | -------------------------- |
|
||||
| `--directory` | `-d` | The content folder | `content` |
|
||||
| `--verbose` | `-v` | Enable detailed logging | `false` |
|
||||
| `--commit` | | Whether to commit changes | `true` |
|
||||
| `--no-commit` | | Skip committing changes | `false` |
|
||||
| `--message` | `-m` | Custom commit message | `Quartz sync: <date time>` |
|
||||
| `--push` | | Whether to (force-)push to remote | `true` |
|
||||
| `--no-push` | | Skip pushing changes | `false` |
|
||||
| `--pull` | | Whether to pull changes from remote | `true` |
|
||||
| `--no-pull` | | Skip pulling changes | `false` |
|
||||
|
||||
## Workflow
|
||||
|
||||
When you run `npx quartz sync`, Quartz performs the following steps:
|
||||
|
||||
1. **Commit**: It stages all new and modified files in your project (`git add .`) and commits them.
|
||||
2. **Pull**: It merges the `v5` branch of your repository (`origin`) into your branch.
|
||||
3. **Push**: It force-pushes your current branch to `origin` (`git push -uf`).
|
||||
|
||||
> [!warning] `sync` force-pushes
|
||||
> The push overwrites the remote branch with your local one. If you skip the pull (`--no-pull`) while the remote has commits you don't have — for example from another device or a GitHub edit — those commits are lost on the remote.
|
||||
|
||||
## Common Workflows
|
||||
|
||||
### Regular Sync
|
||||
|
||||
The most common usage is to simply run the command with no flags. This commits, pulls, and pushes everything.
|
||||
|
||||
```shell
|
||||
npx quartz sync
|
||||
```
|
||||
|
||||
### First Sync
|
||||
|
||||
If you have just set up a new repository and haven't pushed anything yet, you might want to skip the pull step.
|
||||
|
||||
```shell
|
||||
npx quartz sync --no-pull
|
||||
```
|
||||
|
||||
### Custom Commit Message
|
||||
|
||||
You can provide a more descriptive message for your changes.
|
||||
|
||||
```shell
|
||||
npx quartz sync --message "add new notes about gardening"
|
||||
```
|
||||
|
||||
### Sync from Another Device
|
||||
|
||||
If you are working on a different computer and just want to get the latest changes without pushing anything back yet.
|
||||
|
||||
```shell
|
||||
npx quartz sync --no-push --no-commit
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Git Buffer
|
||||
|
||||
If you have a very large number of changes, Git might occasionally fail due to buffer limits. If this happens, try syncing smaller batches of files or increasing your Git post buffer size.
|
||||
|
||||
### Autostash
|
||||
|
||||
Quartz pulls with `git pull --no-rebase --autostash --no-edit --allow-unrelated-histories`: remote changes are merged (not rebased) without opening an editor, and uncommitted changes (e.g. with `--no-commit`) are set aside during the pull and brought back afterwards. If a conflict occurs, resolve it with standard Git tools, commit, and run `npx quartz sync --no-pull`.
|
||||
|
||||
For more information on initial setup, see [[installation]].
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: quartz tui
|
||||
---
|
||||
|
||||
The `tui` command launches an interactive terminal user interface for managing your Quartz project. It provides a visual way to manage plugins, arrange your site layout, and edit general settings.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To use the TUI, you must have the following:
|
||||
|
||||
1. **Bun**: The TUI requires the Bun runtime. You can find installation instructions at [bun.sh](https://bun.sh/docs/installation).
|
||||
2. **TUI Plugin**: You must install the TUI plugin in your Quartz project.
|
||||
|
||||
### Installation
|
||||
|
||||
Run the following command to add the TUI plugin:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:quartz-community/tui
|
||||
```
|
||||
|
||||
## Interface Panels
|
||||
|
||||
The TUI is divided into three main panels that you can navigate between.
|
||||
|
||||
### Plugins Panel
|
||||
|
||||
This panel allows you to browse all available and installed plugins. You can:
|
||||
|
||||
- Enable or disable plugins with a single keystroke.
|
||||
- Configure plugin-specific settings.
|
||||
- Install new plugins from the community or remove existing ones.
|
||||
|
||||
### Layout Panel
|
||||
|
||||
The Layout panel is where you define where components appear on your site. You can:
|
||||
|
||||
- Move components between different sections (e.g. `left`, `right`, `beforeBody`).
|
||||
- Reorder components within a section to change their vertical stack.
|
||||
- Set priorities for components to control their placement.
|
||||
|
||||
### Settings Panel
|
||||
|
||||
This panel provides a central place to edit your `quartz.config.yaml` settings. You can update:
|
||||
|
||||
- `pageTitle`
|
||||
- Theme colors and fonts
|
||||
- Analytics configuration
|
||||
- Deployment settings
|
||||
|
||||
## Navigation
|
||||
|
||||
The TUI uses standard terminal navigation keys:
|
||||
|
||||
- **Arrow Keys**: Move between items and panels.
|
||||
- **Enter**: Select an item or confirm a change.
|
||||
- **Esc**: Go back or cancel an action.
|
||||
- **Tab**: Cycle through different interface elements.
|
||||
|
||||
## Important Note
|
||||
|
||||
All changes made within the TUI are written directly to your `quartz.config.yaml` file. It is a good practice to have a clean Git state before using the TUI so you can easily review and undo any changes it makes.
|
||||
|
||||
For command-line based plugin management, see [[cli/plugin|quartz plugin]].
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: quartz upgrade
|
||||
---
|
||||
|
||||
The `upgrade` command upgrades the Quartz framework itself to the latest version by pulling changes from the official Quartz repository.
|
||||
|
||||
## Usage
|
||||
|
||||
```shell
|
||||
npx quartz upgrade
|
||||
```
|
||||
|
||||
## How it Works
|
||||
|
||||
When you run `npx quartz upgrade`, Quartz performs the following steps:
|
||||
|
||||
1. **Backs up your content** — your content folder is cached locally to prevent data loss.
|
||||
2. **Pulls the latest Quartz code** — fetches and merges from the official upstream repository (`upstream/v5`) using Git.
|
||||
3. **Updates dependencies** — runs `npm install` to ensure all packages match the new version.
|
||||
4. **Shows what changed** — the version transition (e.g. `5.0.0 → 5.1.0`) and the release notes of every version in between, from `CHANGELOG.md`. Between releases it says how many commits were pulled.
|
||||
5. **Restores plugins** — reinstalls plugins from `quartz.lock.json`. Plugins that are now [[built-in processing|built into Quartz]] are skipped.
|
||||
6. **Checks your config and plugins** — runs [[cli/plugin#doctor|`npx quartz plugin doctor`]] for the new version: plugin entries that are built in now (fix with `npx quartz plugin doctor --fix`), plugins that don't support the new Quartz version, lockfile and install problems.
|
||||
7. **Checks for plugin updates** — lists plugins with newer versions available.
|
||||
|
||||
Steps 4–7 run the code of the version you upgraded _to_, so the checks know about that version's changes. (Upgrading _from_ a Quartz older than 5.1 still runs the older steps once.)
|
||||
|
||||
## Handling Conflicts
|
||||
|
||||
Because Quartz allows you to customize almost every part of the code, upgrades can sometimes result in merge conflicts. This happens if you have modified a file that the Quartz team has also updated.
|
||||
|
||||
Quartz automatically handles merge conflicts in `quartz.lock.json` by backing up your lockfile before pulling and restoring it afterward. This prevents the most common source of conflicts during upgrades.
|
||||
|
||||
For other files, if a conflict occurs:
|
||||
|
||||
1. Git will mark the conflicting sections in the affected files.
|
||||
2. You will need to open these files and manually choose which changes to keep.
|
||||
3. After resolving the conflicts, you can commit the changes.
|
||||
|
||||
## Recovery
|
||||
|
||||
If an upgrade goes wrong or leaves your project in an unusable state, you can use the [[restore|restore]] command to recover your content from the local cache.
|
||||
|
||||
## Flags
|
||||
|
||||
The `upgrade` command supports the standard [[cli/index|common flags]] (`--directory`, `--verbose`).
|
||||
|
||||
## See Also
|
||||
|
||||
- [[cli/plugin|quartz plugin install --latest]] — update installed plugins
|
||||
- [[upgrading|Upgrading Quartz]] — detailed upgrading guide
|
||||
- [[restore|quartz restore]] — recover content from cache
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: Community
|
||||
---
|
||||
|
||||
Quartz has a vibrant community of users and contributors. This page highlights community-created plugins, tools, and resources that extend Quartz.
|
||||
|
||||
> [!tip] Contributing
|
||||
> Know of a great community resource? Submit a pull request to add it to this page!
|
||||
|
||||
## Community Plugins
|
||||
|
||||
Third-party plugins that extend Quartz functionality. Install them with the [[cli/plugin|plugin CLI]]:
|
||||
|
||||
```bash
|
||||
npx quartz plugin add <github-url>
|
||||
```
|
||||
|
||||
<!-- Add community plugins here as they become available -->
|
||||
<!-- Format: - **[Plugin Name](link)** — Brief description -->
|
||||
|
||||
_No community plugins listed yet. Be the first to share yours!_
|
||||
|
||||
## Tools & Integrations
|
||||
|
||||
Tools, scripts, and integrations built by the community to work with Quartz.
|
||||
|
||||
<!-- Add tools here -->
|
||||
<!-- Format: - **[Tool Name](link)** — Brief description -->
|
||||
|
||||
_No community tools listed yet._
|
||||
|
||||
## Templates & Themes
|
||||
|
||||
Custom themes, CSS snippets, and starter templates for Quartz sites.
|
||||
|
||||
<!-- Add templates/themes here -->
|
||||
<!-- Format: - **[Name](link)** — Brief description -->
|
||||
|
||||
- **[Field Notes](https://github.com/oswarren/quartz-field-notes)** — A warm, single-column reading theme with book margins, a designed dark mode, and a one-command installer that can restore your original files.
|
||||
|
||||
## Guides & Tutorials
|
||||
|
||||
Community-written guides, blog posts, and tutorials about using Quartz.
|
||||
|
||||
<!-- Add guides here -->
|
||||
<!-- Format: - **[Title](link)** by Author — Brief description -->
|
||||
|
||||
_No community guides listed yet._
|
||||
|
||||
## Related Projects
|
||||
|
||||
Projects and tools in the digital garden / PKM ecosystem that pair well with Quartz.
|
||||
|
||||
- **[Obsidian](https://obsidian.md/)** — Knowledge base and note-taking app (recommended editor for Quartz content)
|
||||
|
||||
---
|
||||
|
||||
Looking to see sites built with Quartz? Check out the [[showcase|Quartz Showcase]].
|
||||
|
||||
Want to chat with other Quartz users? [Join the Discord community](https://discord.gg/cRFFHYye7t).
|
||||
+338
-57
@@ -2,20 +2,60 @@
|
||||
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`.
|
||||
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.yaml`.
|
||||
|
||||
> [!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!
|
||||
> If you edit `quartz.config.yaml` using a text-editor with YAML language support like VSCode, it will warn you when 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:
|
||||
The configuration of Quartz can be broken down into three parts:
|
||||
|
||||
```ts title="quartz.config.ts"
|
||||
const config: QuartzConfig = {
|
||||
configuration: { ... },
|
||||
plugins: { ... },
|
||||
}
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
pageTitle: "My Site"
|
||||
# ... general configuration
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
# ... plugin entries
|
||||
layout:
|
||||
# ... groups and per-page-type layout overrides
|
||||
```
|
||||
|
||||
`configuration` and `plugins` are described below; the `layout` section (component groups, `byPageType` overrides, sidebar modes) is described in [[layout]].
|
||||
|
||||
## Extending the default configuration
|
||||
|
||||
Without a `quartz.config.yaml`, Quartz uses `quartz.config.default.yaml`. A `quartz.config.yaml` normally replaces it completely. With `extends`, your file can hold just the changes you make to another configuration instead:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
extends: default # quartz.config.default.yaml
|
||||
configuration:
|
||||
pageTitle: "My Site"
|
||||
baseUrl: example.com
|
||||
plugins:
|
||||
- source: "@quartz-community/graph"
|
||||
enabled: false # turn off a default plugin
|
||||
- source: "@quartz-community/explorer"
|
||||
options:
|
||||
folderDefaultState: open # only this option changes
|
||||
- source: github:me/my-plugin # a plugin the defaults don't have
|
||||
enabled: true
|
||||
```
|
||||
|
||||
- `extends` is `default`, a path to another config file relative to this one (which may itself extend another), an `https://` URL, or a list of those. An empty file (or one with only comments) is an empty config, and `extends: []` extends nothing.
|
||||
- A list stacks presets: each file in it adds its own changes. Quartz puts every file of the `extends` chain in one line and applies each once, its bases before it: the list's entries in order, each after the bases it extends, and your file last. A base that several entries share (usually `default`) is applied once, at its first appearance. So with `extends: [./a.yaml, ./b.yaml]`, where both extend `default`, the order is `default` → `a.yaml` → `b.yaml` → your file: what `a.yaml` changes stays unless `b.yaml` changes the same thing (later entries win), and your file wins over both. An entry that doesn't extend the shared base is applied before it if it comes first, so the base's settings win over it; make such a preset extend `default` too, or list it after the others.
|
||||
- A URL is fetched when the config is loaded (10 s timeout, at most 1 MB) and kept in `.quartz-cache/extends/`. If a later fetch fails (offline, timeout, HTTP error), Quartz uses the cached copy and warns; without one, the build stops. `QUARTZ_EXTENDS_OFFLINE=1` uses only the cached copy. Relative `extends` inside a fetched file are resolved against its URL; `default` always means your local `quartz.config.default.yaml`. Only `https://` URLs are allowed, and only extend configs you trust: they choose which plugins your build runs.
|
||||
- `configuration` and `layout` merge key by key, including nested objects (`theme.colors.lightMode.secondary` changes only that colour). Any other value replaces the default: strings, numbers and lists such as `ignorePatterns` or `byPageType.<type>.exclude`. Setting a key to `null` removes it, so the built-in default applies.
|
||||
- A plugin entry changes the default entry for the same plugin, matched by name (`github:quartz-community/explorer` matches `@quartz-community/explorer`, and a fork with the same name replaces it). A source with a `name` matches by that name; a source with a `subdir` and no `name` matches by repository and folder, so two plugins of one repository stay separate. `enabled`, `order` and `source` replace the default values. `options` and `layout` merge like `configuration`, and `null` drops them so the plugin's own defaults apply. A plugin that is not in the base is added, and it needs `enabled: true` just as in a full config.
|
||||
- Plugins run in `order` as before. Your file can change a default plugin's `order`. Where two plugins have the same order, the base config's list order decides, and added plugins come last.
|
||||
- Your updates to `quartz.config.default.yaml` (for example after `npx quartz upgrade`) reach your site without copying them over.
|
||||
|
||||
- `npx quartz build --serve` also rebuilds when a local file your config extends changes.
|
||||
- `npx quartz plugin` commands and `npx quartz info` read the merged configuration, as the build does: `plugin list`, `status`, `doctor`, `install` and `prune` see the plugins your bases configure. Commands that change plugins only ever write your own file, never the merged result: `enable`, `disable` and `config --set` add or change your entry for the plugin (`- source: …` with just that change), `config --unset` removes your value and, when a base sets the option, sets it to `null` so the plugin's default applies, and `add` appends a full entry. `remove` refuses a plugin that a base configures (it can't be removed from your file); disable it instead.
|
||||
|
||||
> [!warning] Experimental
|
||||
> `extends` is experimental: the merge rules may still change.
|
||||
|
||||
## General Configuration
|
||||
|
||||
This part of the configuration concerns anything that can affect the whole site. The following is a list breaking down all the things you can configure:
|
||||
@@ -24,13 +64,14 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `pageTitleSuffix`: a string added to the end of the page title. This only applies to the browser tab title, not the title shown at the top of the page.
|
||||
- `enableSPA`: whether to enable [[SPA Routing]] on your site.
|
||||
- `enablePopovers`: whether to enable [[popover previews]] on your site.
|
||||
- `prefetch`: fetch pages before their links are followed, so they open at once ([[prefetching]]): `viewport` (default, links on screen and links pointed at), `hover` (only links pointed at) or `"off"`. Works with and without SPA routing.
|
||||
- `analytics`: what to use for analytics on your site. Values can be
|
||||
- `null`: don't use analytics;
|
||||
- `{ provider: 'google', tagId: '<your-google-tag>' }`: use Google Analytics;
|
||||
- `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: 'https://<your-plausible-host>' }` (self-hosted, make sure to include the `https://` protocol prefix): use [Plausible](https://plausible.io/);
|
||||
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>' }`: use [Umami](https://umami.is/);
|
||||
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>', script: '<your-script-name.js>' }`: use [Umami](https://umami.is/);
|
||||
- `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com);
|
||||
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/);
|
||||
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>' }` (managed) or `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', apiHost: '<your-posthog-api-host>', uiHost: '<your-posthog-ui-host>', personProfiles: 'identified_only' }` (self-hosted/reverse proxy): use [PostHog](https://posthog.com/). `uiHost` is required when `apiHost` is a reverse proxy. The legacy `host` option is an alias for `apiHost`;
|
||||
- `{ provider: 'tinylytics', siteId: '<your-site-id>' }`: use [Tinylytics](https://tinylytics.app/);
|
||||
- `{ provider: 'cabin' }` or `{ provider: 'cabin', host: 'https://cabin.example.com' }` (custom domain): use [Cabin](https://withcabin.com);
|
||||
- `{provider: 'clarity', projectId: '<your-clarity-id-code' }`: use [Microsoft clarity](https://clarity.microsoft.com/). The project id can be found on top of the overview page.
|
||||
@@ -39,18 +80,40 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `{ provider: 'rybbit', siteId: 'my-rybbit-id' }` (managed) or `{ provider: 'rybbit', siteId: 'my-rybbit-id', host: 'my-rybbit-domain.com' }` (self-hosted) use [Rybbit](https://rybbit.com);
|
||||
- `locale`: used for [[i18n]] and date formatting
|
||||
- `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes.
|
||||
- You will be prompted to set this during [[create|`npx quartz create`]]. The CLI automatically strips any `https://` or `http://` protocol prefixes and trailing slashes for you.
|
||||
- This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`.
|
||||
- Note that Quartz 4 will avoid using this as much as possible and use relative URLs whenever it can to make sure your site works no matter _where_ you end up actually deploying it.
|
||||
- Note that Quartz 5 will avoid using this as much as possible and use relative URLs whenever it can to make sure your site works no matter _where_ you end up actually deploying it.
|
||||
- `publishAssets`: which non-Markdown files (images, PDFs, …) from `content` are copied to the site.
|
||||
- `"all"` (default): every file that isn't ignored.
|
||||
- `"referenced"`: only files a published page links to or embeds. Use this with [[ExplicitPublish]] or [[private pages|drafts]], so that files only unpublished notes use stay private.
|
||||
- Files that Quartz renders as pages themselves (e.g. `.base` and `.canvas` files) are never copied as raw assets.
|
||||
- `slugs`: how file paths become URLs.
|
||||
- `stripDiacritics`: `true` strips accents and other diacritics from page, folder and file URLs, e.g. `české/čeština.md` is published at `/ceske/cestina` instead of `/české/čeština` (which browsers show as `%C4%8Desk%C3%A9/...` when copied). Off by default.
|
||||
- Links keep working as written in your notes: `[[čeština]]`, `[[české/čeština#Nadpis]]` and embeds like `![[obrázek.png]]` resolve to the stripped addresses. Aliases and `permalink`s are stripped the same way. Heading anchors (`#Nadpis`) keep their diacritics. Tag pages and the pages plugins generate from files (canvas, bases, …) are stripped too with `@quartz-community/utils` 1.3 or newer; with older versions they keep their diacritics.
|
||||
- Only Latin letters change: they lose their accents (`á č é ů …`), and Latin letters without a decomposition fold to ASCII (`ł` → `l`, `ø` → `o`, `ß` → `ss`, `æ` → `ae`). Other scripts (Chinese, Japanese, Korean, Greek, Cyrillic, Arabic, Hebrew, Devanagari, …) are left as written, marks included.
|
||||
- Turning it on changes the URLs of existing pages. Quartz writes a redirect from each page's, folder's and alias's old address (the slug with its diacritics) to the new one, so links shared elsewhere keep working. Old `permalink` addresses are not redirected; add them as `aliases` if they need to keep working.
|
||||
- `ignorePatterns`: a list of [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) patterns that Quartz should ignore and not search through when looking for files inside the `content` folder. See [[private pages]] for more details.
|
||||
- `defaultDateType`: whether to use created, modified, or published as the default date to display on pages and page listings.
|
||||
- `theme`: configure how the site looks.
|
||||
- `fontOrigin`: where to load fonts from.
|
||||
- `"googleFonts"` (default): loads fonts from Google Fonts API. Fastest option, especially with CDN caching enabled.
|
||||
- `"local"`: Quartz loads no fonts at all; you provide them. The `typography` names are still used as the font families, so declare matching `@font-face` rules in `quartz/styles/custom.scss` and put the font files in `quartz/static/fonts/` (served at `static/fonts/`):
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
@font-face {
|
||||
font-family: "Inter";
|
||||
src: url("static/fonts/Inter.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
```
|
||||
|
||||
Use a path relative to the site root like above (no leading `/`) so it also works when the site is served from a subpath. To have Quartz download Google Fonts at build time and serve them from your site instead, set `configuration.fonts.fontOrigin: selfHosted` (see [[plugins/Fonts|Fonts]]).
|
||||
- `cdnCaching`: if `true` (default), use Google CDN to cache the fonts. This will generally be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
|
||||
- `typography`: what fonts to use. Any font available on [Google Fonts](https://fonts.google.com/) works here.
|
||||
- `title`: font for the title of the site (optional, same as `header` by default)
|
||||
- `header`: font to use for headers
|
||||
- `code`: font for inline and block quotes
|
||||
- `body`: font for everything
|
||||
- `colors`: controls the theming of the site.
|
||||
- `colors`: controls the theming of the site. It has two color schemes, `lightMode` and `darkMode`, each with the same keys:
|
||||
- `light`: page background
|
||||
- `lightgray`: borders
|
||||
- `gray`: graph links, heavier borders
|
||||
@@ -60,6 +123,34 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `tertiary`: hover states and visited [[graph view|graph]] nodes
|
||||
- `highlight`: internal link background, highlighted text, [[syntax highlighting|highlighted lines of code]]
|
||||
- `textHighlight`: markdown highlighted text background
|
||||
- `frontmatter`, `links`, `drafts`, `contentIndex`: options for Quartz's [[built-in processing]] — frontmatter parsing ([[Frontmatter]]), link resolution ([[CrawlLinks]]), draft handling ([[RemoveDrafts]]) and the content index, sitemap and RSS feed ([[ContentIndex]]). They are on by default. Each takes an object of options (plus `enabled` and `order`) or a boolean shorthand: set e.g. `links: { markdownLinkResolution: relative }` to change an option or `contentIndex: false` to turn one off.
|
||||
- `links.markdownLinkResolution` defaults to `shortest` (Obsidian's default). An old `crawl-links` plugin entry that Quartz migrates keeps that plugin's default, `absolute`, unless it sets another value.
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
theme:
|
||||
colors:
|
||||
lightMode:
|
||||
light: "#faf8f8"
|
||||
secondary: "#284b63"
|
||||
# ... the other keys
|
||||
darkMode:
|
||||
light: "#161618"
|
||||
secondary: "#7b97aa"
|
||||
# ... the other keys
|
||||
```
|
||||
|
||||
> [!note] Colors with an Obsidian theme
|
||||
> A theme from [quartz-themes](https://github.com/saberzero1/quartz-themes) (the [[ThemesCore|@quartz-themes/core]] plugin; the Obsidian and TTRPG [[create#Templates|templates]] enable one) brings its own color scheme and colors the page through Obsidian's CSS variables (`--text-normal` for most text, `--text-muted` for paragraphs, `--background-primary`, `--interactive-accent`, …). The `colors` above then have little or no effect. To change a theme's colors, override its variables in `quartz/styles/custom.scss`:
|
||||
>
|
||||
> ```scss title="quartz/styles/custom.scss"
|
||||
> html[saved-theme="dark"] body {
|
||||
> --text-normal: #e0e0e0;
|
||||
> --text-muted: #a0a0a0;
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> (use `html[saved-theme="light"] body` for light mode), or disable the theme to use the `colors` above.
|
||||
|
||||
## Plugins
|
||||
|
||||
@@ -67,47 +158,217 @@ You can think of Quartz plugins as a series of transformations over content.
|
||||
|
||||
![[quartz transform pipeline.png]]
|
||||
|
||||
```ts title="quartz.config.ts"
|
||||
plugins: {
|
||||
transformers: [...],
|
||||
filters: [...],
|
||||
emitters: [...],
|
||||
}
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/created-modified-date"
|
||||
enabled: true
|
||||
order: 10 # controls execution order
|
||||
- source: "@quartz-community/syntax-highlighting"
|
||||
enabled: true
|
||||
order: 20
|
||||
# ... more plugins
|
||||
```
|
||||
|
||||
- [[tags/plugin/transformer|Transformers]] **map** over content (e.g. parsing frontmatter, generating a description)
|
||||
- [[tags/plugin/filter|Filters]] **filter** content (e.g. filtering out drafts)
|
||||
- [[tags/plugin/emitter|Emitters]] **reduce** over content (e.g. creating an RSS feed or pages that list all files with a specific tag)
|
||||
Plugins are categorized by their type (transformer, filter, emitter, pageType) based on their manifest. The `order` field controls execution order within each category.
|
||||
|
||||
You can customize the behaviour of Quartz by adding, removing and reordering plugins in the `transformers`, `filters` and `emitters` fields.
|
||||
`before` and `after` name plugins that this one must run before or after (one name or a list; `obsidian-flavored-markdown`, `ObsidianFlavoredMarkdown` and `@quartz-community/obsidian-flavored-markdown` all work, as do the built-ins `frontmatter`, `links`, `drafts` and `contentIndex`; the names of the plugins they replaced, `crawl-links`, `remove-draft` and `content-index`, mean those built-ins). They never override `order`; they are checked against it:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:me/my-transformer
|
||||
enabled: true
|
||||
order: 45
|
||||
after: obsidian-flavored-markdown # needs the links OFM creates
|
||||
```
|
||||
|
||||
- Between plugins with the same `order`, `before`/`after` decide the order (otherwise the list order does).
|
||||
- If `order` contradicts a constraint (here: OFM moved to order 50), the build stops with an error that names both orders, instead of silently running the plugins the wrong way round.
|
||||
- A name that isn't in your config is an error. A plugin that is disabled, or runs in another category (a filter named by a transformer), is skipped: the constraint applies only where both plugins run.
|
||||
|
||||
> [!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.
|
||||
> For advanced TS override of plugin configuration, you can modify `quartz.ts`:
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
>
|
||||
> const config = await loadQuartzConfig({
|
||||
> // override any configuration field here
|
||||
> })
|
||||
> export default config
|
||||
> export const layout = await loadQuartzLayout()
|
||||
> ```
|
||||
|
||||
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:
|
||||
- [[tags/plugin/transformer|Transformers]] **map** over content (e.g. parsing frontmatter, generating a description)
|
||||
- [[tags/plugin/filter|Filters]] **filter** content (e.g. hiding [[UnlistedPages|unlisted pages]]; dropping drafts is [[built-in processing|built in]])
|
||||
- [[tags/plugin/emitter|Emitters]] **reduce** over content (e.g. creating an RSS feed or pages that list all files with a specific tag)
|
||||
- **Page Types** define how different types of pages are rendered (content pages, folder listings, tag listings). Each page type can use a different [[layout#Page Frames|page frame]] to control its overall HTML structure.
|
||||
|
||||
```ts title="quartz.config.ts"
|
||||
filters: [
|
||||
...
|
||||
Plugin.ExplicitPublish(),
|
||||
...
|
||||
],
|
||||
The `layout.byPageType` section in `quartz.config.yaml` can also set a `template` field to override the page frame for a specific page type:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
layout:
|
||||
byPageType:
|
||||
canvas:
|
||||
template: minimal # Override the page frame for canvas pages
|
||||
```
|
||||
|
||||
To remove a plugin, you should remove all occurrences of it in the `quartz.config.ts`.
|
||||
See [[layout#Page Frames]] for details on available frames and how frame resolution works.
|
||||
|
||||
To customize plugins further, some plugins may also have their own configuration settings that you can pass in. If you do not pass in a configuration, the plugin will use its default settings.
|
||||
### Internal vs External Plugins
|
||||
|
||||
For example, the [[plugins/Latex|Latex]] plugin allows you to pass in a field specifying the `renderEngine` to choose between Katex and MathJax.
|
||||
Quartz distinguishes between processing that is built into Quartz and plugins that are installed separately.
|
||||
|
||||
```ts title="quartz.config.ts"
|
||||
transformers: [
|
||||
Plugin.FrontMatter(), // use default options
|
||||
Plugin.Latex({ renderEngine: "katex" }), // set some custom options
|
||||
]
|
||||
In `quartz.config.yaml`, the official plugins are referenced by their npm package name (this is what the default config uses); other plugins can also be referenced by a Git source such as `github:org/repo`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
- source: "@quartz-community/syntax-highlighting"
|
||||
enabled: true
|
||||
options:
|
||||
theme:
|
||||
light: github-light
|
||||
dark: github-dark
|
||||
```
|
||||
|
||||
Some plugins are included by default in the [`quartz.config.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz.config.ts), but there are more available.
|
||||
Frontmatter parsing, link resolution, drafts and the content index are not plugins: they are [[built-in processing|built into Quartz]] and configured under `configuration.frontmatter`, `.links`, `.drafts` and `.contentIndex`. Everything else is a plugin, referenced by its source: npm plugins (all the default ones) are installed in `node_modules`, Git and local plugins in `.quartz/plugins/`.
|
||||
|
||||
### Community Plugins
|
||||
|
||||
To install a community plugin, you can use the following command:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add @quartz-community/explorer # an npm package
|
||||
npx quartz plugin add github:username/repo # a Git repository
|
||||
```
|
||||
|
||||
This adds the plugin to `quartz.config.yaml` and installs it to `.quartz/plugins/`.
|
||||
|
||||
To install all plugins referenced in your config that aren't yet installed (useful when cloning a project or setting up CI):
|
||||
|
||||
```shell
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
To remove installed plugins that are no longer in your config:
|
||||
|
||||
```shell
|
||||
npx quartz plugin prune
|
||||
```
|
||||
|
||||
Both commands support `--dry-run` to preview changes. See [[cli/plugin|the plugin CLI reference]] for full details.
|
||||
|
||||
### Advanced Source Options
|
||||
|
||||
The `source` field for a plugin can be either a simple string or an object with additional options. The string form is the most common:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
- source: github:username/repo
|
||||
enabled: true
|
||||
```
|
||||
|
||||
For plugins that live in a subdirectory of a repository (monorepo-style), or when you need to pin to a specific branch or tag, use the object form:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/user/repo.git"
|
||||
subdir: plugin
|
||||
ref: main
|
||||
name: my-plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
The object form supports the following fields:
|
||||
|
||||
| Field | Required | Description |
|
||||
| -------- | :------: | --------------------------------------------------------------------------------------------------------- |
|
||||
| `repo` | ✅ | Git repository URL (e.g. `https://github.com/user/repo.git`). |
|
||||
| `subdir` | ❌ | Subdirectory within the repository that contains the plugin. Used for monorepo-style plugin repositories. |
|
||||
| `ref` | ❌ | Git ref (branch or tag) to pin to. Equivalent to the `#ref` suffix on string sources. |
|
||||
| `name` | ❌ | Override the directory name used in `.quartz/plugins/`. Defaults to the repository name. |
|
||||
|
||||
> [!example] Example
|
||||
> A plugin in the `plugin/` subdirectory of a repository, pinned to a tag:
|
||||
>
|
||||
> ```yaml title="quartz.config.yaml"
|
||||
> plugins:
|
||||
> - source:
|
||||
> name: my-plugin
|
||||
> repo: "https://github.com/user/repo.git"
|
||||
> subdir: plugin
|
||||
> ref: v1.0.0
|
||||
> enabled: true
|
||||
> ```
|
||||
>
|
||||
> Themes from [quartz-themes](https://github.com/saberzero1/quartz-themes) don't need this: they are published to npm as `@quartz-themes/core` and the default config already has a (disabled) entry for it:
|
||||
>
|
||||
> ```yaml title="quartz.config.yaml"
|
||||
> plugins:
|
||||
> - source: "@quartz-themes/core"
|
||||
> enabled: true
|
||||
> options:
|
||||
> theme: tokyo-night
|
||||
> mode: both
|
||||
> ```
|
||||
|
||||
> [!tip]
|
||||
> The string form `github:user/repo#branch` and the object form `{ repo, ref }` are equivalent ways to specify a branch. Use the object form when you also need `subdir` or `name`, or when you prefer a more readable configuration.
|
||||
|
||||
### Usage
|
||||
|
||||
You can customize the behaviour of Quartz by adding, removing and reordering plugins in `quartz.config.yaml`. Each plugin entry specifies its source, whether it's enabled, execution order, and any options:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/note-properties"
|
||||
enabled: true
|
||||
options:
|
||||
includeAll: false
|
||||
includedProperties:
|
||||
- description
|
||||
- tags
|
||||
- aliases
|
||||
order: 5
|
||||
- source: "@quartz-community/created-modified-date"
|
||||
enabled: true
|
||||
options:
|
||||
priority:
|
||||
- frontmatter
|
||||
- git
|
||||
- filesystem
|
||||
order: 10
|
||||
- source: "@quartz-community/latex"
|
||||
enabled: true
|
||||
options:
|
||||
renderEngine: katex
|
||||
order: 80
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> Some plugin options require JavaScript callback functions (e.g. custom sort, filter, or map functions) that can't be expressed in YAML. For these, use the TS override in `quartz.ts`:
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
>
|
||||
> ExternalPlugin.Explorer({
|
||||
> mapFn: (node) => {
|
||||
> node.displayName = node.displayName.toUpperCase()
|
||||
> return node
|
||||
> },
|
||||
> })
|
||||
>
|
||||
> const config = await loadQuartzConfig()
|
||||
> export default config
|
||||
> export const layout = await loadQuartzLayout()
|
||||
> ```
|
||||
>
|
||||
> Options set in `quartz.ts` are merged with YAML options and take precedence. Plugin overrides must be placed **before** `loadQuartzConfig()` so they are applied when components are instantiated during config loading. See the plugin-specific documentation for available callback options.
|
||||
|
||||
You can see a list of all plugins and their configuration options [[tags/plugin|here]].
|
||||
|
||||
@@ -115,22 +376,42 @@ If you'd like to make your own plugins, see the [[making plugins|making custom p
|
||||
|
||||
## Fonts
|
||||
|
||||
Fonts can be specified as a `string` or a `FontSpecification`:
|
||||
Fonts can be specified as a simple string or with advanced options in `quartz.config.yaml`:
|
||||
|
||||
```ts
|
||||
// string
|
||||
typography: {
|
||||
header: "Schibsted Grotesk",
|
||||
...
|
||||
}
|
||||
|
||||
// FontSpecification
|
||||
typography: {
|
||||
header: {
|
||||
name: "Schibsted Grotesk",
|
||||
weights: [400, 700],
|
||||
includeItalic: true,
|
||||
},
|
||||
...
|
||||
}
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
theme:
|
||||
typography:
|
||||
title: Schibsted Grotesk # optional, defaults to header font
|
||||
header: Schibsted Grotesk
|
||||
body: Source Sans Pro
|
||||
code: IBM Plex Mono
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> Quartz uses `title`, but the config's JSON schema doesn't list it yet, so an editor with YAML validation may flag it. The warning can be ignored.
|
||||
|
||||
For more control over font weights and italics, use the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
|
||||
const config = await loadQuartzConfig({
|
||||
theme: {
|
||||
typography: {
|
||||
header: {
|
||||
name: "Schibsted Grotesk",
|
||||
weights: [400, 700],
|
||||
includeItalic: true,
|
||||
},
|
||||
body: "Source Sans Pro",
|
||||
code: "IBM Plex Mono",
|
||||
},
|
||||
},
|
||||
})
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout()
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> For per-heading fonts and self-hosted fonts, see [[plugins/Fonts|Fonts]] (`configuration.fonts`). With `fontOrigin: selfHosted`, Quartz downloads Google Fonts at build time and serves them from your site, making it fully self-contained.
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: Customizing Components
|
||||
---
|
||||
|
||||
In Quartz v4, components such as the footer lived in `quartz/components/` and you customized them by editing their source. In v5, most components are [[configuration#Plugins|community plugins]], and Quartz runs their **built** code (`dist/`). The default plugins are npm packages in `node_modules/@quartz-community/`; plugins installed from Git live in `.quartz/plugins/`. Editing either copy is the wrong approach: changes to the source have no effect until it is rebuilt, and both are overwritten the next time the plugin is installed or updated.
|
||||
|
||||
There are four ways to change a component, from least to most effort. Try them in this order.
|
||||
|
||||
## 1. Options
|
||||
|
||||
Most components have options; each plugin's page under [[plugins/index|Plugins]] lists them. Set them in `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/footer
|
||||
enabled: true
|
||||
options:
|
||||
message: 'Licensed under <a href="/license">CC BY 4.0</a>'
|
||||
links:
|
||||
GitHub: https://github.com/you/your-site
|
||||
```
|
||||
|
||||
or from the command line with `npx quartz plugin config footer --set message="Hello"` (see [[cli/plugin|plugin]]).
|
||||
|
||||
## 2. Placement
|
||||
|
||||
Where a component appears, in which order, on which page types and screen sizes is part of the layout, not the component: `layout.position`, `layout.priority` and `layout.display` per plugin, and `layout.byPageType` to drop or move components on some page types. See [[layout]] and [[layout-components]].
|
||||
|
||||
## 3. Styles
|
||||
|
||||
Write your own styles in `quartz/styles/custom.scss`. The styles of Quartz, its plugins and themes are in [CSS cascade layers](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) and `custom.scss` is not, so your rules take precedence over theirs whatever their specificity. Find the element's classes with your browser's developer tools, then for example:
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
footer {
|
||||
opacity: 1;
|
||||
text-align: center;
|
||||
|
||||
& ul {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For site-wide colors and fonts, use the [[configuration#General Configuration|theme options]] first.
|
||||
|
||||
## 4. Your own copy of the plugin
|
||||
|
||||
When options and CSS are not enough (you want different markup or behavior), make your own copy of the plugin and use that instead:
|
||||
|
||||
1. Copy the plugin's repository (fork it on GitHub, or clone it) into a directory **outside** `.quartz/`, e.g. next to your site: `git clone https://github.com/quartz-community/footer.git ../my-footer`.
|
||||
2. Change its source (for the footer, `src/components/Footer.tsx`) and build it: `npm install && npm run build` in that directory.
|
||||
3. Replace the plugin in your site with your copy:
|
||||
|
||||
```shell
|
||||
npx quartz plugin remove footer
|
||||
npx quartz plugin add ../my-footer
|
||||
```
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`. After further changes, run `npm run build` in your copy again (or `npx quartz plugin install --latest`, which rebuilds local plugins) and rebuild the site.
|
||||
|
||||
If you forked on GitHub, you can instead push your changes and add the fork with `npx quartz plugin add github:you/my-footer`, so your site builds in CI too. Note that a local path only works on machines that have that directory.
|
||||
|
||||
If you think others would want your change, consider opening a pull request against the original plugin, perhaps as a new option. To write a component from scratch, see [[creating components]].
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Bases Support
|
||||
tags:
|
||||
- component
|
||||
---
|
||||
|
||||
Quartz supports rendering [Obsidian Bases](https://obsidian.md/help/bases) (`.base` files) as interactive database-like views. Bases files define queries over your vault's notes and display the results in configurable views such as tables, lists, cards, galleries, and boards.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
Bases support is provided by the [[BasesPage]] plugin, which is enabled by default. See the plugin page for configuration options, built-in views, notes on the expression language, and how to extend with custom views.
|
||||
|
||||
## Changed in Quartz 5.1 (bases-page 1.2)
|
||||
|
||||
Bases now behave like Obsidian's in many details. If you upgrade, check filters and formulas that rely on the old behaviour:
|
||||
|
||||
- A base opens on its **first view** (it used to open on the first table view); `defaultViewType` has no default.
|
||||
- `file.name` of a Markdown note has no extension (`Note`); other files keep it (`Plan.canvas`). `file.fullname` always has it.
|
||||
- `file.tags` keeps `#` and the tags' original case; the `tags` property holds only frontmatter tags. `hasTag()` matches nested tags and is true if **any** of the given tags match.
|
||||
- Dates display in the site's locale; `date()` only parses ISO-style strings. Subtracting dates gives a duration (`9 days`) with `.days`, `.hours`, … fields.
|
||||
- `imageAspectRatio` is height / width; `file.folder` of a root file is `/`; `contains()` on text ignores case.
|
||||
- `this` in an embedded base refers to the embedding note.
|
||||
- Tags link to tag pages; links to missing notes are marked broken.
|
||||
- `.base` pages follow the site's publish filters, such as [[ExplicitPublish]].
|
||||
|
||||
See [[BasesPage#Obsidian compatibility]] for details.
|
||||
|
||||
## Demo
|
||||
|
||||
![[Base.base]]
|
||||
|
||||
## Customization
|
||||
|
||||
- Install: `npx quartz plugin add @quartz-community/bases-page`
|
||||
- Source: [`quartz-community/bases-page`](https://github.com/quartz-community/bases-page)
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Canvas Support
|
||||
tags:
|
||||
- component
|
||||
---
|
||||
|
||||
Quartz supports rendering [JSON Canvas](https://jsoncanvas.org) (`.canvas`) files as interactive, pannable and zoomable canvas pages. This brings your Obsidian canvas files to the web, preserving text nodes, file references, link nodes, group nodes, and edges with full visual fidelity.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
Canvas support is provided by the [[CanvasPage]] plugin, which is enabled by default. See the plugin page for configuration options and a full list of supported features.
|
||||
|
||||
## Demo
|
||||
|
||||
![[Canvas.canvas]]
|
||||
|
||||
## Customization
|
||||
|
||||
- Install: `npx quartz plugin add @quartz-community/canvas-page`
|
||||
- Source: [`quartz-community/canvas-page`](https://github.com/quartz-community/canvas-page)
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
title: "Docker Support"
|
||||
tags:
|
||||
- feature
|
||||
---
|
||||
|
||||
Quartz comes shipped with a Docker image that will allow you to preview your Quartz locally without installing Node.
|
||||
|
||||
You can run the below one-liner to run Quartz in Docker.
|
||||
|
||||
+5
-11
@@ -4,7 +4,7 @@ tags:
|
||||
- feature/transformer
|
||||
---
|
||||
|
||||
Quartz uses [Katex](https://katex.org/) by default to typeset both inline and block math expressions at build time.
|
||||
Quartz uses [Katex](https://katex.org/) by default to typeset both inline and block math expressions at build time. [MathJax](https://www.mathjax.org/) and [Typst](https://typst.app/) are available with the [[plugins/Latex|Latex]] plugin's `renderEngine` option (`katex`, `mathjax` or `typst`).
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -59,21 +59,15 @@ Similarly, inline math can be rendered by delimiting math expression with a sing
|
||||
|
||||
### Escaping symbols
|
||||
|
||||
There will be cases where you may have more than one `$` in a paragraph at once which may accidentally trigger MathJax/Katex.
|
||||
With [[ObsidianFlavoredMarkdown]], dollar signs follow Obsidian's rules: a `$` followed by a space or a digit after the closing `$` doesn't start or end math, so prices like `I have $1 and you have $2` stay text, as in Obsidian.
|
||||
|
||||
To get around this, you can escape the dollar sign by doing `\$` instead.
|
||||
|
||||
For example:
|
||||
|
||||
- Incorrect: `I have $1 and you have $2` produces I have $1 and you have $2
|
||||
- Correct: `I have \$1 and you have \$2` produces I have \$1 and you have \$2
|
||||
If a pair of `$` would still be read as math where you don't want it (for example `$a and b$`), escape the dollar sign as `\$`: `\$a and b\$` produces \$a and b\$.
|
||||
|
||||
### Using mhchem
|
||||
|
||||
Add the following import to the top of `quartz/plugins/transformers/latex.ts` (before all the other
|
||||
imports):
|
||||
If you are using the community Latex plugin, you can add `mhchem` support by forking the plugin repository and adding the following import to the top of `src/index.ts` (before all the other imports):
|
||||
|
||||
```ts title="quartz/plugins/transformers/latex.ts"
|
||||
```ts title="src/index.ts"
|
||||
import "katex/contrib/mhchem"
|
||||
```
|
||||
|
||||
|
||||
@@ -4,12 +4,22 @@ tags:
|
||||
- feature/transformer
|
||||
---
|
||||
|
||||
Quartz supports Mermaid which allows you to add diagrams and charts to your notes. Mermaid supports a range of diagrams, such as [flow charts](https://mermaid.js.org/syntax/flowchart.html), [sequence diagrams](https://mermaid.js.org/syntax/sequenceDiagram.html), and [timelines](https://mermaid.js.org/syntax/timeline.html). This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.
|
||||
Quartz supports [Mermaid](https://mermaid.js.org) for diagrams and charts in your notes (flow charts, sequence diagrams, timelines, and so on). This is part of [[Obsidian compatibility]] and can be turned on or off on that plugin.
|
||||
|
||||
By default, Quartz will render Mermaid diagrams to match the site theme.
|
||||
Diagrams are drawn with [Pele](https://pele.run), as in Obsidian 1.15 (since [[ObsidianFlavoredMarkdown]] 2.4 / Quartz 5.3), inside a `<div class="mermaid">`. Set `diagramRenderer: mermaid` on ObsidianFlavoredMarkdown to use the deprecated Mermaid.js instead.
|
||||
|
||||
> [!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]].
|
||||
> [!note]
|
||||
> In the default config [[ObsidianFlavoredMarkdown]] (`order: 40`) runs after [[SyntaxHighlighting]] (`order: 20`). If Mermaid diagrams don't show up and you changed either `order`, restore that sequence.
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/obsidian-flavored-markdown"
|
||||
options:
|
||||
mermaid: true
|
||||
diagramRenderer: pele # or mermaid (deprecated)
|
||||
```
|
||||
|
||||
Both renderers only load on pages that contain a Mermaid diagram. Pele is served from your own site (Quartz 5.1+) and only downloads the code for the diagram types on the page; on older Quartz versions it is loaded from jsDelivr. Mermaid.js is always loaded from a CDN.
|
||||
|
||||
## Syntax
|
||||
|
||||
|
||||
@@ -8,10 +8,224 @@ Quartz was originally designed as a tool to publish Obsidian vaults as websites.
|
||||
|
||||
By default, Quartz ships with the [[ObsidianFlavoredMarkdown]] plugin, which is a transformer plugin that adds support for [Obsidian Flavored Markdown](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown). This includes support for features like [[wikilinks]] and [[Mermaid diagrams]].
|
||||
|
||||
It also ships with support for [frontmatter parsing](https://help.obsidian.md/Editing+and+formatting/Properties) with the same fields that Obsidian uses through the [[Frontmatter]] transformer plugin.
|
||||
Since ObsidianFlavoredMarkdown 2.0, Markdown renders as it does in Obsidian: by default (`preset: "legacy"`) it parses with Obsidian's own parser. This replaces the Markdown parser, so other plugins' syntax extensions are not used and only YAML frontmatter is recognized. Use `preset: "strict"` (CommonMark/GFM as specified plus Obsidian's syntax) for TOML (`+++`) frontmatter or plugins that add their own Markdown syntax. [[GitHubFlavoredMarkdown]] runs before it (order 30, then 40); if you set `order` for either plugin, keep GitHubFlavoredMarkdown first.
|
||||
|
||||
Finally, Quartz also provides [[CrawlLinks]] plugin, which allows you to customize Quartz's link resolution behaviour to match Obsidian.
|
||||
It also ships with support for [frontmatter parsing](https://help.obsidian.md/Editing+and+formatting/Properties) with the same fields that Obsidian uses, [[built-in processing|built into Quartz]] ([[Frontmatter]], configured under `configuration.frontmatter`).
|
||||
|
||||
Finally, Quartz's built-in [[CrawlLinks|link processing]] (`configuration.links`) lets you customize link resolution to match Obsidian.
|
||||
|
||||
## Supported Features
|
||||
|
||||
### Wikilinks
|
||||
|
||||
Internal links using the `[[page]]` syntax are converted to regular links. See [[wikilinks]] for more details. All variations are supported:
|
||||
|
||||
```markdown
|
||||
[[Page]] Link to a page
|
||||
[[Page|Custom text]] Link with alias
|
||||
[[Page#Heading]] Link to a heading
|
||||
[[Page#Heading|Custom text]] Link to a heading with alias
|
||||
[[Page#^block-id]] Link to a block reference
|
||||
![[Page]] Embed (transclude) a page
|
||||
![[image.png]] Embed an image
|
||||
![[image.png|alt 100x200]] Embed with alt text and dimensions
|
||||
```
|
||||
|
||||
Inside tables, pipes in wikilinks can be escaped with a backslash:
|
||||
|
||||
```markdown
|
||||
| Column |
|
||||
| --------------- |
|
||||
| [[page\|alias]] |
|
||||
```
|
||||
|
||||
### Line breaks
|
||||
|
||||
A single line break inside a paragraph renders as a line break (`<br>`), as in Obsidian's default reading view. Set `strictLineBreaks: true` in the ObsidianFlavoredMarkdown options to join the lines with a space instead, like Obsidian's "Strict line breaks" setting. It defaults to `true` under `preset: "strict"`.
|
||||
|
||||
### Highlights
|
||||
|
||||
Wrap text in `==` to highlight it:
|
||||
|
||||
```markdown
|
||||
This is ==highlighted text== in a sentence.
|
||||
```
|
||||
|
||||
This renders as: This is ==highlighted text== in a sentence.
|
||||
|
||||
### Comments
|
||||
|
||||
Obsidian-style comments are stripped from the output:
|
||||
|
||||
```markdown
|
||||
This is visible. %%This is a comment and won't appear.%%
|
||||
```
|
||||
|
||||
This renders as: This is visible. %%This is a comment and won't appear.%%
|
||||
|
||||
Multi-line comments are also supported:
|
||||
|
||||
```markdown
|
||||
%%
|
||||
This entire block
|
||||
is a comment.
|
||||
%%
|
||||
```
|
||||
|
||||
### Tags
|
||||
|
||||
Tags starting with `#` are parsed and linked to tag pages:
|
||||
|
||||
```markdown
|
||||
#tag #nested/tag #tag-with-dashes
|
||||
```
|
||||
|
||||
For example: #feature/transformer
|
||||
|
||||
> [!note]
|
||||
> Pure numeric tags like `#123` are ignored, matching Obsidian behaviour.
|
||||
|
||||
### Callouts
|
||||
|
||||
[[callouts|Obsidian callouts]] are fully supported, including collapsible variants:
|
||||
|
||||
```markdown
|
||||
> [!note]
|
||||
> This is a note callout.
|
||||
|
||||
> [!warning]- Collapsed by default
|
||||
> This content is hidden initially.
|
||||
|
||||
> [!tip]+ Expanded by default
|
||||
> This content is visible initially.
|
||||
```
|
||||
|
||||
> [!example] Live example
|
||||
> This is a live callout rendered from Obsidian-flavored Markdown.
|
||||
|
||||
All built-in callout types are supported: `note`, `abstract`, `info`, `todo`, `tip`, `success`, `question`, `warning`, `failure`, `danger`, `bug`, `example`, and `quote`, along with their aliases.
|
||||
|
||||
### Task Lists and Custom Task Characters
|
||||
|
||||
Standard checkboxes work out of the box. With `enableCheckbox: true`, you also get support for custom task characters that are popular in the Obsidian community:
|
||||
|
||||
```markdown
|
||||
- [ ] Unchecked
|
||||
- [x] Checked
|
||||
- [?] Question
|
||||
- [!] Important
|
||||
- [>] Forwarded
|
||||
- [/] In progress
|
||||
- [-] Cancelled
|
||||
- [s] Special
|
||||
```
|
||||
|
||||
Each custom character is preserved as a `data-task` attribute on the rendered element, allowing CSS-based styling per character.
|
||||
|
||||
- [ ] Unchecked
|
||||
- [x] Checked
|
||||
- [?] Question
|
||||
- [!] Important
|
||||
|
||||
### Mermaid Diagrams
|
||||
|
||||
[[Mermaid diagrams|Mermaid]] code blocks render as diagrams. Default is Mermaid.js; set `diagramRenderer: pele` for [Pele](https://pele.run):
|
||||
|
||||
````markdown
|
||||
```mermaid
|
||||
graph TD
|
||||
A[Start] --> B{Decision}
|
||||
B -->|Yes| C[OK]
|
||||
B -->|No| D[Cancel]
|
||||
```
|
||||
````
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[Start] --> B{Decision}
|
||||
B -->|Yes| C[OK]
|
||||
B -->|No| D[Cancel]
|
||||
```
|
||||
|
||||
### YouTube Embeds
|
||||
|
||||
YouTube videos can be embedded using standard image syntax with a YouTube URL:
|
||||
|
||||
```markdown
|
||||

|
||||

|
||||
```
|
||||
|
||||
For example, the following embed is rendered from ``:
|
||||
|
||||

|
||||
|
||||
### Tweet Embeds
|
||||
|
||||
Tweets from Twitter/X are embedded as static blockquotes with a link to the original:
|
||||
|
||||
```markdown
|
||||

|
||||

|
||||
```
|
||||
|
||||
For example, the following embed is rendered from ``:
|
||||
|
||||

|
||||
|
||||
### Block References
|
||||
|
||||
Block references allow linking to specific blocks within a page:
|
||||
|
||||
```markdown
|
||||
Content paragraph. ^my-block
|
||||
|
||||
[[Page#^my-block]]
|
||||
```
|
||||
|
||||
### Obsidian URI Links
|
||||
|
||||
Links using the `obsidian://` protocol are marked with a CSS class (`obsidian-uri`) and a `data-obsidian-uri` attribute, so you can style them differently from regular links.
|
||||
|
||||
### Video Embeds
|
||||
|
||||
Video files can be embedded using standard image syntax:
|
||||
|
||||
```markdown
|
||||

|
||||

|
||||
```
|
||||
|
||||
### Embed in HTML
|
||||
|
||||
By default, Obsidian does not render its Markdown syntax inside HTML blocks. Quartz extends this with the `enableInHtmlEmbed` option, which parses wikilinks, highlights, and tags inside raw HTML nodes.
|
||||
|
||||
### Footnotes
|
||||
|
||||
Footnotes using the `[^1]` syntax and inline footnotes (`^[…]`) are supported by the [[ObsidianFlavoredMarkdown]] plugin. Both are numbered in order; an undefined footnote reference shows its bare label, as in Obsidian:
|
||||
|
||||
```markdown
|
||||
Here is a sentence with a footnote.[^1]
|
||||
Here is one with an inline footnote.^[This is the inline footnote content.]
|
||||
|
||||
[^1]: This is the footnote content.
|
||||
```
|
||||
|
||||
## Obsidian Community Plugin Support
|
||||
|
||||
Quartz focuses on supporting Obsidian's core features. Functionality from Obsidian community plugins is handled by Quartz community plugins:
|
||||
|
||||
| Obsidian Plugin | Quartz Support |
|
||||
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Dataview | Supported via [Quartz Syncer](https://community.obsidian.md/plugins/quartz-syncer) — exports Dataview queries as static content during sync |
|
||||
| Excalidraw | Supported via the [[ObsidianPluginExcalidraw\|obsidian-plugin-excalidraw]] community plugin |
|
||||
| Leaflet Maps | Supported via the `obsidian-plugin-leaflet` community plugin |
|
||||
| TTRPG Tools: Maps | Supported via the [[ObsidianPluginTtrpgToolsMaps\|obsidian-plugin-ttrpg-tools-maps]] community plugin |
|
||||
| Style Settings | Supported via the [[ThemesCore\|@quartz-themes/core]] plugin |
|
||||
|
||||
> [!tip]
|
||||
> As a general rule: Obsidian core features are supported by Quartz directly, while Obsidian community plugin features are supported by corresponding Quartz community plugins. Not all Obsidian community plugins will have Quartz equivalents, but popular ones are likely to be supported by the community.
|
||||
|
||||
## Configuration
|
||||
|
||||
This functionality is provided by the [[ObsidianFlavoredMarkdown]], [[Frontmatter]] and [[CrawlLinks]] plugins. See the plugin pages for customization options.
|
||||
This functionality is provided by the [[ObsidianFlavoredMarkdown]] plugin and Quartz's built-in [[Frontmatter|frontmatter parsing]] and [[CrawlLinks|link processing]]. See those pages for customization options.
|
||||
@@ -8,16 +8,35 @@ tags:
|
||||
|
||||
Because the Markdown generated by ox-hugo is not pure Markdown but Hugo specific, we need to transform it to fit into Quartz. This is done by the [[OxHugoFlavoredMarkdown]] plugin. Even though this plugin was written with `ox-hugo` in mind, it should work for any Hugo specific Markdown.
|
||||
|
||||
```typescript title="quartz.config.ts"
|
||||
plugins: {
|
||||
transformers: [
|
||||
Plugin.FrontMatter({ delims: "+++", language: "toml" }), // if toml frontmatter
|
||||
// ...
|
||||
Plugin.OxHugoFlavouredMarkdown(),
|
||||
Plugin.GitHubFlavoredMarkdown(),
|
||||
// ...
|
||||
],
|
||||
},
|
||||
The plugin is in the default `quartz.config.yaml` but disabled; set `enabled: true` on its entry. ox-hugo usually writes TOML frontmatter (`+++`), which Quartz's [[Frontmatter|built-in frontmatter parsing]] reads when configured under `configuration.frontmatter`. [[ObsidianFlavoredMarkdown]]'s default `legacy` preset only recognizes YAML frontmatter, so switch it to `preset: strict` too:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
frontmatter:
|
||||
delimiters: "+++"
|
||||
language: toml # if using toml frontmatter
|
||||
plugins:
|
||||
- source: "@quartz-community/github-flavored-markdown"
|
||||
enabled: true
|
||||
order: 30
|
||||
- source: "@quartz-community/obsidian-flavored-markdown"
|
||||
enabled: true
|
||||
options:
|
||||
preset: strict # needed for TOML (+++) frontmatter
|
||||
order: 40
|
||||
- source: "@quartz-community/ox-hugo"
|
||||
enabled: true
|
||||
order: 91
|
||||
```
|
||||
|
||||
OxHugoFlavoredMarkdown rewrites the Markdown source before it is parsed, so its `order` relative to the other Markdown plugins doesn't matter.
|
||||
|
||||
For options that need code, place overrides before `loadQuartzConfig()` in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
ExternalPlugin.OxHugoFlavouredMarkdown({ replaceOrgLatex: false })
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -3,8 +3,8 @@ Quartz emits an RSS feed for all the content on your site by generating an `inde
|
||||
> [!info]
|
||||
> After deploying, the generated RSS link will be available at `https://${baseUrl}/index.xml` by default.
|
||||
>
|
||||
> The `index.xml` path can be customized by passing the `rssSlug` option to the [[ContentIndex]] plugin.
|
||||
> The `index.xml` path can be customized with `configuration.contentIndex.rssSlug` (see [[ContentIndex]]).
|
||||
|
||||
## Configuration
|
||||
|
||||
This functionality is provided by the [[ContentIndex]] plugin. See the plugin page for customization options.
|
||||
This functionality is [[built-in processing|built into Quartz]]. See [[ContentIndex]] for customization options.
|
||||
@@ -9,19 +9,28 @@ tags:
|
||||
Quartz supports transforming the special Markdown syntax from Roam Research (like `{{[[components]]}}` and other formatting) into
|
||||
regular Markdown via the [[RoamFlavoredMarkdown]] plugin.
|
||||
|
||||
```typescript title="quartz.config.ts"
|
||||
plugins: {
|
||||
transformers: [
|
||||
// ...
|
||||
Plugin.RoamFlavoredMarkdown(),
|
||||
Plugin.ObsidianFlavoredMarkdown(),
|
||||
// ...
|
||||
],
|
||||
},
|
||||
The plugin is in the default `quartz.config.yaml` but disabled; set `enabled: true` on its entry:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/obsidian-flavored-markdown"
|
||||
enabled: true
|
||||
order: 40
|
||||
- source: "@quartz-community/roam"
|
||||
enabled: true
|
||||
order: 92
|
||||
```
|
||||
|
||||
For the TS override approach, place overrides before `loadQuartzConfig()` in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
ExternalPlugin.RoamFlavoredMarkdown()
|
||||
```
|
||||
|
||||
> [!warning]
|
||||
> As seen above placement of `Plugin.RoamFlavoredMarkdown()` within `quartz.config.ts` is very important. It must come before `Plugin.ObsidianFlavoredMarkdown()`.
|
||||
> With [[ObsidianFlavoredMarkdown]]'s wikilinks on (the default), syntax built on `[[…]]` — `{{[[TODO]]}}`, `{{[[DONE]]}}`, `[[>]]` — is parsed as a wikilink before this plugin runs, whatever the `order`, so it renders as a link. `^^highlight^^` and the other syntax not built on `[[…]]` work.
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
---
|
||||
title: "SPA Routing"
|
||||
tags:
|
||||
- feature
|
||||
---
|
||||
|
||||
Single-page-app style rendering. This prevents flashes of unstyled content and improves the smoothness of Quartz.
|
||||
|
||||
Under the hood, this is done by hijacking page navigations and instead fetching the HTML via a `GET` request and then diffing and selectively replacing parts of the page using [micromorph](https://github.com/natemoo-re/micromorph). This allows us to change the content of the page without fully refreshing the page, reducing the amount of content that the browser needs to load.
|
||||
|
||||
## Configuration
|
||||
|
||||
- Disable SPA Routing: set the `enableSPA` field of the [[configuration]] in `quartz.config.ts` to be `false`.
|
||||
- Disable SPA Routing: set the `enableSPA` field of the [[configuration]] in `quartz.config.yaml` to be `false`.
|
||||
- Exclude a single link: add `data-router-ignore` to it in HTML; it is followed with a normal page load. Links with `target="_blank"` and links to other sites are never handled by the router. `data-router-noscroll` keeps the scroll position when the link is followed.
|
||||
|
||||
Pages are fetched ahead of a click by [[prefetching]], which the router uses to show them at once; the fetched pages are also reused by [[popover previews]].
|
||||
|
||||
Back and Forward return to where you were on each page: the router keeps each history entry's scroll position and restores it after the page is swapped in, and a reload keeps it too. Links to a heading on the same page add a history entry and only scroll, so Back returns to where you clicked.
|
||||
|
||||
Redirects are followed: when a link is redirected (for example `folder` → `folder/` on static hosts, or an alias page to its canonical page), the address bar shows the final URL and relative links on the new page resolve against it.
|
||||
@@ -6,10 +6,12 @@ tags:
|
||||
|
||||
A backlink for a note is a link from another note to that note. Links in the backlink pane also feature rich [[popover previews]] if you have that feature enabled.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Customization
|
||||
|
||||
- Removing backlinks: delete all usages of `Component.Backlinks()` from `quartz.layout.ts`.
|
||||
- Hide when empty: hide `Backlinks` if given page doesn't contain any backlinks (default to `true`). To disable this, use `Component.Backlinks({ hideWhenEmpty: false })`.
|
||||
- Component: `quartz/components/Backlinks.tsx`
|
||||
- Style: `quartz/components/styles/backlinks.scss`
|
||||
- Script: `quartz/components/scripts/search.inline.ts`
|
||||
- Removing backlinks: remove the `backlinks` entry from `quartz.config.yaml` or set `enabled: false`.
|
||||
- Hide when empty: hide `Backlinks` if given page doesn't contain any backlinks (default to `true`). To disable this, set `hideWhenEmpty: false` in the plugin options in `quartz.config.yaml`.
|
||||
- Install: `npx quartz plugin add @quartz-community/backlinks`
|
||||
- Source: [`quartz-community/backlinks`](https://github.com/quartz-community/backlinks)
|
||||
@@ -8,28 +8,50 @@ Breadcrumbs provide a way to navigate a hierarchy of pages within your site usin
|
||||
|
||||
By default, the element at the very top of your page is the breadcrumb navigation bar (can also be seen at the top on this page!).
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Customization
|
||||
|
||||
Most configuration can be done by passing in options to `Component.Breadcrumbs()`.
|
||||
Most configuration can be done via the `options` section of the breadcrumbs plugin entry in `quartz.config.yaml`.
|
||||
|
||||
For example, here's what the default configuration looks like:
|
||||
|
||||
```typescript title="quartz.layout.ts"
|
||||
Component.Breadcrumbs({
|
||||
spacerSymbol: "❯", // symbol between crumbs
|
||||
rootName: "Home", // name of first/root element
|
||||
resolveFrontmatterTitle: true, // whether to resolve folder names through frontmatter titles
|
||||
showCurrentPage: true, // whether to display the current page in the breadcrumbs
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/breadcrumbs"
|
||||
enabled: true
|
||||
options:
|
||||
spacerSymbol: "❯"
|
||||
rootName: Home
|
||||
resolveFrontmatterTitle: true
|
||||
showCurrentPage: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index # no breadcrumbs on the home page
|
||||
```
|
||||
|
||||
For the TS override approach:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.Breadcrumbs({
|
||||
spacerSymbol: "❯",
|
||||
rootName: "Home",
|
||||
resolveFrontmatterTitle: true,
|
||||
showCurrentPage: true,
|
||||
})
|
||||
```
|
||||
|
||||
When passing in your own options, you can omit any or all of these fields if you'd like to keep the default value for that field.
|
||||
|
||||
You can also adjust where the breadcrumbs will be displayed by adjusting the [[layout]] (moving `Component.Breadcrumbs()` up or down)
|
||||
You can also adjust where the breadcrumbs will be displayed by changing the `layout.position` field in the plugin entry in `quartz.config.yaml` (see [[layout]]).
|
||||
|
||||
Want to customize it even more?
|
||||
|
||||
- Removing breadcrumbs: delete all usages of `Component.Breadcrumbs()` from `quartz.layout.ts`.
|
||||
- Component: `quartz/components/Breadcrumbs.tsx`
|
||||
- Style: `quartz/components/styles/breadcrumbs.scss`
|
||||
- Script: inline at `quartz/components/Breadcrumbs.tsx`
|
||||
- Removing breadcrumbs: remove the `breadcrumbs` entry from `quartz.config.yaml` or set `enabled: false`.
|
||||
- Install: `npx quartz plugin add @quartz-community/breadcrumbs`
|
||||
- Source: [`quartz-community/breadcrumbs`](https://github.com/quartz-community/breadcrumbs)
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
title: Built-in processing
|
||||
description: Frontmatter parsing, link resolution, drafts, the content index and font loading are part of Quartz itself.
|
||||
tags:
|
||||
- feature
|
||||
---
|
||||
|
||||
Some processing steps are needed by every Quartz site. They are built into Quartz instead of being plugins, so they cannot be removed by accident or run in the wrong order:
|
||||
|
||||
| Built-in | Configure under | What it does | Formerly |
|
||||
| ------------------------------ | ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------- |
|
||||
| [[Frontmatter\|frontmatter]] | `configuration.frontmatter` | Parses frontmatter: titles, tags, aliases, dates, `draft`, `permalink`, … | the parsing half of `note-properties` |
|
||||
| [[CrawlLinks\|links]] | `configuration.links` | Makes internal links relative, classifies links, records outgoing links for backlinks and graph | `crawl-links` |
|
||||
| [[RemoveDrafts\|drafts]] | `configuration.drafts` | Does not publish pages with `draft: true` | `remove-draft` |
|
||||
| [[ContentIndex\|contentIndex]] | `configuration.contentIndex` | Emits `static/contentIndex.json` (search, explorer, graph, …), `sitemap.xml` and the RSS feed | `content-index` |
|
||||
| [[Fonts\|fonts]] | `configuration.fonts` | Loads fonts (Google Fonts, self-hosted or local), per-heading fonts, theme font handling | `quartz-fonts` |
|
||||
|
||||
Without them a site would silently break: pages titled "Untitled", links that 404 on nested pages, empty backlinks and graph, drafts published, no search.
|
||||
|
||||
## Configuration
|
||||
|
||||
All built-ins are on by default. Options go under their key in the `configuration` section of `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
pageTitle: My garden
|
||||
frontmatter:
|
||||
language: yaml # or toml
|
||||
delimiters: "---"
|
||||
links:
|
||||
markdownLinkResolution: shortest # absolute | relative | shortest
|
||||
prettyLinks: true
|
||||
openLinksInNewTab: false
|
||||
lazyLoad: false
|
||||
externalLinkIcon: true
|
||||
disableBrokenWikilinks: true
|
||||
drafts:
|
||||
publish: false # true = publish drafts anyway (e.g. preview deployments)
|
||||
contentIndex:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
rssLimit: 10
|
||||
rssFullHtml: false
|
||||
rssSlug: index
|
||||
includeEmptyFiles: true
|
||||
fonts:
|
||||
fontOrigin: googleFonts # googleFonts | selfHosted | local
|
||||
h1: Playfair Display # per-heading fonts; title/header/body/code override theme.typography
|
||||
```
|
||||
|
||||
Each built-in also accepts:
|
||||
|
||||
- `enabled: false` (or the shorthand `links: false`) to turn it off;
|
||||
- `order` to change where it runs relative to plugins of the same kind (frontmatter runs at `0`, links at `60`, the same scale as plugin `order`).
|
||||
|
||||
See the individual pages for every option: [[Frontmatter]], [[CrawlLinks]], [[RemoveDrafts]], [[ContentIndex]], [[Fonts]].
|
||||
|
||||
## Replacing a built-in
|
||||
|
||||
A plugin can take over a built-in by declaring that it provides the same thing in its [[plugin capabilities|capabilities]] (`package.json` → `quartz.capabilities.provides`):
|
||||
|
||||
| Built-in | Replaced by a plugin that provides |
|
||||
| ------------ | ------------------------------------------ |
|
||||
| frontmatter | `data: ["frontmatter"]` |
|
||||
| links | `data: ["links"]` |
|
||||
| contentIndex | `files: ["static/contentIndex.json"]` |
|
||||
| fonts | `files: ["static/fonts/quartz-fonts.css"]` |
|
||||
|
||||
When such a plugin is enabled, the built-in steps aside (`quartz build --verbose` shows `off — replaced by plugin "…"`). Set `enabled: true` on the built-in to run both.
|
||||
|
||||
Drafts can't be replaced: a filter plugin runs in addition to the built-in.
|
||||
|
||||
## Upgrading from the plugins
|
||||
|
||||
Existing `quartz.config.yaml` files keep working: entries for `@quartz-community/crawl-links`, `@quartz-community/remove-draft`, `@quartz-community/content-index` and (since 5.2) `@quartz-community/quartz-fonts` are applied to the matching built-in (options, `order` and `enabled: false` carry over) and the packages are no longer loaded. The build prints a notice for each.
|
||||
|
||||
To update the file, run:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor --fix
|
||||
```
|
||||
|
||||
It moves the options into `configuration`, removes the old entries, and moves note-properties' `delimiters`/`language` options to `configuration.frontmatter`. Comments elsewhere in the file are kept.
|
||||
|
||||
> [!note]
|
||||
> `crawl-links` defaulted to `markdownLinkResolution: absolute`; the built-in defaults to `shortest` (Obsidian's default). Migrated entries keep `absolute` unless you set something else.
|
||||
|
||||
The [[Frontmatter#Properties panel|properties panel]] is still a plugin (`note-properties`) — it now only renders the panel.
|
||||
|
||||
## For plugin authors
|
||||
|
||||
- The data the built-ins produce is unchanged: `file.data.frontmatter`, `aliases`, `frontmatterLinks`, `links`, and the same `contentIndex.json` format. Plugins that read them need no changes.
|
||||
- Built-ins count as providers for [[plugin capabilities]], so a requirement such as `requires: { data: ["links"] }` is satisfied without any plugin. Built-in links also provides the classes it puts on links: `.internal`, `.external` and `.broken` (`dom` capabilities). In `from`, name the built-ins `quartz:frontmatter`, `quartz:links`, `quartz:drafts`, `quartz:contentIndex` and `quartz:fonts`.
|
||||
- Don't list `@quartz-community/crawl-links`, `remove-draft` or `content-index` in your manifest's [[plugin manifest#dependencies|`dependencies`]]: Quartz 5.1 treats them as satisfied by the built-ins, but Quartz 5.0 fails the build when the plugin isn't in the config. To run after built-in links, set a `defaultOrder` above 60 (a transformer with a lower order that depends on `crawl-links` fails the build).
|
||||
- Plugins can add their own fields to `contentIndex.json` — see [[making plugins#Extending the content index]].
|
||||
@@ -8,7 +8,7 @@ Quartz supports the same Admonition-callout syntax as Obsidian.
|
||||
|
||||
This includes
|
||||
|
||||
- 12 Distinct callout types (each with several aliases)
|
||||
- 13 distinct callout types (most with several aliases)
|
||||
- Collapsable callouts
|
||||
|
||||
```
|
||||
@@ -18,8 +18,8 @@ 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]].
|
||||
> [!note]
|
||||
> In the default config [[ObsidianFlavoredMarkdown]] (`order: 40`) runs after [[SyntaxHighlighting]] (`order: 20`). If callouts don't show up and you changed either `order`, restore that sequence.
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
+85
-34
@@ -4,7 +4,10 @@ tags:
|
||||
- component
|
||||
---
|
||||
|
||||
Quartz also has the ability to hook into various providers to enable readers to leave comments on your site.
|
||||
Quartz can add a comment section to your pages with the [[plugins/Comments|Comments]] plugin, so readers can leave comments on your site.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
![[giscus-example.png]]
|
||||
|
||||
@@ -30,28 +33,55 @@ After entering both your repository and selecting the discussion category, Giscu
|
||||
|
||||
![[giscus-results.png]]
|
||||
|
||||
Finally, in `quartz.layout.ts`, edit the `afterBody` field of `sharedPageComponents` to include the following options but with the values you got from above:
|
||||
Finally, in `quartz.config.yaml`, enable the comments plugin (it is in the default configuration but disabled) and fill in the values you got from above:
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
afterBody: [
|
||||
Component.Comments({
|
||||
provider: 'giscus',
|
||||
options: {
|
||||
// from data-repo
|
||||
repo: 'jackyzha0/quartz',
|
||||
// from data-repo-id
|
||||
repoId: 'MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg',
|
||||
// from data-category
|
||||
category: 'Announcements',
|
||||
// from data-category-id
|
||||
categoryId: 'DIC_kwDOFxRnmM4B-Xg6',
|
||||
// from data-lang
|
||||
lang: 'en'
|
||||
}
|
||||
}),
|
||||
],
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/comments"
|
||||
enabled: true
|
||||
options:
|
||||
provider: giscus
|
||||
options:
|
||||
repo: jackyzha0/quartz
|
||||
repoId: MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg
|
||||
category: Announcements
|
||||
categoryId: DIC_kwDOFxRnmM4B-Xg6
|
||||
lang: en
|
||||
layout:
|
||||
position: afterBody
|
||||
priority: 10
|
||||
```
|
||||
|
||||
For the TS override approach:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
// If using quartz.ts overrides instead of YAML:
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: {
|
||||
afterBody: [
|
||||
ExternalPlugin.Comments({
|
||||
provider: "giscus",
|
||||
options: {
|
||||
repo: "jackyzha0/quartz",
|
||||
repoId: "MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg",
|
||||
category: "Announcements",
|
||||
categoryId: "DIC_kwDOFxRnmM4B-Xg6",
|
||||
lang: "en",
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> If the plugin is not in your configuration, install it first: `npx quartz plugin add @quartz-community/comments`
|
||||
|
||||
### Customization
|
||||
|
||||
Quartz also exposes a few of the other Giscus options as well and you can provide them the same way `repo`, `repoId`, `category`, and `categoryId` are provided.
|
||||
@@ -66,7 +96,7 @@ type Options = {
|
||||
categoryId: string
|
||||
|
||||
// Url to folder with custom themes
|
||||
// defaults to 'https://${cfg.baseUrl}/static/giscus'
|
||||
// defaults to 'https://${baseUrl}/static/giscus'
|
||||
themeUrl?: string
|
||||
|
||||
// filename for light theme .css file
|
||||
@@ -102,23 +132,44 @@ type Options = {
|
||||
|
||||
#### Custom CSS theme
|
||||
|
||||
Quartz supports custom theme for Giscus. To use a custom CSS theme, place the `.css` file inside the `quartz/static` folder and set the configuration values.
|
||||
Quartz supports custom themes for Giscus. By default Giscus loads `light.css` and `dark.css` from `https://<baseUrl>/static/giscus`, which Quartz ships in `quartz/static/giscus/` (this needs `baseUrl` to be set to your real domain). To use a custom CSS theme, place the `.css` file inside the `quartz/static/giscus` folder and set the configuration values.
|
||||
|
||||
For example, if you have a light theme `light-theme.css`, a dark theme `dark-theme.css`, and your Quartz site is hosted at `https://example.com/`:
|
||||
|
||||
```ts
|
||||
afterBody: [
|
||||
Component.Comments({
|
||||
provider: 'giscus',
|
||||
options: {
|
||||
// Other options
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/comments"
|
||||
enabled: true
|
||||
options:
|
||||
provider: giscus
|
||||
options:
|
||||
# Other options...
|
||||
themeUrl: "https://example.com/static/giscus" # corresponds to quartz/static/giscus/
|
||||
lightTheme: light-theme # corresponds to light-theme.css in quartz/static/giscus/
|
||||
darkTheme: dark-theme # corresponds to dark-theme.css in quartz/static/giscus/
|
||||
```
|
||||
|
||||
themeUrl: "https://example.com/static/giscus", // corresponds to quartz/static/giscus/
|
||||
lightTheme: "light-theme", // corresponds to light-theme.css in quartz/static/giscus/
|
||||
darkTheme: "dark-theme", // corresponds to dark-theme.css quartz/static/giscus/
|
||||
}
|
||||
}),
|
||||
],
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: {
|
||||
afterBody: [
|
||||
ExternalPlugin.Comments({
|
||||
provider: "giscus",
|
||||
options: {
|
||||
// Other options...
|
||||
themeUrl: "https://example.com/static/giscus",
|
||||
lightTheme: "light-theme",
|
||||
darkTheme: "dark-theme",
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
#### Conditionally display comments
|
||||
|
||||
@@ -6,12 +6,14 @@ tags:
|
||||
|
||||
Quartz supports darkmode out of the box that respects the user's theme preference. Any future manual toggles of the darkmode switch will be saved in the browser's local storage so it can be persisted across future page loads.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Customization
|
||||
|
||||
- Removing darkmode: delete all usages of `Component.Darkmode()` from `quartz.layout.ts`.
|
||||
- Component: `quartz/components/Darkmode.tsx`
|
||||
- Style: `quartz/components/styles/darkmode.scss`
|
||||
- Script: `quartz/components/scripts/darkmode.inline.ts`
|
||||
- Removing darkmode: remove the `darkmode` entry from `quartz.config.yaml` or set `enabled: false`.
|
||||
- Install: `npx quartz plugin add @quartz-community/darkmode`
|
||||
- Source: [`quartz-community/darkmode`](https://github.com/quartz-community/darkmode)
|
||||
|
||||
You can also listen to the `themechange` event to perform any custom logic when the theme changes.
|
||||
|
||||
|
||||
+183
-43
@@ -6,6 +6,30 @@ tags:
|
||||
|
||||
Quartz features an explorer that allows you to navigate all files and folders on your site. It supports nested folders and is highly customizable.
|
||||
|
||||
> [!info]
|
||||
> The Explorer is now a community plugin. This demonstrates how external plugins can extend Quartz functionality while serving as a reference implementation for plugin developers.
|
||||
|
||||
## Installation
|
||||
|
||||
The Explorer is part of the default `quartz.config.yaml`. If your config doesn't have it, add it with:
|
||||
|
||||
```bash
|
||||
npx quartz plugin add @quartz-community/explorer
|
||||
```
|
||||
|
||||
This adds an entry like this to your `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
By default, it shows all folders and files on your page. To display the explorer in a different spot, you can edit the [[layout]].
|
||||
|
||||
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.
|
||||
@@ -13,46 +37,141 @@ Display names for folders get determined by the `title` frontmatter field in `fo
|
||||
> [!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.
|
||||
> 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://developer.chrome.com/docs/devtools/storage/localstorage)). You can disable this by passing `useSavedState: false` as an argument.
|
||||
|
||||
## Customization
|
||||
|
||||
Most configuration can be done by passing in options to `Component.Explorer()`.
|
||||
Most configuration can be done through the plugin's `options`.
|
||||
|
||||
For example, here's what the default configuration looks like:
|
||||
|
||||
```typescript title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
title: "Explorer", // title of the explorer component
|
||||
folderClickBehavior: "collapse", // what happens when you click a folder ("link" to navigate to folder page on click or "collapse" to collapse folder on click)
|
||||
folderDefaultState: "collapsed", // default state of folders ("collapsed" or "open")
|
||||
useSavedState: true, // whether to use local storage to save "state" (which folders are opened) of explorer
|
||||
// omitted but shown later
|
||||
sortFn: ...,
|
||||
filterFn: ...,
|
||||
mapFn: ...,
|
||||
// what order to apply functions in
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
options:
|
||||
title: Explorer # defaults to the translated "Explorer"
|
||||
folderClickBehavior: link # "link" to navigate or "collapse" to toggle
|
||||
folderDefaultState: collapsed # "collapsed" or "open"
|
||||
useSavedState: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
```
|
||||
|
||||
### Sorting
|
||||
|
||||
`sort` is a list of rules. Each folder's entries are sorted by the first rule; entries it considers equal are sorted by the next one, and so on. A rule is `{ by: <key>, direction: asc | desc }` (`direction` defaults to `asc`), or just the key. As in [[Bases]] views, `direction` may also be written `ASC` / `DESC`, and `by` as `property`.
|
||||
|
||||
| `by` | Sorts by |
|
||||
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `folder` | Folders before files (`desc`: files before folders) |
|
||||
| `title` | The displayed name (the page title), in natural order: `Note 2` before `Note 10`, case-insensitive |
|
||||
| `name` | The file or folder name, whatever the title or `mapFn` (e.g. numbered names: `10 Research`) |
|
||||
| `date` | The page's date, as `defaultDateType` picks it (created, modified or published). A folder's date is its index page's date when that page sets one in its frontmatter, else the date of its newest page |
|
||||
| `tag` | The page's tags in the order they are written: first tags compared, then second tags when those are equal, and so on. With `firstTagOnly: true`, only the first tags |
|
||||
|
||||
Entries without a date or tags come after the others, in either direction. The default is `[folder, title]`. Newest first, folders still on top:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
options:
|
||||
sort:
|
||||
- folder
|
||||
- { by: date, direction: desc }
|
||||
- title
|
||||
```
|
||||
|
||||
Grouped by first tag, newest first within a tag:
|
||||
|
||||
```yaml
|
||||
sort:
|
||||
- by: tag
|
||||
firstTagOnly: true
|
||||
- by: date
|
||||
direction: desc
|
||||
```
|
||||
|
||||
A `sortFn` set in `quartz.ts` replaces `sort`. Sorting runs at the `sort` step of `order`, so with the default order it sees the names `mapFn` set. `order: [filter, sort, map]` sorts by the original names, for example to strip [Johnny.Decimal](https://johnnydecimal.com/) prefixes in `mapFn` while keeping the numbered order.
|
||||
|
||||
### Several explorers
|
||||
|
||||
List the plugin once per explorer, each entry with its own options and layout. `rootFolder` shows only one folder's contents (a folder path as in your vault, or its slug):
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
options:
|
||||
title: Notes
|
||||
rootFolder: Notes/Daily Notes
|
||||
layout:
|
||||
position: left
|
||||
priority: 55
|
||||
display: desktop-only # one menu button on phones
|
||||
```
|
||||
|
||||
Opened folders are remembered per folder, so a folder shown in both explorers is open or closed in both; scroll positions are kept per explorer. Options set in a TypeScript override apply to every entry.
|
||||
|
||||
### Custom functions
|
||||
|
||||
For custom sort, filter, and map functions, use the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Advanced: pass callback functions that can't be expressed in YAML
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
/* ... */
|
||||
},
|
||||
filterFn: (node) => {
|
||||
/* ... */
|
||||
},
|
||||
mapFn: (node) => {
|
||||
/* ... */
|
||||
},
|
||||
order: ["filter", "map", "sort"],
|
||||
})
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout()
|
||||
```
|
||||
|
||||
> [!info] How overrides work
|
||||
> When you call `ExternalPlugin.Explorer({...})` in `quartz.ts`, the options are recorded and merged with the YAML configuration when the component is instantiated during the build. Options set in `quartz.ts` take precedence over those in `quartz.config.yaml`, following this order: `plugin defaults < YAML options < quartz.ts overrides`.
|
||||
>
|
||||
> If you have two plugins that export the same name (e.g. two different Explorer plugins installed via `--name`), use the `plugins` map to disambiguate:
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
> ExternalPlugin.plugins["my-explorer"].Explorer({ mapFn: ... })
|
||||
> ```
|
||||
|
||||
When passing in your own options, you can omit any or all of these fields if you'd like to keep the default value for that field.
|
||||
|
||||
Want to customize it even more?
|
||||
|
||||
- Removing explorer: remove `Component.Explorer()` from `quartz.layout.ts`
|
||||
- Removing explorer: remove the `explorer` entry from `quartz.config.yaml` or set `enabled: false`
|
||||
- (optional): After removing the explorer component, you can move the [[table of contents | Table of Contents]] component back to the `left` part of the layout
|
||||
- Changing `sort`, `filter` and `map` behavior: explained in [[#Advanced customization]]
|
||||
- Component: `quartz/components/Explorer.tsx`
|
||||
- Style: `quartz/components/styles/explorer.scss`
|
||||
- Script: `quartz/components/scripts/explorer.inline.ts`
|
||||
- Changing the sort order: [[#Sorting]]
|
||||
- Custom `sort`, `filter` and `map` functions: explained in [[#Advanced customization]]
|
||||
|
||||
## 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 `FileTrieNode` class, which has the following properties:
|
||||
|
||||
```ts title="quartz/components/Explorer.tsx"
|
||||
```ts title="@quartz-community/explorer"
|
||||
class FileTrieNode {
|
||||
isFolder: boolean
|
||||
children: Array<FileTrieNode>
|
||||
@@ -60,21 +179,25 @@ class FileTrieNode {
|
||||
}
|
||||
```
|
||||
|
||||
```ts title="quartz/plugins/emitters/contentIndex.tsx"
|
||||
```ts
|
||||
export type ContentDetails = {
|
||||
slug: FullSlug
|
||||
title: string
|
||||
links: SimpleSlug[]
|
||||
tags: string[]
|
||||
content: string
|
||||
date?: string // ISO 8601, the date `defaultDateType` picks (Quartz 5.3+)
|
||||
dateFromFrontmatter?: true // the date is set in the page's frontmatter (Quartz 5.3+)
|
||||
}
|
||||
```
|
||||
|
||||
To sort by date, use `sort: [{ by: date, direction: desc }]` (see [[#Sorting]]), or compare `a.data?.date` in a `sortFn`.
|
||||
|
||||
Every function you can pass is optional. By default, only a `sort` function will be used:
|
||||
|
||||
```ts title="Default sort function"
|
||||
// Sort order: folders first, then files. Sort folders and files alphabetically
|
||||
Component.Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
if ((!a.isFolder && !b.isFolder) || (a.isFolder && b.isFolder)) {
|
||||
return a.displayName.localeCompare(b.displayName, undefined, {
|
||||
@@ -112,12 +235,25 @@ These examples show the basic usage of `sort`, `map` and `filter`.
|
||||
|
||||
### Use `sort` to put files first
|
||||
|
||||
Using this example, the explorer will alphabetically sort everything.
|
||||
Files before folders, everything by title:
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
options:
|
||||
sort:
|
||||
- { by: folder, direction: desc }
|
||||
- title
|
||||
```
|
||||
|
||||
The same with a sort function in the TS override:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
return a.displayName.localeCompare(b.displayName)
|
||||
if (a.isFolder === b.isFolder) return a.displayName.localeCompare(b.displayName)
|
||||
return a.isFolder ? 1 : -1
|
||||
},
|
||||
})
|
||||
```
|
||||
@@ -126,8 +262,8 @@ Component.Explorer({
|
||||
|
||||
Using this example, the display names of all `FileNodes` (folders + files) will be converted to full upper case.
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
node.displayName = node.displayName.toUpperCase()
|
||||
return node
|
||||
@@ -135,13 +271,16 @@ Component.Explorer({
|
||||
})
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> The `mapFn`, `filterFn`, and `sortFn` options require JavaScript callback functions and cannot be expressed in YAML. Use the TS override for these. Sorting by folder, title, name, date or tag needs no code: see [[#Sorting]].
|
||||
|
||||
### Remove list of elements (`filter`)
|
||||
|
||||
Using this example, you can remove elements from your explorer by providing an array of folders/files to exclude.
|
||||
Note that this example filters on the title but you can also do it via slug or any other field available on `FileTrieNode`.
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: (node) => {
|
||||
// set containing names of everything you want to filter out
|
||||
const omit = new Set(["authoring content", "tags", "advanced"])
|
||||
@@ -158,8 +297,8 @@ Component.Explorer({
|
||||
|
||||
You can access the tags of a file by `node.data.tags`.
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: (node) => {
|
||||
// exclude files with the tag "explorerexclude"
|
||||
return node.data?.tags?.includes("explorerexclude") !== true
|
||||
@@ -172,8 +311,8 @@ Component.Explorer({
|
||||
By default, the explorer will filter out the `tags` folder.
|
||||
To override the default filter function, you can set the filter function to `undefined`.
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: undefined, // apply no filter function, every file and folder will visible
|
||||
})
|
||||
```
|
||||
@@ -181,24 +320,25 @@ Component.Explorer({
|
||||
## Advanced examples
|
||||
|
||||
> [!tip]
|
||||
> When writing more complicated functions, the `layout` file can start to look very cramped.
|
||||
> When writing more complicated functions, the `quartz.ts` file can start to look very cramped.
|
||||
> You can fix this by defining your sort functions outside of the component
|
||||
> and passing it in.
|
||||
>
|
||||
> ```ts title="quartz.layout.ts"
|
||||
> import { Options } from "./quartz/components/Explorer"
|
||||
> ```ts title="quartz.ts"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
> import type { ExplorerOptions } from "./.quartz/plugins"
|
||||
>
|
||||
> export const mapFn: Options["mapFn"] = (node) => {
|
||||
> const mapFn: ExplorerOptions["mapFn"] = (node) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
> export const filterFn: Options["filterFn"] = (node) => {
|
||||
> const filterFn: ExplorerOptions["filterFn"] = (node) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
> export const sortFn: Options["sortFn"] = (a, b) => {
|
||||
> const sortFn: ExplorerOptions["sortFn"] = (a, b) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
>
|
||||
> Component.Explorer({
|
||||
> ExternalPlugin.Explorer({
|
||||
> // ... your other options
|
||||
> mapFn,
|
||||
> filterFn,
|
||||
@@ -208,10 +348,10 @@ Component.Explorer({
|
||||
|
||||
### Add emoji prefix
|
||||
|
||||
To add emoji prefixes (📁 for folders, 📄 for files), you could use a map function like this:
|
||||
To add emoji prefixes (📁 for folders, 📄 for files), you could use a map function in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
Component.Explorer({
|
||||
```ts title="quartz.ts (override)"
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
if (node.isFolder) {
|
||||
node.displayName = "📁 " + node.displayName
|
||||
|
||||
@@ -8,13 +8,13 @@ Quartz emits listing pages for any folders and tags you have.
|
||||
|
||||
## Folder Listings
|
||||
|
||||
Quartz will generate an index page for all the pages under that folder. This includes any content that is multiple levels deep.
|
||||
Quartz will generate an index page for all the pages under that folder. This includes any content that is multiple levels deep, and pages rendered from other files such as [[Bases|`.base`]] and [[Canvas|`.canvas`]] files: a folder that holds only such pages gets a folder page too.
|
||||
|
||||
Additionally, Quartz will also generate pages for subfolders. Say you have a note in a nested folder `content/abc/def/note.md`. Then Quartz would generate a page for all the notes under `abc` _and_ a page for all the notes under `abc/def`.
|
||||
|
||||
You can link to the folder listing by referencing its name, plus a trailing slash, like this: `[[advanced/]]` (results in [[advanced/]]).
|
||||
|
||||
By default, Quartz will title the page `Folder: <folder name>` and no description. You can override this by creating an `index.md` file in the folder with the `title` [[authoring content#Syntax|frontmatter]] field. Any content you write in this file will also be used in the folder description.
|
||||
By default, Quartz will title the page with the folder name (set the [[FolderPage]] option `prefixFolders: true` for `Folder: <folder name>`) and no description. You can override this by creating an `index.md` file in the folder with the `title` [[authoring content#Syntax|frontmatter]] field. Any content you write in this file will also be used in the folder description.
|
||||
|
||||
For example, for the folder `content/posts`, you can add another file `content/posts/index.md` to add a specific description for it.
|
||||
|
||||
@@ -26,7 +26,7 @@ Quartz also supports tag hierarchies as well (e.g. `plugin/emitter`) and will al
|
||||
|
||||
You can link to the tag listing by referencing its name with a `tag/` prefix, like this: `[[tags/plugin]]` (results in [[tags/plugin]]).
|
||||
|
||||
As with folder listings, you can also provide a description and title for a tag page by creating a file for each tag. For example, if you wanted to create a custom description for the #component tag, you would create a file at `content/tags/component.md` with a title and description.
|
||||
Tag pages are titled with the tag name (set the [[TagPage]] option `prefixTags: true` for `Tag: <tag>`). As with folder listings, you can also provide a description and title for a tag page by creating a file for each tag. For example, if you wanted to create a custom description for the #component tag, you would create a file at `content/tags/component.md` with a title and description.
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
@@ -6,25 +6,26 @@ tags:
|
||||
|
||||
Full-text search in Quartz is powered by [Flexsearch](https://github.com/nextapps-de/flexsearch). It's fast enough to return search results in under 10ms for Quartzs as large as half a million words.
|
||||
|
||||
It can be opened by either clicking on the search bar or pressing `⌘`/`ctrl` + `K`. The top 5 search results are shown on each query. Matching subterms are highlighted and the most relevant 30 words are excerpted. Clicking on a search result will navigate to that page.
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
It can be opened by either clicking on the search bar or pressing `⌘`/`ctrl` + `K`. The top 8 search results are shown on each query, each with up to 5 of its tags. Matching subterms are highlighted and the most relevant 30 words are excerpted. Clicking on a search result will navigate to that page.
|
||||
|
||||
To search content by tags, you can either press `⌘`/`ctrl` + `shift` + `K` or start your query with `#` (e.g. `#components`).
|
||||
|
||||
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]].
|
||||
> Search reads `contentIndex.json`, which Quartz emits by default (see [[ContentIndex]]). It has no data if `configuration.contentIndex` is disabled.
|
||||
|
||||
### Indexing Behaviour
|
||||
|
||||
By default, it indexes every page on the site with **Markdown syntax removed**. This means link URLs for instance are not indexed.
|
||||
|
||||
It properly tokenizes Chinese, Korean, and Japenese characters and constructs separate indexes for the title, content and tags, weighing title matches above content matches.
|
||||
It properly tokenizes Chinese, Korean, and Japanese characters and constructs separate indexes for the title, content and tags, weighing title matches above content matches.
|
||||
|
||||
## Customization
|
||||
|
||||
- Removing search: delete all usages of `Component.Search()` from `quartz.layout.ts`.
|
||||
- Component: `quartz/components/Search.tsx`
|
||||
- Style: `quartz/components/styles/search.scss`
|
||||
- Script: `quartz/components/scripts/search.inline.ts`
|
||||
- You can edit `contextWindowWords`, `numSearchResults` or `numTagResults` to suit your needs
|
||||
- Removing search: remove the `search` entry from `quartz.config.yaml` or set `enabled: false`.
|
||||
- Install: `npx quartz plugin add @quartz-community/search`
|
||||
- Source: [`quartz-community/search`](https://github.com/quartz-community/search)
|
||||
+64
-37
@@ -9,57 +9,84 @@ Quartz features a graph-view that can show both a local graph view and a global
|
||||
- The local graph view shows files that either link to the current file or are linked from the current file. In other words, it shows all notes that are _at most_ one hop away.
|
||||
- The global graph view can be toggled by clicking the graph icon on the top-right of the local graph view. It shows _all_ the notes in your graph and how they connect to each other.
|
||||
|
||||
> [!info]
|
||||
> The Graph View is now a community plugin. This demonstrates how external plugins can extend Quartz functionality while serving as a reference implementation for plugin developers.
|
||||
|
||||
## Installation
|
||||
|
||||
The Graph View is part of the default `quartz.config.yaml`. If your config doesn't have it, add it with:
|
||||
|
||||
```bash
|
||||
npx quartz plugin add @quartz-community/graph
|
||||
```
|
||||
|
||||
This adds an entry like this to your `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/graph"
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
By default, the node radius is proportional to the total number of incoming and outgoing internal links from that file.
|
||||
|
||||
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]].
|
||||
> Graph View reads `contentIndex.json`, which Quartz emits by default (see [[ContentIndex]]). It is empty if `configuration.contentIndex` is disabled.
|
||||
|
||||
## Customization
|
||||
|
||||
Most configuration can be done by passing in options to `Component.Graph()`.
|
||||
Most configuration can be done through the plugin's `options`.
|
||||
|
||||
For example, here's what the default configuration looks like:
|
||||
|
||||
```typescript title="quartz.layout.ts"
|
||||
Component.Graph({
|
||||
localGraph: {
|
||||
drag: true, // whether to allow panning the view around
|
||||
zoom: true, // whether to allow zooming in and out
|
||||
depth: 1, // how many hops of notes to display
|
||||
scale: 1.1, // default view scale
|
||||
repelForce: 0.5, // how much nodes should repel each other
|
||||
centerForce: 0.3, // how much force to use when trying to center the nodes
|
||||
linkDistance: 30, // how long should the links be by default?
|
||||
fontSize: 0.6, // what size should the node labels be?
|
||||
opacityScale: 1, // how quickly do we fade out the labels when zooming out?
|
||||
removeTags: [], // what tags to remove from the graph
|
||||
showTags: true, // whether to show tags in the graph
|
||||
enableRadial: false, // whether to constrain the graph, similar to Obsidian
|
||||
},
|
||||
globalGraph: {
|
||||
drag: true,
|
||||
zoom: true,
|
||||
depth: -1,
|
||||
scale: 0.9,
|
||||
repelForce: 0.5,
|
||||
centerForce: 0.3,
|
||||
linkDistance: 30,
|
||||
fontSize: 0.6,
|
||||
opacityScale: 1,
|
||||
removeTags: [], // what tags to remove from the graph
|
||||
showTags: true, // whether to show tags in the graph
|
||||
enableRadial: true, // whether to constrain the graph, similar to Obsidian
|
||||
},
|
||||
})
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/graph"
|
||||
enabled: true
|
||||
options:
|
||||
localGraph:
|
||||
drag: true
|
||||
zoom: true
|
||||
depth: 1
|
||||
scale: 1.1
|
||||
repelForce: 0.5
|
||||
centerForce: 0.3
|
||||
linkDistance: 30
|
||||
fontSize: 0.6
|
||||
opacityScale: 1
|
||||
removeTags: []
|
||||
showTags: true
|
||||
focusOnHover: false
|
||||
enableRadial: false
|
||||
globalGraph:
|
||||
drag: true
|
||||
zoom: true
|
||||
depth: -1
|
||||
scale: 0.9
|
||||
repelForce: 0.5
|
||||
centerForce: 0.2
|
||||
linkDistance: 30
|
||||
fontSize: 0.6
|
||||
opacityScale: 1
|
||||
removeTags: []
|
||||
showTags: true
|
||||
focusOnHover: true
|
||||
enableRadial: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
```
|
||||
|
||||
When passing in your own options, you can omit any or all of these fields if you'd like to keep the default value for that field.
|
||||
|
||||
Want to customize it even more?
|
||||
|
||||
- Removing graph view: delete all usages of `Component.Graph()` from `quartz.layout.ts`.
|
||||
- Component: `quartz/components/Graph.tsx`
|
||||
- Style: `quartz/components/styles/graph.scss`
|
||||
- Script: `quartz/components/scripts/graph.inline.ts`
|
||||
- Removing graph view: remove the `graph` entry from `quartz.config.yaml` or set `enabled: false`
|
||||
- Component source: https://github.com/quartz-community/graph
|
||||
@@ -2,17 +2,21 @@
|
||||
title: Internationalization
|
||||
---
|
||||
|
||||
Internationalization allows users to translate text in the Quartz interface into various supported languages without needing to make extensive code changes. This can be changed via the `locale` [[configuration]] field in `quartz.config.ts`.
|
||||
Internationalization allows users to translate text in the Quartz interface into various supported languages without needing to make extensive code changes. This can be changed via the `locale` [[configuration]] field in `quartz.config.yaml`.
|
||||
|
||||
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)
|
||||
|
||||
Quartz's own strings (page titles of generated pages, dates, …) live in `quartz/i18n/locales`. Each plugin that shows text (explorer, search, graph, backlinks, …) ships its own translations in its repository, under `src/i18n/locales`, and picks the one matching `locale`. A missing locale falls back to `en-US`.
|
||||
|
||||
> [!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:
|
||||
> We [gladly welcome translation PRs](https://github.com/jackyzha0/quartz/tree/v5/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.
|
||||
> 3. Fill in the translations!
|
||||
> 4. Add the entry under `TRANSLATIONS` in `quartz/i18n/index.ts`.
|
||||
>
|
||||
> To translate a plugin's interface, do the same in that plugin's repository (`src/i18n/locales`, `src/i18n/index.ts`).
|
||||
@@ -1,3 +1,50 @@
|
||||
---
|
||||
title: Feature List
|
||||
---
|
||||
|
||||
Quartz comes with a wide variety of features out of the box. Most features are powered by [[configuration#Plugins|plugins]] that can be configured, enabled, or disabled via `quartz.config.yaml`.
|
||||
|
||||
## Content Features
|
||||
|
||||
- [[Obsidian compatibility]] — Full support for Obsidian-flavored Markdown
|
||||
- [[wikilinks]] — Link between notes using `[[wikilinks]]` syntax
|
||||
- [[callouts]] — Obsidian-style callout blocks
|
||||
- [[features/Latex|Latex]] — LaTeX math rendering
|
||||
- [[Mermaid diagrams]] — Mermaid fences (Mermaid.js default, Pele via `diagramRenderer`)
|
||||
- [[syntax highlighting|Syntax highlighting]] — Code block highlighting with themes
|
||||
- [[OxHugo compatibility]] — Support for ox-hugo Markdown
|
||||
- [[Roam Research compatibility]] — Support for Roam Research syntax
|
||||
- [[features/Citations|Citations]] — Academic citation support
|
||||
- [[Canvas]] — Render Obsidian Canvas files as interactive pages
|
||||
- [[Bases]] — Database-like views for your notes (tables, cards, lists, boards, galleries)
|
||||
- [[built-in processing]] — Frontmatter, link resolution, drafts and the content index, built into Quartz
|
||||
|
||||
## Navigation & Discovery
|
||||
|
||||
- [[full-text search]] — Search across all your notes
|
||||
- [[graph view]] — Interactive graph visualization of note connections
|
||||
- [[features/backlinks]] — See which notes link to the current page
|
||||
- [[features/explorer]] — File tree sidebar for browsing notes
|
||||
- [[features/breadcrumbs]] — Breadcrumb navigation trail
|
||||
- [[table of contents]] — Per-page table of contents
|
||||
- [[folder and tag listings]] — Browse notes by folder or tag
|
||||
- [[recent notes]] — Display recently modified notes
|
||||
- [[popover previews]] — Hover previews for internal links
|
||||
- [[StackedPages|stacked pages]] — Open linked notes as binder-style stacked tabs for tracing note connections
|
||||
- [[EncryptedPages|encrypted pages]] — Password-protect individual pages with client-side encryption
|
||||
|
||||
## Appearance & Reading
|
||||
|
||||
- [[features/darkmode]] — Light and dark mode toggle
|
||||
- [[reader mode]] — Distraction-free reading experience
|
||||
- [[features/comments|comments]] — Add comments via Giscus
|
||||
- [[social images]] — Auto-generated Open Graph images for social sharing
|
||||
|
||||
## Publishing & Deployment
|
||||
|
||||
- [[RSS Feed]] — RSS feed generation for content syndication
|
||||
- [[private pages]] — Control which pages are published
|
||||
- [[SPA Routing]] — Single-page app navigation
|
||||
- [[prefetching]] — Fetch pages before their links are followed, so they open at once
|
||||
- [[Docker Support]] — Build and deploy with Docker
|
||||
- [[i18n]] — Internationalization with 30+ supported locales
|
||||
@@ -8,10 +8,15 @@ By default, Quartz only fetches previews for pages inside your vault due to [COR
|
||||
|
||||
When [[creating components|creating your own components]], you can include this `popover-hint` class to also include it in the popover.
|
||||
|
||||
Similar to Obsidian, [[quartz-layout-desktop.png|images referenced using wikilinks]] can also be viewed as popups.
|
||||
Similar to Obsidian, [[quartz-layout-desktop.png|images referenced using wikilinks]] can also be viewed as popups, and links to PDFs show the PDF.
|
||||
|
||||
Popovers are shown for internal links (`a.internal`). A link to an alias page shows the page it redirects to. To turn off the popover for a single link, add `data-no-popover="true"` to it in HTML (Quartz does this for heading anchor links).
|
||||
|
||||
With [[SPA Routing]], a page that was already fetched by [[prefetching]] or by the router is reused, so a popover doesn't download it again.
|
||||
|
||||
## Configuration
|
||||
|
||||
- Remove popovers: set the `enablePopovers` field in `quartz.config.ts` to be `false`.
|
||||
- Remove popovers: set the `enablePopovers` field in `quartz.config.yaml` to be `false`.
|
||||
- Remove popovers for one link: add `data-no-popover="true"` to it.
|
||||
- Style: `quartz/components/styles/popover.scss`
|
||||
- Script: `quartz/components/scripts/popover.inline.ts`
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: Prefetching
|
||||
tags:
|
||||
- feature
|
||||
---
|
||||
|
||||
Quartz fetches the pages a reader is likely to open next before they click, so following a link shows the page at once instead of waiting for the network. It works with and without [[SPA Routing]].
|
||||
|
||||
## How it works
|
||||
|
||||
- **`viewport`** (the default): links on screen are fetched while the browser is idle, two at a time and at most 30 per page view. Pointing at a link or focusing it with the keyboard fetches it first, and touching it on a phone fetches it immediately.
|
||||
- **`hover`**: only links that are pointed at for a moment, focused or touched are fetched.
|
||||
|
||||
With [[SPA Routing]], Quartz keeps the fetched pages in memory for five minutes (at most 40 of them), and both page navigation and [[popover previews]] use them, so a page is never downloaded twice. Without SPA routing every link is a normal page load, so Quartz asks the browser to prefetch instead: with [Speculation Rules](https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API) where the browser supports them, otherwise with `<link rel="prefetch">`.
|
||||
|
||||
Quartz never prefetches:
|
||||
|
||||
- links to other sites, links that open in a new tab, and downloads;
|
||||
- links to files such as images and PDFs (only pages);
|
||||
- with `viewport`, links on screen to pages that aren't in the site's content index (so a broken link in your layout doesn't show up as a 404 on every page);
|
||||
- anything but links the reader points at, when the browser asks to save data (Data Saver) or the connection is 2G.
|
||||
|
||||
To exclude a single link, add `data-no-prefetch` to it in HTML. Links with `data-router-ignore` are never prefetched either.
|
||||
|
||||
## Configuration
|
||||
|
||||
Set `prefetch` in the [[configuration]] in `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
prefetch: viewport # or hover, or "off"
|
||||
```
|
||||
@@ -8,16 +8,22 @@ There may be some notes you want to avoid publishing as a website. Quartz suppor
|
||||
|
||||
## Filter Plugins
|
||||
|
||||
[[making plugins#Filters|Filter plugins]] are plugins that filter out content based off of certain criteria. By default, Quartz uses the [[RemoveDrafts]] plugin which filters out any note that has `draft: true` in the frontmatter.
|
||||
[[making plugins#Filters|Filter plugins]] are plugins that filter out content based off of certain criteria. By default, Quartz's built-in [[RemoveDrafts|draft handling]] filters out any note that has `draft: true` in the frontmatter. Set `configuration.drafts.publish: true` to publish drafts anyway (e.g. for a preview deployment).
|
||||
|
||||
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.
|
||||
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. It is in the default `quartz.config.yaml` but disabled; set `enabled: true` on its entry.
|
||||
|
||||
To publish a page but keep it out of listings (explorer, search, graph, backlinks, RSS, sitemap, folder and tag pages), add `unlisted: true` to its frontmatter. This is handled by [[UnlistedPages]], which is enabled by default. The page is still reachable by its URL.
|
||||
|
||||
Bases, canvases and Excalidraw drawings follow the same filters. A drawing stored as Markdown has frontmatter of its own. A `.base` or `.canvas` file has none: with [[ExplicitPublish]] it is published when a published note links to it, and with encrypted pages it is encrypted with the password of the encrypted note that links to it.
|
||||
|
||||
> [!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.
|
||||
> By default (`publishAssets: "all"`), **all non-markdown files are emitted and available publicly in the final build**, regardless of the filter plugin used. This includes files such as images, voice recordings, PDFs, etc.
|
||||
>
|
||||
> Set `publishAssets: "referenced"` in the [[configuration]] to copy only the files that published pages link to or embed, so that files only used by unpublished notes stay private.
|
||||
|
||||
## `ignorePatterns`
|
||||
|
||||
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.
|
||||
This is a field in `quartz.config.yaml` 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.
|
||||
|
||||
@@ -6,15 +6,28 @@ tags:
|
||||
|
||||
Reader Mode is a feature that allows users to focus on the content by hiding the sidebars and other UI elements. When enabled, it provides a clean, distraction-free reading experience.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Configuration
|
||||
|
||||
Reader Mode is enabled by default. To disable it, you can remove the component from your layout configuration in `quartz.layout.ts`:
|
||||
Reader Mode is enabled by default. To disable it, set `enabled: false` in your `quartz.config.yaml`:
|
||||
|
||||
```ts
|
||||
// Remove or comment out this line
|
||||
Component.ReaderMode(),
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/reader-mode"
|
||||
enabled: false
|
||||
```
|
||||
|
||||
Or remove the plugin entirely:
|
||||
|
||||
```bash
|
||||
npx quartz plugin remove reader-mode
|
||||
```
|
||||
|
||||
- Install: `npx quartz plugin add @quartz-community/reader-mode`
|
||||
- Source: [`quartz-community/reader-mode`](https://github.com/quartz-community/reader-mode)
|
||||
|
||||
## Usage
|
||||
|
||||
The Reader Mode toggle appears as a button with a book icon. When clicked:
|
||||
|
||||
@@ -3,15 +3,35 @@ title: Recent Notes
|
||||
tags: component
|
||||
---
|
||||
|
||||
Quartz can generate a list of recent notes based on some filtering and sorting criteria. Though this component isn't included in any [[layout]] by default, you can add it by using `Component.RecentNotes` in `quartz.layout.ts`.
|
||||
Quartz can generate a list of recent notes based on some filtering and sorting criteria. The plugin is in the default `quartz.config.yaml` but disabled; set `enabled: true` on its entry. It is placed in `afterBody` by default; add a `layout` block to put it somewhere else (see [[layout]]).
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/recent-notes"
|
||||
enabled: true
|
||||
options:
|
||||
limit: 3
|
||||
showTags: true
|
||||
linkToMore: false
|
||||
layout:
|
||||
position: right
|
||||
priority: 40
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Customization
|
||||
|
||||
- Changing the title from "Recent notes": pass in an additional parameter to `Component.RecentNotes({ title: "Recent writing" })`
|
||||
- Changing the number of recent notes: pass in an additional parameter to `Component.RecentNotes({ limit: 5 })`
|
||||
- Display the note's tags (defaults to true): `Component.RecentNotes({ showTags: false })`
|
||||
- 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.
|
||||
- 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`.
|
||||
- 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.
|
||||
- Component: `quartz/components/RecentNotes.tsx`
|
||||
- Style: `quartz/components/styles/recentNotes.scss`
|
||||
Most options are configured in the `options` section of the plugin entry in `quartz.config.yaml`:
|
||||
|
||||
- Changing the title from "Recent notes": set `title: "Recent writing"` in options
|
||||
- Changing the number of recent notes (default 3): set `limit: 5` in options
|
||||
- Display the note's tags (defaults to true): set `showTags: false` in options
|
||||
- Hide generated tag pages from the list (defaults to false): set `hideTagPages: true` in options. This filters out any page whose slug lives under the conventional `tags/` prefix.
|
||||
- Hide generated folder index pages from the list (defaults to false): set `hideFolderPages: true` in options. This filters out any page whose slug matches Quartz's folder-path convention (trailing slash or `index` suffix).
|
||||
- Show a 'see more' link (default `false`, no link): set `linkToMore: "tags/components"` in options. This field should be a full slug to a page that exists.
|
||||
- Customize filtering: requires a TS override — pass `filter: someFilterFunction` to the plugin constructor in `quartz.ts`. The filter function should have the signature `(f: QuartzPluginData) => boolean`.
|
||||
- Customize sorting: requires a TS override — pass `sort: someSortFunction` to the plugin constructor in `quartz.ts`. By default, Quartz will sort by date and then tie break lexicographically. The sort function should have the signature `(f1: QuartzPluginData, f2: QuartzPluginData) => number`.
|
||||
- Install: `npx quartz plugin add @quartz-community/recent-notes`
|
||||
- Source: [`quartz-community/recent-notes`](https://github.com/quartz-community/recent-notes)
|
||||
@@ -8,7 +8,7 @@ Quartz can also dynamically generate and use new cover images for every page to
|
||||
|
||||
## Showcase
|
||||
|
||||
After enabling the [[CustomOgImages]] emitter plugin, the social media link preview for [[authoring content | Authoring Content]] looks like this:
|
||||
With the [[CustomOgImages]] emitter plugin (enabled by default), the social media link preview for [[authoring content | Authoring Content]] looks like this:
|
||||
|
||||
| Light | Dark |
|
||||
| ----------------------------------- | ---------------------------------- |
|
||||
|
||||
@@ -11,8 +11,10 @@ You can hide the TOC on a page by adding `enableToc: false` to the frontmatter f
|
||||
|
||||
By default, the TOC shows all headings from H1 (`# Title`) to H3 (`### Title`) and is only displayed if there is more than one heading on the page.
|
||||
|
||||
TOC entries link to the heading ids that [[GitHubFlavoredMarkdown]] gives headings, and both use the same slug function as [[wikilinks#Heading anchors|heading links]], so they always agree. Since GitHubFlavoredMarkdown 2.1 a heading containing `--` gets GitHub's id (`## Range 1--2` → `#range-1--2`, previously `#range-12`); update hand-written links to the old id.
|
||||
|
||||
## Customization
|
||||
|
||||
The table of contents is a functionality of the [[TableOfContents]] plugin. See the plugin page for more customization options.
|
||||
|
||||
It also needs the `TableOfContents` component, which is displayed in the right sidebar by default. You can change this by customizing the [[layout]]. The TOC component can be configured with the `layout` parameter, which can either be `modern` (default) or `legacy`.
|
||||
The same plugin entry provides the `TableOfContents` component, which is displayed in the right sidebar by default. You can change this with the entry's `layout` block (see [[layout]]). The component's style is set with the `layout` option, which can either be `modern` (default) or `legacy`.
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
draft: true
|
||||
---
|
||||
|
||||
## misc backlog
|
||||
|
||||
- static dead link detection
|
||||
- cursor chat extension
|
||||
- sidenotes? https://github.com/capnfabs/paperesque
|
||||
- direct match in search using double quotes
|
||||
- https://help.obsidian.md/Advanced+topics/Using+Obsidian+URI
|
||||
- Canvas
|
||||
@@ -4,9 +4,18 @@ title: Wikilinks
|
||||
|
||||
Wikilinks were pioneered by earlier internet wikis to make it easier to write links across pages without needing to write Markdown or HTML links each time.
|
||||
|
||||
Quartz supports Wikilinks by default and these links are resolved by Quartz using the [[CrawlLinks]] plugin. See the [Obsidian Help page on Internal Links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) for more information on Wikilink syntax.
|
||||
Quartz supports Wikilinks by default and these links are resolved by Quartz's built-in [[CrawlLinks|link processing]]. See the [Obsidian Help page on Internal Links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) for more information on Wikilink syntax.
|
||||
|
||||
This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.
|
||||
Parsing wikilinks is part of [[Obsidian compatibility]] ([[ObsidianFlavoredMarkdown]]). How links are resolved (`markdownLinkResolution`, pretty link text, broken-link styling, …) is configured under `configuration.links` (see [[CrawlLinks]]).
|
||||
|
||||
Wikilink matching is case-insensitive to mirror Obsidian: `[[My Note]]`, `[[my note]]`, and `[[MY NOTE]]` all resolve to the same file. The generated URL is lowercased (e.g. `my-note`).
|
||||
|
||||
Links behave as in Obsidian in a few more ways:
|
||||
|
||||
- Link paths are NFC-normalized, so a link spelled with a decomposed `é` reaches `café.md`.
|
||||
- A short link to an Obsidian folder note (`[[Topic]]` for `Topic/Topic.md`) reaches the folder page.
|
||||
- A Markdown link whose path is not valid percent-encoding (`[x](%zz)`) is treated as an external link.
|
||||
- An image without alt text gets its path as alt text, as Obsidian names an embed: `![[pic.png]]` gets `pic.png`, and a Markdown image of a file the site doesn't have gets its decoded path (`` → "missing pic.png").
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -15,10 +24,36 @@ This is enabled as a part of [[Obsidian compatibility]] and can be configured an
|
||||
- `[[Path to file#Anchor]]`: produces a link to the anchor `Anchor` in the file `Path to file.md`
|
||||
- `[[Path to file#^block-ref]]`: produces a link to the specific block `block-ref` in the file `Path to file.md`
|
||||
|
||||
A `^id` at the end of a wikilink's text stays part of the link text (`[[note|a ^id]]` shows `a ^id`); it doesn't turn the paragraph into a block with that id.
|
||||
|
||||
### Heading anchors
|
||||
|
||||
Heading ids are slugs of the heading text, the same ones GitHub uses: `## My Heading` → `#my-heading`, `## Range 1--2` → `#range-1--2`. Heading links, embeds and the [[table of contents]] use the same slugs. Obsidian replaces `:`, `|`, `^`, `#` and `\` in a heading with spaces when it writes a link to it (`[[note#Colon unspaced]]` for `## Colon:unspaced`); such links and embeds reach the heading too.
|
||||
|
||||
### Embeds
|
||||
|
||||
- `![[Path to image]]`: embeds an image into the page
|
||||
- `![[Path to image|100x145]]`: embeds an image into the page with dimensions 100px by 145px
|
||||
- `![[Path to image|Alt text|300]]`: embeds an image with alt text and a width of 300px. Markdown images take a size the same way: ``
|
||||
- `![[Path to file]]`: transclude an entire page
|
||||
- `![[Path to file#Anchor]]`: transclude everything under the header `Anchor`
|
||||
- `![[Path to file#^b15695]]`: transclude block with ID `^b15695`
|
||||
|
||||
### Styling individual images
|
||||
|
||||
The text between `|`s that isn't a size becomes the image's alt text: `![[diagram.png|invert center|300]]` gives `<img alt="invert center" width="300">` (likewise ``). SVG files are embedded as `<object>` and get it as `aria-label`. You can use words in the alt text as flags for styles in `quartz/styles/custom.scss`, for example to invert diagrams in dark mode and to center images:
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
// ![[diagram.png|invert]]: invert colors in dark mode (hue-rotate keeps hues roughly the same)
|
||||
html[saved-theme="dark"] :is(img[alt~="invert"], object[aria-label~="invert"]) {
|
||||
filter: invert(1) hue-rotate(180deg);
|
||||
}
|
||||
|
||||
// ![[photo.png|center]] or ![[photo.png|center|300]]: center the image
|
||||
:is(img[alt~="center"], object[aria-label~="center"]) {
|
||||
display: block;
|
||||
margin-inline: auto;
|
||||
}
|
||||
```
|
||||
|
||||
`~=` matches one word of the alt text, so flags combine (`|invert center|`), and an alt text such as `|Network diagram invert|` still describes the image for screen readers.
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: Authoring Content
|
||||
aliases:
|
||||
- "authoring content"
|
||||
---
|
||||
|
||||
All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've followed the [[installation|installation guide]], this folder should already be initialized. Any Markdown in this folder will get processed by Quartz.
|
||||
|
||||
It is recommended that you use [Obsidian](https://obsidian.md/) as a way to edit and maintain your Quartz. It comes with a nice editor and graphical interface to preview, edit, and link your local files and attachments.
|
||||
|
||||
Got everything set up? Preview your site locally with `npx quartz build --serve`, or see the [[build|build reference]] for more options.
|
||||
|
||||
## Syntax
|
||||
|
||||
As Quartz uses Markdown files as the main way of writing content, it fully supports Markdown syntax. By default, Quartz also ships with a few syntax extensions like [Github Flavored Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) (strikethrough, tables, tasklists) and [Obsidian Flavored Markdown](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown) ([[callouts]], [[wikilinks]], footnotes including inline `^[…]` footnotes).
|
||||
|
||||
Additionally, Quartz also allows you to specify additional metadata in your notes called **frontmatter**.
|
||||
|
||||
```md title="content/note.md"
|
||||
---
|
||||
title: Example Title
|
||||
draft: false
|
||||
tags:
|
||||
- example-tag
|
||||
---
|
||||
|
||||
The rest of your content lives here. You can use **Markdown** here :)
|
||||
```
|
||||
|
||||
Some common frontmatter fields that are natively supported by Quartz:
|
||||
|
||||
- `title`: Title of the page. If it isn't provided, Quartz will use the name of the file as the title.
|
||||
- `description`: Description of the page used for link previews.
|
||||
- `permalink`: The page's address on the site, as in Obsidian Publish: `note.md` with `permalink: page` is published at `/page`, whatever its folder or file name. Links to the note (`[[note]]`) point there, and its file path redirects to it. A permalink that is already another page's address is ignored with a warning.
|
||||
- `aliases`: Other addresses for this note that redirect to it (with the [[AliasRedirects]] plugin), so old links and links from other sites keep working after a note is renamed or moved. This is a list of strings.
|
||||
- `tags`: Tags for this note.
|
||||
- `draft`: Whether to publish the page or not. This is one way to make [[private pages|pages private]] in Quartz.
|
||||
- `date`: A string representing the day the note was published. Normally uses `YYYY-MM-DD` format.
|
||||
|
||||
See [[Frontmatter]] for a complete list of frontmatter.
|
||||
|
||||
> [!warning] Frontmatter must be valid
|
||||
> Frontmatter is YAML (or TOML, if configured) made of `key: value` properties. If a file's frontmatter can't be parsed — broken YAML, or a single value or list instead of properties — the build stops with an error naming the file. JavaScript frontmatter (`---js`, `---javascript`) is refused: Quartz never runs code from your content.
|
||||
|
||||
## 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 [[installation#Setting Up Your GitHub Repository|set up your GitHub repository]] and then run `npx quartz sync`.
|
||||
|
||||
## Customization
|
||||
|
||||
Frontmatter parsing for `title`, `tags`, `aliases` and `cssclasses` is built into Quartz (see [[Frontmatter]]), `date` is handled by the [[CreatedModifiedDate]] plugin and `description` by the [[Description]] plugin. See the plugin pages for customization options.
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Getting Started
|
||||
---
|
||||
|
||||
This guide walks you through setting up Quartz from scratch. If you already ran the [[index#🪴 Get Started|quickstart]] on the home page, you can skip ahead to whichever step you're on.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You need these tools installed before continuing:
|
||||
|
||||
- **[Node.js](https://nodejs.org/) v22.22 or later** (run `node -v` to check)
|
||||
- **npm v10.9.2 or later** (bundled with Node — run `npm -v` to check)
|
||||
- **[Git](https://git-scm.com/)** (run `git -v` to check)
|
||||
|
||||
> [!warning] Common issues
|
||||
>
|
||||
> - **Linux**: System packages (`apt install nodejs`) often ship much older versions. Use [nvm](https://github.com/nvm-sh/nvm) or the [NodeSource](https://github.com/nodesource/distributions) repository to get Node.js v22.22 or later.
|
||||
> - **Windows**: When installing Git, make sure **"Git from the command line and also from 3rd-party software"** is selected so that `git` is available in your terminal. If `node -v` or `git -v` shows "command not found", restart your terminal or check your PATH.
|
||||
> - **macOS**: The Xcode command-line tools include Git (`xcode-select --install`). For Node.js, [nvm](https://github.com/nvm-sh/nvm) or the [official installer](https://nodejs.org/) both work.
|
||||
|
||||
> [!tip] Using Bun
|
||||
> Quartz runs on Node.js, but you can install its dependencies with [Bun](https://bun.sh/) (`bun install`). Bun does not link a package's own commands the way npm does, so `bunx quartz` fails with "could not determine executable to run". Use `bun run quartz` instead, followed by the command, wherever these docs say `npx quartz`: `bun run quartz create`, `bun run quartz build --serve`.
|
||||
|
||||
## Setup Steps
|
||||
|
||||
Follow these in order:
|
||||
|
||||
1. **[[installation|Installation]]** — Get Quartz (via GitHub template or clone), install dependencies, run the setup wizard (`npx quartz create`, which also installs plugins), and preview your site locally
|
||||
2. **[[authoring-content|Authoring Content]]** — Write and organize your Markdown notes in the `content/` folder
|
||||
3. **[[installation#Setting Up Your GitHub Repository|Push to GitHub]]** — Create a repository and push your site with `npx quartz sync`
|
||||
4. **[[hosting|Deploy]]** — Host your site for free on GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
|
||||
## Upgrading & Migrating
|
||||
|
||||
- **[[whats-new|What's New in Quartz 5]]** — Overview of new features and changes
|
||||
- **[[upgrading|Upgrading Quartz]]** — Keep your Quartz installation up to date
|
||||
- **[[migrating|Migrating to Quartz 5]]** — Migrate from Quartz 4 or Quartz 3
|
||||
@@ -0,0 +1,160 @@
|
||||
---
|
||||
title: "Installation"
|
||||
aliases:
|
||||
- "setting up your GitHub repository"
|
||||
---
|
||||
|
||||
This page walks you through the full Quartz setup: from getting the source code to previewing your site locally, then pushing it to GitHub.
|
||||
|
||||
## 1. Get Quartz
|
||||
|
||||
There are two ways to get started. Pick whichever you prefer:
|
||||
|
||||
### Option A: Use the GitHub Template (Recommended)
|
||||
|
||||
> [!tip] Why this option?
|
||||
> Using the template creates your own repository in one click — no need to reconfigure Git remotes later.
|
||||
|
||||
1. Go to the [Quartz repository](https://github.com/jackyzha0/quartz) and click **Use this template** → **Create a new repository**
|
||||
2. Give your repository a name (e.g. `quartz`, `notes`, `garden`), choose public or private, then click **Create repository**
|
||||
3. Clone **your new repository** and enter the folder:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/<your-username>/<your-repo>.git
|
||||
cd <your-repo>
|
||||
```
|
||||
|
||||
### Option B: Clone Directly
|
||||
|
||||
If you don't use GitHub or prefer a manual setup:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> With this option, you'll need to [[#Connect Your Local Clone|point the `origin` remote]] to your own repository later when you're ready to publish.
|
||||
|
||||
## 2. Install Dependencies
|
||||
|
||||
> [!important]
|
||||
> Quartz requires **Node.js 22.22** or later. Check your version with `node -v` and upgrade at [nodejs.org](https://nodejs.org/) if needed.
|
||||
|
||||
```bash
|
||||
npm i
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> On subsequent clones of your own repository (e.g. on a new machine), use `npm ci` instead for a faster, reproducible install from the lockfile.
|
||||
|
||||
## 3. Initialize Your Site
|
||||
|
||||
Run the interactive setup wizard:
|
||||
|
||||
```bash
|
||||
npx quartz create
|
||||
```
|
||||
|
||||
This will prompt you for:
|
||||
|
||||
- A **template** (`default`, `obsidian`, `ttrpg`, `blog`, `docs`) — pick the one that matches your use case. See [[create#Templates]] for details on each.
|
||||
- A **content strategy** — choose how to populate the `content/` folder:
|
||||
- **new**: Start with an empty folder
|
||||
- **copy**: Copy files from an existing folder (e.g. your Obsidian vault)
|
||||
- **symlink**: Link to an existing folder so changes sync automatically
|
||||
- A **base URL** — the URL where your site will be deployed (e.g. `mysite.github.io/quartz`). Don't include `https://`.
|
||||
- A **link resolution** strategy — how to resolve internal links (`shortest`, `absolute`, or `relative`). Skipped for Obsidian and TTRPG templates.
|
||||
|
||||
For non-interactive usage and more details, see the [[create|`quartz create` CLI reference]].
|
||||
|
||||
## 4. Plugins
|
||||
|
||||
`npx quartz create` already installed the plugins your template uses: the default plugins are npm packages installed by `npm i`, and any Git plugins the template references are downloaded into `.quartz/plugins/`. If you later add Git plugins to `quartz.config.yaml` by hand, install them with:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> If some plugins fail to build, try refreshing them to their latest versions:
|
||||
>
|
||||
> ```bash
|
||||
> npx quartz plugin install --latest
|
||||
> ```
|
||||
>
|
||||
> See [[troubleshooting#Plugins fail to build on a fresh clone]] for more details.
|
||||
|
||||
## 5. Preview Your Site
|
||||
|
||||
```bash
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
Your site is now running at `http://localhost:8080`. The dev server watches for file changes and reloads automatically.
|
||||
|
||||
At this point you can [[authoring-content|start writing content]] in the `content/` folder. When you're ready to publish, continue below to push your site to GitHub and [[hosting|deploy it]].
|
||||
|
||||
---
|
||||
|
||||
## Setting Up Your GitHub Repository
|
||||
|
||||
> [!note]
|
||||
> If you used **Option A** (GitHub Template) in step 1, your repository already exists and `origin` is already set. You can skip straight to [[#Push Your Site]].
|
||||
|
||||
To publish your site, you'll need your own GitHub repository. This section is for **Option B** (direct clone) users.
|
||||
|
||||
### Create the Repository
|
||||
|
||||
Create a new repository on [GitHub.com](https://github.com/new). Do **not** initialize it with a README, license, or `.gitignore` — Quartz already includes these files, and duplicating them will cause merge conflicts on your first push.
|
||||
|
||||
![[github-init-repo-options.png]]
|
||||
|
||||
Copy the repository URL from the Quick Setup page:
|
||||
|
||||
![[github-quick-setup.png]]
|
||||
|
||||
### Connect Your Local Clone
|
||||
|
||||
Point your local Quartz at your new repository:
|
||||
|
||||
```bash
|
||||
# Check current remotes
|
||||
git remote -v
|
||||
|
||||
# Point origin to your repository
|
||||
git remote set-url origin REMOTE-URL
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> You don't need to add an `upstream` remote manually — `npx quartz create` already configured it for you. The upstream remote is used by `npx quartz upgrade` to pull in future Quartz updates.
|
||||
|
||||
### Push Your Site
|
||||
|
||||
```bash
|
||||
npx quartz sync --no-pull
|
||||
```
|
||||
|
||||
This commits your content and pushes everything to your repository. For subsequent updates, just run:
|
||||
|
||||
```bash
|
||||
npx quartz sync
|
||||
```
|
||||
|
||||
> [!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:
|
||||
>
|
||||
> - `-d` or `--directory`: the content folder. This is normally just `content`
|
||||
> - `-v` or `--verbose`: print out extra logging information
|
||||
> - `--commit` or `--no-commit`: whether to make a `git` commit for your changes
|
||||
> - `-m` or `--message`: the commit message (default: `Quartz sync: <date and time>`)
|
||||
> - `--push` or `--no-push`: whether to force-push updates to your GitHub fork of Quartz
|
||||
> - `--pull` or `--no-pull`: whether to try and pull in any updates from your GitHub fork (i.e. from other devices) before pushing
|
||||
|
||||
## Next Steps
|
||||
|
||||
- **[[authoring-content|Authoring Content]]** — Write and organize your notes
|
||||
- **[[hosting|Hosting]]** — Deploy your site to GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
- **[[configuration|Configuration]]** — Customize your site's appearance and behavior
|
||||
@@ -0,0 +1,228 @@
|
||||
---
|
||||
title: "Migrating to Quartz 5"
|
||||
aliases:
|
||||
- "migrating from Quartz 3"
|
||||
- "migrating from Quartz 4"
|
||||
---
|
||||
|
||||
This guide covers migrating to Quartz 5 from previous versions. If you're already on Quartz 5 and want to update to the latest version, see [[upgrading|Upgrading Quartz]] instead.
|
||||
|
||||
If you're new to Quartz entirely, skip this guide and follow the [[installation|installation guide]] instead.
|
||||
|
||||
## Before You Start: Save Your Content
|
||||
|
||||
Before switching branches, make sure your content is safe. Switching to v5 will replace the files in your working directory with the v5 codebase, so your v4 content folder won't be visible until you restore it.
|
||||
|
||||
Copy your content folder somewhere outside the repo before switching:
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
cp -r content /tmp/quartz-content
|
||||
|
||||
# Windows (PowerShell)
|
||||
Copy-Item -Recurse content $env:TEMP\quartz-content
|
||||
```
|
||||
|
||||
> [!note] Your old branch is preserved
|
||||
> Switching branches does **not** delete your v4 (or v3/hugo) branch. You can always switch back with `git checkout v4` to access your old content and configuration.
|
||||
|
||||
## Getting the v5 Branch
|
||||
|
||||
Whether you're coming from Quartz 4 or Quartz 3, the first step is the same: get the v5 branch onto your machine and push it to your repository.
|
||||
|
||||
```bash
|
||||
# Add the official Quartz repository as a remote called "upstream" (skip if already set)
|
||||
git remote add upstream https://github.com/jackyzha0/quartz.git
|
||||
|
||||
# Fetch the v5 branch from the official repository
|
||||
git fetch upstream v5
|
||||
|
||||
# Create a local v5 branch from the official one
|
||||
git checkout -b v5 upstream/v5
|
||||
|
||||
# Install dependencies
|
||||
npm i
|
||||
|
||||
# Push v5 to your GitHub repository
|
||||
git push -u origin v5
|
||||
```
|
||||
|
||||
## Setting Up Your Site
|
||||
|
||||
Once you're on v5, run the interactive setup to configure your site and import your content:
|
||||
|
||||
```bash
|
||||
npx quartz create
|
||||
```
|
||||
|
||||
This will prompt you for:
|
||||
|
||||
- A **template** (`default`, `obsidian`, `ttrpg`, `blog`, `docs`) — pick the one closest to your old setup. `obsidian` is recommended if you use an Obsidian vault.
|
||||
- A **content strategy** — choose "Copy" and point it to your backed-up content folder.
|
||||
|
||||
If you skipped the `create` wizard or need to restore your content manually:
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
cp -r /tmp/quartz-content/* content/
|
||||
|
||||
# Windows (PowerShell)
|
||||
Copy-Item -Recurse $env:TEMP\quartz-content\* content\
|
||||
```
|
||||
|
||||
`create` also installs the plugins the chosen template references, so there is no separate install step.
|
||||
|
||||
## What Changed in v5
|
||||
|
||||
Quartz 5 introduces a community plugin system that fundamentally changes how plugins and components are managed. Most plugins that were built into Quartz 4 are now standalone community plugins maintained under the [quartz-community](https://github.com/quartz-community) organization.
|
||||
|
||||
Key changes:
|
||||
|
||||
- **Configuration format**: TypeScript (`quartz.config.ts`, `quartz.layout.ts`) → YAML (`quartz.config.yaml`)
|
||||
- **Plugin system**: Plugins are now standalone packages. The default ones are npm packages that ship with Quartz; others are added with `npx quartz plugin add`
|
||||
- **Import pattern**: Community plugins use `ExternalPlugin.X()` (from `.quartz/plugins`) instead of `Plugin.X()` (from `./quartz/plugins`)
|
||||
- **Layout structure**: `quartz.layout.ts` is gone — layout position is now a per-plugin property in `quartz.config.yaml`
|
||||
- **Page types**: A new plugin category for page rendering (content, folder, tag pages)
|
||||
- **URL casing**: All generated URLs are now lowercased and hyphenated (e.g. `My Notes/Hello World.md` → `/my-notes/hello-world`). In v4, the original casing of file and folder names was preserved in URLs.
|
||||
- **Line breaks**: a single line break inside a paragraph renders as `<br>`, as in Obsidian (v4 rendered a space). Set `strictLineBreaks: true` in the [[ObsidianFlavoredMarkdown]] options for the v4 behaviour.
|
||||
- **Heading ids**: heading ids follow GitHub, so some differ from v4 (`## Range 1--2` → `#range-1--2`, was `#range-12`). Links that hard-code an old id need updating; `[[page#Range 1--2]]` keeps working.
|
||||
|
||||
### URL Casing and SEO
|
||||
|
||||
If your v4 site had URLs with uppercase letters, those URLs will return 404 errors after upgrading to v5. This also affects search engine indexing, since Google treats URLs as [case-sensitive](https://developers.google.com/search/docs/crawling-indexing/url-structure).
|
||||
|
||||
The [[AliasRedirects]] plugin (enabled by default) automatically handles this. During build, it detects files whose original path contained uppercase characters and generates redirect pages at the old URLs. These redirect pages include proper SEO signals (`<link rel="canonical">`, `<meta http-equiv="refresh">`, `<meta name="robots" content="noindex">`) so that search engines transfer ranking to the new lowercase URLs.
|
||||
|
||||
No manual configuration is needed — the plugin is enabled by default and the case redirect behavior is on by default. If you want to disable it, set `enableCaseRedirects: false` in the plugin options:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/alias-redirects
|
||||
enabled: true
|
||||
options:
|
||||
enableCaseRedirects: false
|
||||
```
|
||||
|
||||
> [!tip] Hosting on Netlify?
|
||||
> Netlify automatically lowercases all URLs and issues server-side 301 redirects. If you're hosting on Netlify, the case redirect pages aren't strictly necessary, but they don't hurt either.
|
||||
|
||||
> [!note] Most users don't need to worry about these details
|
||||
> If you used the default Quartz 4 configuration (or only changed settings that `npx quartz create` prompts for), the setup wizard handles everything. The details below are for users who had custom plugin configurations.
|
||||
|
||||
### Plugin Reference Table
|
||||
|
||||
Mapping v4 plugin names to v5 equivalents:
|
||||
|
||||
| v4 | v5 | Type |
|
||||
| ----------------------------------- | ------------------------------------------- | --------------------- |
|
||||
| `Plugin.FrontMatter()` | built in (`configuration.frontmatter`) | Internal |
|
||||
| `Plugin.CreatedModifiedDate()` | `ExternalPlugin.CreatedModifiedDate()` | Community |
|
||||
| `Plugin.SyntaxHighlighting()` | `ExternalPlugin.SyntaxHighlighting()` | Community |
|
||||
| `Plugin.ObsidianFlavoredMarkdown()` | `ExternalPlugin.ObsidianFlavoredMarkdown()` | Community |
|
||||
| `Plugin.GitHubFlavoredMarkdown()` | `ExternalPlugin.GitHubFlavoredMarkdown()` | Community |
|
||||
| `Plugin.CrawlLinks()` | built in (`configuration.links`) | Internal |
|
||||
| `Plugin.Description()` | `ExternalPlugin.Description()` | Community |
|
||||
| `Plugin.Latex()` | `ExternalPlugin.Latex()` | Community |
|
||||
| `Plugin.RemoveDrafts()` | built in (`configuration.drafts`) | Internal |
|
||||
| `Plugin.ContentPage()` | `ExternalPlugin.ContentPage()` | Community (pageTypes) |
|
||||
| `Plugin.FolderPage()` | `ExternalPlugin.FolderPage()` | Community (pageTypes) |
|
||||
| `Plugin.TagPage()` | `ExternalPlugin.TagPage()` | Community (pageTypes) |
|
||||
| `Plugin.NotFoundPage()` | `Plugin.PageTypes.NotFoundPageType()` | Internal (pageTypes) |
|
||||
| `Plugin.ComponentResources()` | `Plugin.ComponentResources()` (unchanged) | Internal |
|
||||
| `Plugin.Assets()` | `Plugin.Assets()` (unchanged) | Internal |
|
||||
| `Plugin.Static()` | `Plugin.Static()` (unchanged) | Internal |
|
||||
| `Plugin.AliasRedirects()` | `ExternalPlugin.AliasRedirects()` | Community |
|
||||
| `Plugin.ContentIndex()` | built in (`configuration.contentIndex`) | Internal |
|
||||
|
||||
Component layout mapping (`ExternalPlugin` is imported from `./.quartz/plugins` in `quartz.ts`):
|
||||
|
||||
| v4 Layout | v5 Layout |
|
||||
| ----------------------------- | ---------------------------------------- |
|
||||
| `Component.Explorer()` | `ExternalPlugin.Explorer()` |
|
||||
| `Component.Graph()` | `ExternalPlugin.Graph()` |
|
||||
| `Component.Search()` | `ExternalPlugin.Search()` |
|
||||
| `Component.Backlinks()` | `ExternalPlugin.Backlinks()` |
|
||||
| `Component.Darkmode()` | `ExternalPlugin.Darkmode()` |
|
||||
| `Component.Footer()` | `ExternalPlugin.Footer()` |
|
||||
| `Component.TableOfContents()` | `ExternalPlugin.TableOfContents()` |
|
||||
| `Component.Head()` | `Component.Head()` (unchanged, internal) |
|
||||
| `Component.Spacer()` | `ExternalPlugin.Spacer()` |
|
||||
|
||||
If you edited a component's source in `quartz/components/` (for example `Footer.tsx`), that no longer works: components are now installed plugins. See [[customizing components]] for the v5 ways to change them.
|
||||
|
||||
## Updating Your CI/CD
|
||||
|
||||
Quartz 5 requires plugins to be installed before building. Add a plugin install step and (optionally) caching to your CI pipeline.
|
||||
|
||||
Here's the recommended pattern, based on the project's own GitHub Actions:
|
||||
|
||||
```yaml
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Build Quartz
|
||||
run: npx quartz build
|
||||
```
|
||||
|
||||
The plugin cache uses `quartz.lock.json` as the cache key, so plugins are only re-downloaded when the lockfile changes.
|
||||
|
||||
For non-GitHub CI providers (Cloudflare, Vercel, Netlify), the build command should be:
|
||||
|
||||
```shell
|
||||
npx quartz plugin install && npx quartz build
|
||||
```
|
||||
|
||||
See [[hosting]] for provider-specific setup details.
|
||||
|
||||
## Setting Your Default Branch to v5
|
||||
|
||||
After verifying your site builds and deploys correctly, update your repository's default branch to `v5`:
|
||||
|
||||
1. Go to your repository on GitHub
|
||||
2. Navigate to **Settings** → **General**
|
||||
3. Under **Default branch**, click the switch icon next to your current default branch
|
||||
4. Select `v5` from the dropdown and click **Update**
|
||||
5. Confirm the change
|
||||
|
||||
This ensures that new clones, pull requests, and GitHub Pages deployments all target v5 by default. Your old v4 branch remains available for reference.
|
||||
|
||||
> [!warning] Update your CI triggers
|
||||
> If your CI workflow triggers on a specific branch (e.g. `branches: [v4]`), make sure to update it to `v5`. See the [[hosting]] guide for examples.
|
||||
|
||||
## Notes for Quartz 3 Users
|
||||
|
||||
If you're coming from Quartz 3 (the Hugo-based version), follow the same steps above — get the v5 branch, run `npx quartz create`, and import your content. There is no need to go through Quartz 4 first.
|
||||
|
||||
### Key changes from Quartz 3
|
||||
|
||||
1. **Hugo is gone**: Quartz now uses a Node-based static-site generation process. No more Go templates or `hugo-obsidian`.
|
||||
2. **Full hot-reload**: The development server (`npx quartz build --serve`) re-processes all content on every change.
|
||||
3. **JSX instead of Go templates**: Layout components are written in JSX (JavaScript XML), which is significantly easier to customize.
|
||||
4. **New plugin system**: See [[configuration#Plugins|Plugins]] for details on the extensible plugin architecture.
|
||||
|
||||
### Things to update
|
||||
|
||||
- Update your deploy scripts — see the [[hosting]] guide.
|
||||
- Ensure your default branch on GitHub is updated to `v5`.
|
||||
- [[folder and tag listings|Folder and tag listings]] have changed:
|
||||
- Folder descriptions go under `content/<folder-name>/index.md`
|
||||
- Tag descriptions go under `content/tags/<tag-name>.md`
|
||||
- Custom CSS may need updates if you depended on specific HTML hierarchy or class names from Quartz 3.
|
||||
@@ -0,0 +1,203 @@
|
||||
---
|
||||
title: "Upgrading Quartz"
|
||||
aliases:
|
||||
- upgrading
|
||||
---
|
||||
|
||||
> [!note]
|
||||
> This is specifically a guide for upgrading your Quartz to a more recent update. If you are coming from Quartz 4 or Quartz 3, check out the [[migrating|migration guide]] for more info.
|
||||
|
||||
To fetch the latest Quartz updates, simply run
|
||||
|
||||
```bash
|
||||
npx quartz upgrade
|
||||
```
|
||||
|
||||
As Quartz uses [git](https://git-scm.com/) under the hood for versioning, upgrading effectively 'pulls' in the updates from the official Quartz GitHub repository. Merge conflicts in `quartz.lock.json` are handled automatically — Quartz backs up your lockfile before pulling and restores it afterward. For other files with local changes that conflict with the updates, you may need to resolve these manually yourself (or pull manually with `git pull upstream v5`).
|
||||
|
||||
> [!hint]
|
||||
> Quartz will try to cache your content before upgrading 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).
|
||||
|
||||
To update your installed plugins separately, use:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
See the [[upgrade|CLI reference for upgrade]] for more details on available flags.
|
||||
|
||||
## Upgrading from 5.2 to 5.3
|
||||
|
||||
Quartz 5.3 needs **Node.js 22.22 or later**. Then upgrade as usual:
|
||||
|
||||
```bash
|
||||
npx quartz upgrade
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
### Changes you may notice
|
||||
|
||||
- **Block anchors**: a block's id is now `^id` and links to it are `#^id` (`[[note#^para-1]]` → `note#^para-1`, was `note#para-1`), as in Obsidian, where blocks and headings are separate namespaces: block `^para-1` and heading `## Para 1` no longer share an id, so `[[#^para-1]]` and `[[#Para 1]]` each land on their own target. Links inside the site are regenerated; old `#id` URLs of blocks from outside the site now go to the top of the page (or to a heading of that name). CSS or scripts that select a block by id need `#\^para-1` (or `getElementById`).
|
||||
- **Unresolved links**: `configuration.links.disableBrokenWikilinks` is now on by default. Links to pages that don't exist get the `broken` class and are styled as unresolved, as in Obsidian. Links to pages a filter removes (drafts, unpublished notes) are marked the same way, with `data-filtered="<filter>"`. Set `links.disableBrokenWikilinks: false` to style them as before.
|
||||
- **Mermaid diagrams** render with [Pele](https://pele.run) by default, as in Obsidian, inside a `<div class="mermaid">` rather than a code block. Set `diagramRenderer: mermaid` on [[ObsidianFlavoredMarkdown]] to keep Mermaid.js. See [[Mermaid diagrams]].
|
||||
- **Block wrappers**: each top-level block of a note is wrapped in the `div` Obsidian puts it in (`div.el-p > p`, `div.el-h2 > h2`). Custom CSS that selects a page's blocks as direct children (`article > p`) no longer matches. Select them without `>`, or set `blockWrappers: false` on ObsidianFlavoredMarkdown.
|
||||
- **Transclusions** use Obsidian's embed markup: the title of a whole-note embed is a `div.markdown-embed-title` (it was an `h1`), and the content is in `div.markdown-embed-content`. It looks the same without a theme. Custom CSS for transclusions may need new selectors.
|
||||
- **Page structure**: the centre column is a `<main>` (it was a `div`; the `center` class is unchanged) and the default frame's sidebars are `<aside>` elements. Page listings use `h2` titles (they were `h3`) at the same size. Footnote links keep the `internal` class but no longer have `internal-link`.
|
||||
- **Colours**: the templates' `gray` and `tertiary` colours meet WCAG AA contrast. Your site keeps the colours in its own `quartz.config.yaml`. To adopt the new ones, set them under `configuration.theme.colors`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
theme:
|
||||
colors:
|
||||
lightMode:
|
||||
gray: "#727272" # was #b8b8b8
|
||||
tertiary: "#587971" # was #84a59d
|
||||
darkMode:
|
||||
gray: "#7f7f7f" # was #646464
|
||||
```
|
||||
|
||||
- **Folding**: the `obsidian` template folds headings and lists. Other sites can turn it on with `foldHeadings` and `foldLists` on ObsidianFlavoredMarkdown.
|
||||
- **Stylesheets**: component styles are one `component-<hash>.css` file instead of one per component. The styles are unchanged.
|
||||
- **Frontmatter** is read as YAML 1.2. Frontmatter with only comments has no properties, as in Obsidian, instead of being reported as invalid.
|
||||
- **Custom TypeScript**: type checking (`npm run check`) uses TypeScript 7 with `moduleResolution: bundler`. Code that imports a package's internal files may need to import from the package itself.
|
||||
|
||||
### New options
|
||||
|
||||
- `extends` (experimental) and `before`/`after` on plugin entries. See [[configuration#Extending the default configuration]].
|
||||
- `configuration.slugs.stripDiacritics`. See [[configuration#General Configuration]].
|
||||
- The layout conditions `is-index`, `is-folder-index` and `not-<condition>`. See [[layout#Conditional Rendering]].
|
||||
- [[plugins/Explorer|Explorer]]: `sort`, `rootFolder`, and `order` in YAML. [[GitHubFlavoredMarkdown]]: `singleTilde`, `replacements`. [[ObsidianFlavoredMarkdown]]: `math`, `markdownEmbeds`, `blockWrappers`, `foldHeadings`, `foldLists`. [[CanvasPage]]: `wheelBehavior`, `textNodeMarkdown`.
|
||||
|
||||
See [[whats-new#New in 5.3|What's new in 5.3]] for everything else.
|
||||
|
||||
## Upgrading from 5.1 to 5.2
|
||||
|
||||
```bash
|
||||
npx quartz upgrade
|
||||
npx quartz plugin doctor --fix
|
||||
```
|
||||
|
||||
`--fix` moves the Fonts plugin's entry (`@quartz-community/quartz-fonts`) into `configuration.fonts`, now that font loading is built in. Until you run it, the entry keeps working and is applied automatically.
|
||||
|
||||
### Changes you may notice
|
||||
|
||||
- **Themes**: [[ThemesCore]] 3 converts Obsidian themes at build time, so the `@quartz-themes/<theme>` packages are no longer needed. Theme ids from 2.x (`tokyo-night`) keep working. The `aspects`, `include`, `calloutStyle` and `fonts` options were removed.
|
||||
- **Callouts and transclusions** render as `<div>` elements, as in Obsidian (callouts were `<blockquote>`). Callout titles are in `.callout-title-inner` without a `<p>`. Custom CSS for either may need new selectors.
|
||||
- **Bases** columns are labelled with the property's name (`priority`, `file name`) instead of title case (`Priority`, `Name`). Set `propertyLabels: title` on [[BasesPage]] for the old labels.
|
||||
- **Permalinks** with `.` or `..` segments are ignored with a warning.
|
||||
- **Fonts**: configured `body`, `code` and `interface` fonts now apply under an Obsidian theme, and the interface and heading fonts are loaded from Google Fonts like the others.
|
||||
|
||||
See [[whats-new#New in 5.2|What's new in 5.2]] for everything else.
|
||||
|
||||
## Upgrading from 5.0 to 5.1
|
||||
|
||||
Run the upgrade, then let `plugin doctor` update your config:
|
||||
|
||||
```bash
|
||||
npx quartz upgrade
|
||||
npx quartz plugin doctor --fix
|
||||
```
|
||||
|
||||
`upgrade` shows the release notes since your version and runs `plugin doctor` for you. `--fix` moves the entries of plugins that are now [[built-in processing|built into Quartz]] (`crawl-links`, `remove-draft`, `content-index`, and note-properties' `delimiters`/`language` options) into `configuration.links`, `drafts`, `contentIndex` and `frontmatter`, and removes their unused pins from `quartz.lock.json`. Until you run it, those entries keep working and are applied automatically.
|
||||
|
||||
### Changes you may notice
|
||||
|
||||
- **Line breaks**: a single line break inside a paragraph now renders as `<br>`, as in Obsidian's reading view ([[ObsidianFlavoredMarkdown]] 2.0). Set `strictLineBreaks: true` in its options to keep the old behaviour (a space). The [[HardLineBreaks]] plugin is deprecated and no longer in the default config; Quartz warns while it is enabled.
|
||||
- **Plugin order**: [[GitHubFlavoredMarkdown]] now runs before ObsidianFlavoredMarkdown (`order` 30, then 40). If your config sets `order` for either, keep GitHubFlavoredMarkdown first. Strikethrough (`~~`) now follows Obsidian's rules.
|
||||
- **Heading ids**: a heading containing `--` gets the same id as on GitHub (`## Range 1--2` → `#range-1--2`, was `#range-12`). Links that hard-code an old id need updating; `[[page#Range 1--2]]` keeps working.
|
||||
- **Bases** behave as in Obsidian 1.15 ([[BasesPage]] 1.2): `file.name` of a Markdown note has no extension (`Note`; `file.fullname` has it), `file.tags` keeps `#` and the original case, nested tags match (`#project` finds `#project/x`), the cards' `imageAspectRatio` is height/width (it was inverted), a base opens on its first view, and subtracting dates gives a duration (`(due - today()).days`).
|
||||
- **Permalinks** are now the page's address: `permalink: page` publishes the note at `/page`, and its file path redirects there. Before, the permalink only redirected to the file path. See [[authoring-content|frontmatter fields]].
|
||||
- **Frontmatter**: `---js` / `---javascript` frontmatter is refused, and invalid frontmatter (e.g. broken YAML) stops the build with an error naming the file.
|
||||
- **Plugins in CI**: builds with `CI` set (GitHub Actions, Cloudflare Pages, Netlify, Vercel, …) fail on plugins that fail to load or need a newer Quartz. Set `QUARTZ_ALLOW_BROKEN_PLUGINS=1` or `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1` to deploy anyway. See [[troubleshooting#Reading build output]].
|
||||
|
||||
### New options
|
||||
|
||||
- `configuration.prefetch` (default `viewport`): pages are fetched before their links are followed. See [[prefetching]].
|
||||
- `configuration.publishAssets: referenced` copies only the files published pages use, so files used only by unpublished notes stay private (default `all`).
|
||||
- `layout.sidebars`: how sidebars taller than the screen behave (`fit`, `scroll`, `static`). See [[layout#Sidebar modes]].
|
||||
|
||||
See [[whats-new#New in 5.1|What's new in 5.1]] for everything else.
|
||||
|
||||
### Layout System Changes
|
||||
|
||||
The `footer` layout slot is now an array of components, consistent with other layout slots like `header`, `left`, and `right`. Additionally, `header` and `footer` are now configurable layout positions — plugins can declare `layout: { position: header }` or `layout: { position: footer }` in their YAML config.
|
||||
|
||||
**If you override layouts in `quartz.ts`**, update any `footer` assignments to use arrays:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
// Before
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: { footer: MyFooterComponent },
|
||||
})
|
||||
|
||||
// After
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: { footer: [MyFooterComponent] },
|
||||
})
|
||||
```
|
||||
|
||||
**If you have a custom page frame**, update the `render` function to iterate the footer array:
|
||||
|
||||
```tsx
|
||||
// Before
|
||||
render({ footer: Footer, ...rest }: PageFrameProps) {
|
||||
return <Footer {...componentData} />
|
||||
}
|
||||
|
||||
// After
|
||||
render({ footer, ...rest }: PageFrameProps) {
|
||||
return footer.map((F) => <F {...componentData} />)
|
||||
}
|
||||
```
|
||||
|
||||
Both changes are caught by TypeScript at compile time — running `npx quartz build` will show the error.
|
||||
|
||||
No changes are needed for `quartz.config.yaml` — the YAML format is unchanged.
|
||||
|
||||
### Cleaning Up Unused Plugins
|
||||
|
||||
If you've removed plugins from your configuration during an upgrade, you can clean up the leftover files:
|
||||
|
||||
```bash
|
||||
npx quartz plugin prune --dry-run # preview what would be removed
|
||||
npx quartz plugin prune # remove orphaned plugins
|
||||
```
|
||||
|
||||
See the [[cli/plugin#prune|plugin prune reference]] for more details.
|
||||
|
||||
## Switching to npm Plugin Specifiers
|
||||
|
||||
First-party Quartz plugins are now published to npm under the `@quartz-community` scope. If your `quartz.config.yaml` uses `github:` specifiers, you can optionally switch to npm specifiers for faster installs and better version pinning.
|
||||
|
||||
### Why Switch?
|
||||
|
||||
- **Faster installs**: npm packages are cached locally and don't require git cloning
|
||||
- **Version pinning**: npm uses semver ranges, so you control when to update
|
||||
- **No build step**: npm packages ship pre-built, unlike git sources which may need to build on install
|
||||
|
||||
### How to Migrate
|
||||
|
||||
Update each plugin source in your `quartz.config.yaml` from the `github:` format to the quoted npm format:
|
||||
|
||||
```yaml
|
||||
# Before
|
||||
plugins:
|
||||
- source: github:quartz-community/syntax-highlighting
|
||||
enabled: true
|
||||
|
||||
# After
|
||||
plugins:
|
||||
- source: "@quartz-community/syntax-highlighting"
|
||||
enabled: true
|
||||
```
|
||||
|
||||
> [!important]
|
||||
> The `@` scoped name must be quoted in YAML. Use double quotes around the source value.
|
||||
|
||||
The default plugins are already dependencies in Quartz's `package.json`, so `npm i` installs them — no separate install step is needed. For other npm plugins, use `npx quartz plugin add "@scope/plugin-name"`, which installs the package and adds the entry for you.
|
||||
|
||||
### Do I Have to Switch?
|
||||
|
||||
No. The `github:` specifiers continue to work and will be supported indefinitely. They are still the recommended approach for third-party and community plugins that are not published to npm. The npm path is an optional improvement for first-party plugins.
|
||||
@@ -0,0 +1,245 @@
|
||||
---
|
||||
title: "What's New in Quartz 5"
|
||||
aliases:
|
||||
- "changelog"
|
||||
- "v5"
|
||||
---
|
||||
|
||||
Quartz 5 is a ground-up rearchitecture of Quartz focused on extensibility, performance, and Obsidian compatibility. If you're coming from v4, see [[migrating|Migrating to Quartz 5]] for the upgrade path.
|
||||
|
||||
## New in 5.3
|
||||
|
||||
Upgrading from 5.2? See [[upgrading#Upgrading from 5.2 to 5.3|Upgrading from 5.2 to 5.3]] for the changes you may notice.
|
||||
|
||||
- **Accessibility** — the templates' colours meet WCAG AA contrast, and so does text in the table of contents, footer, folder and tag listings, search button and Bases group headings. The centre column is a `<main>` and the sidebars are `<aside>` elements, page listings no longer skip heading levels, and ARIA attributes and ids are valid in the table of contents, explorer, backlinks, heading anchors and Bases views.
|
||||
- **Faster pages** — component styles are one stylesheet (about 20 fewer render-blocking requests per page), the [[graph view]] loads d3 and PixiJS only when it is shown and opens five times faster on large sites, and KaTeX's stylesheet no longer blocks pages without math.
|
||||
- **Back and Forward** — with [[SPA Routing]], Back and Forward return to where you were on each page, and moving between headings of the same page only scrolls.
|
||||
- **Markup as in Obsidian** — [[ObsidianFlavoredMarkdown]] wraps each top-level block in Obsidian's `div.el-*` wrappers, renders [[Mermaid diagrams]] with Pele by default, and can fold headings and lists (`foldHeadings`, `foldLists`; on in the `obsidian` template). Transclusions use Obsidian's embed markup, a missing attachment reads "could not be found", and notes embedded with a Markdown link (``) are transcluded. Obsidian themes ([[ThemesCore]] 3.2) style all of these.
|
||||
- **Unresolved links** — links to pages that don't exist, or that a filter removed (drafts, [[ExplicitPublish]]), get the `broken` class, as Obsidian marks unresolved links (`links.disableBrokenWikilinks` is on by default). See [[CrawlLinks]].
|
||||
- **Extending a configuration** (experimental) — `extends: default` in `quartz.config.yaml` keeps only your changes to the default configuration; it also takes a path or an `https://` URL. Several presets can be listed and stack. Plugin entries can declare `before:` / `after:` other plugins. See [[configuration#Extending the default configuration]].
|
||||
- **Slugs without accents** — `configuration.slugs.stripDiacritics` publishes `české/čeština.md` at `/ceske/cestina` and `Łódź.md` at `/lodz`, so URLs in Latin-script languages need no percent-encoding; other scripts are left as written. See [[configuration#General Configuration]].
|
||||
- **Layout conditions** — `is-index` (home page), `is-folder-index`, and `not-<condition>` for any condition (`not-has-tags`). See [[layout#Conditional Rendering]].
|
||||
- **Explorer** 1.2 — sort from YAML with rules applied in sequence (`sort: [folder, { by: date, direction: desc }]`), several explorers on a page (`rootFolder`), and `order` in YAML. See [[plugins/Explorer|Explorer]].
|
||||
- **Plugin options** — [[GitHubFlavoredMarkdown]]: `singleTilde` and `replacements` (for example Quartz 4's arrows); [[ObsidianFlavoredMarkdown]]: `math`; [[CanvasPage]]: the wheel and trackpad pan the canvas as in Obsidian, and text nodes render with the site's Markdown plugins (Mermaid, callouts, math).
|
||||
- **Link previews and search engines** — each page has a canonical link, and `og:url`, `og:type` and the article times are set as Open Graph readers expect.
|
||||
- **Content index** — `contentIndex.json` entries carry the page's `date`, for client-side components such as the explorer.
|
||||
- **Releases** — release tags are verified on GitHub, and each release publishes a versioned Docker image.
|
||||
|
||||
## New in 5.2
|
||||
|
||||
Upgrading from 5.1? See [[upgrading#Upgrading from 5.1 to 5.2|Upgrading from 5.1 to 5.2]].
|
||||
|
||||
- **Obsidian themes** — [[ThemesCore]] 3.1 converts any Obsidian community theme at build time: name it as Obsidian lists it (`Minimal`, `AnuPpuccin`), or give a GitHub repository, a URL or a local `theme.css`. Style Settings exports and CSS snippets apply as in Obsidian.
|
||||
- **Fonts built in** — font loading is part of Quartz as `configuration.fonts` (formerly the Fonts plugin), including the interface font and per-heading fonts. See [[configuration#Fonts]].
|
||||
- **`quartz build --config <path>`** — read the configuration from another file, so it can live with your content and one Quartz install can build several sites.
|
||||
- **Bases** closer to Obsidian ([[BasesPage]] 1.5) — custom summaries, `html()`, `image()`, `icon()`, regular expressions and `file.backlinks` in formulas, `kanban` views, `groupOrder`, grouped lists and cards, and columns labelled with the property's name. Bases inside a transcluded note render, and links in bases follow `configuration.links`.
|
||||
- **Transclusions** — headings and footnotes inside a transclusion get ids unique on the page, and a heading transclusion holds only the footnotes it references.
|
||||
- **Permalinks on large sites** — notes with a `permalink` are published at it on sites of any size.
|
||||
- **Plugins** can be async and declare `renderTransforms`, so encrypted notes show their bases and transclusions once unlocked ([[EncryptedPages]]).
|
||||
|
||||
## New in 5.1
|
||||
|
||||
Upgrading from 5.0? See [[upgrading#Upgrading from 5.0 to 5.1|Upgrading from 5.0 to 5.1]] for the steps and the changes you may notice.
|
||||
|
||||
- **[[prefetching|Prefetching]]** — pages are fetched before their links are followed, so they open at once (`configuration.prefetch`, default `viewport`). Works with and without SPA routing.
|
||||
- **[[built-in processing|Built-in processing]]** — frontmatter, link resolution, drafts and the content index are built into Quartz (`configuration.frontmatter`, `links`, `drafts`, `contentIndex`) instead of plugins that broke the site when disabled.
|
||||
- **`publishAssets: referenced`** — only copy the images and files that published pages use.
|
||||
- **Permalinks as addresses** — `permalink: page` publishes a note at `/page`, as in Obsidian Publish.
|
||||
- **Sidebar modes** — [[layout#Sidebar modes|`layout.sidebars`]] (`fit`, `scroll`, `static`) and a new `docs` template (`npx quartz create --template docs`).
|
||||
- **Markdown as in Obsidian** — [[ObsidianFlavoredMarkdown]] 2.0 parses with Obsidian's own parser: single line breaks render as `<br>`, inline footnotes (`text^[note]`), image sizes on Markdown images (``), themed Mermaid diagrams. [[GitHubFlavoredMarkdown]] now runs first, and headings get the same ids as on GitHub.
|
||||
- **Bases as in Obsidian 1.15** — [[BasesPage]] 1.2: durations, nested tags, `file.name`/`file.fullname`, Obsidian's card layout. Pages rendered from `.base`, `.canvas` and Excalidraw files follow your publish filters.
|
||||
- **`npx quartz info`** — prints your Quartz version, environment and plugins for bug reports.
|
||||
- **`npx quartz plugin doctor`** — checks your config, lockfile and installed plugins, and `--fix` migrates entries of plugins that are now built in. `npx quartz upgrade` shows the release notes and runs these checks.
|
||||
- **Clearer errors** — plugin errors name the plugin, what it was doing and the file; problems in content say so; broken or incompatible plugins fail CI builds. `--verbose` prints a layout report.
|
||||
- **Plugin compatibility** — a plugin's required Quartz version is checked (a warning locally, an error in CI), and deprecated plugins are flagged.
|
||||
- **Fixes** — Windows (npm plugins in `.quartz/plugins/index.ts`, local plugin paths, aliases, git dates), no sideways scrolling on phones, SPA navigation across redirects, and JavaScript frontmatter (`---js`) is no longer executed.
|
||||
|
||||
## Plugin Ecosystem
|
||||
|
||||
The biggest change in v5 is the move to a **community plugin ecosystem**. Plugins are now standalone packages maintained in the [quartz-community](https://github.com/quartz-community) GitHub organization. The default plugins are npm packages (`@quartz-community/explorer`) that ship with Quartz; others can be added from npm, git or a local folder:
|
||||
|
||||
```bash
|
||||
npx quartz plugin add github:quartz-community/explorer
|
||||
```
|
||||
|
||||
This means:
|
||||
|
||||
- **Independent versioning**: Plugins can be updated without upgrading Quartz itself
|
||||
- **Community contributions**: Anyone can publish a Quartz plugin
|
||||
- **Smaller core**: Quartz core is leaner; features live in plugins
|
||||
- **Plugin registry**: Discover plugins via `npx quartz tui` or the [plugin registry](https://github.com/quartz-community/registry)
|
||||
|
||||
Over 40 official plugins ship with Quartz, covering everything from search and graph view to encrypted pages and canvas rendering.
|
||||
|
||||
## YAML Configuration
|
||||
|
||||
Configuration moved from TypeScript (`quartz.config.ts`) to **YAML** (`quartz.config.yaml`):
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
pageTitle: My Digital Garden
|
||||
enableSPA: true
|
||||
enablePopovers: true
|
||||
locale: en-US
|
||||
baseUrl: mysite.github.io
|
||||
theme:
|
||||
typography:
|
||||
header: Schibsted Grotesk
|
||||
body: Source Sans Pro
|
||||
code: IBM Plex Mono
|
||||
plugins:
|
||||
- source: "@quartz-community/github-flavored-markdown"
|
||||
enabled: true
|
||||
order: 30
|
||||
- source: "@quartz-community/obsidian-flavored-markdown"
|
||||
enabled: true
|
||||
order: 40
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
```
|
||||
|
||||
Benefits:
|
||||
|
||||
- **No TypeScript knowledge required** for basic customization
|
||||
- **JSON Schema validation** — editors with YAML support show errors inline
|
||||
- **Layout defined per-plugin** — each plugin declares its own position and priority
|
||||
- **Templates** — `npx quartz create` offers preconfigured templates (default, obsidian, ttrpg, blog, docs)
|
||||
|
||||
For advanced options that need JavaScript (callbacks, custom components), the `quartz.ts` override system provides full programmatic control.
|
||||
|
||||
## Improved Obsidian Compatibility
|
||||
|
||||
Quartz 5 aims for full compatibility with Obsidian's core features:
|
||||
|
||||
- **Wikilinks** — all variations including aliases, headings, block references, and pipe escaping in tables
|
||||
- **Callouts** — all built-in types, collapsible variants, and nested callouts
|
||||
- **Highlights** — `==highlighted text==` syntax
|
||||
- **Comments** — `%%hidden comments%%` (inline and block)
|
||||
- **Tags** — `#tag` and `#nested/tag` with tag pages
|
||||
- **Custom task characters** — `[?]`, `[!]`, `[>]`, etc. preserved as `data-task` attributes
|
||||
- **Mermaid diagrams** — Mermaid.js default; [Pele](https://pele.run) via `diagramRenderer: pele`
|
||||
- **YouTube and Tweet embeds** — via image syntax
|
||||
- **Block references** — `^block-id` with broad character support
|
||||
- **Video/audio embeds** — full format support (mp4, webm, ogv, mov, mkv, avi, flac, aac, etc.)
|
||||
- **Canvas files** — rendered as interactive, pannable pages via the canvas-page plugin
|
||||
- **Obsidian URI links** — marked with CSS class for custom styling
|
||||
- **Footnotes** — including inline footnotes (`text^[note]`), parsed by the Obsidian Flavored Markdown plugin
|
||||
|
||||
See [[Obsidian compatibility]] for the full list.
|
||||
|
||||
## Page Type System
|
||||
|
||||
Quartz 5 introduces **page types** — plugins that define how different kinds of pages are rendered:
|
||||
|
||||
- **Content pages** — regular markdown notes
|
||||
- **Folder pages** — directory listing pages
|
||||
- **Tag pages** — pages listing notes with a given tag
|
||||
- **Canvas pages** — interactive JSON Canvas renderings
|
||||
- **Bases pages** — database-style views of your content
|
||||
|
||||
Each page type can use a different [[layout#Page Frames|page frame]] for fundamentally different HTML structures (three-column, full-width, minimal, etc.).
|
||||
|
||||
## Layout System
|
||||
|
||||
The layout system is now declarative. Plugins declare their position (`left`, `right`, `beforeBody`, `afterBody`) and priority in the config:
|
||||
|
||||
```yaml
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: "@quartz-community/graph"
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
```
|
||||
|
||||
Additional features:
|
||||
|
||||
- **Groups** — combine components into flex rows/columns (e.g., toolbar with search + darkmode toggle)
|
||||
- **Conditional rendering** — show/hide components based on page properties (`condition: not-index`, `condition: has-tags`)
|
||||
- **Display modifiers** — `display: mobile-only` or `display: desktop-only`
|
||||
- **Per-page-type overrides** — different layouts for content, folder, tag, and 404 pages
|
||||
|
||||
## Performance
|
||||
|
||||
- **Parallel processing** — markdown parsing uses a worker pool across all CPU cores
|
||||
- **Incremental rebuilds** — watch mode only re-processes changed files
|
||||
- **Pre-built plugins** — community plugins ship compiled `dist/` directories, skipping build-from-source on install
|
||||
- **SPA routing** — client-side navigation with `micromorph` for instant page transitions
|
||||
- **CDN-cached fonts** — Google Fonts with aggressive caching, or fully self-hosted with `fontOrigin: local`
|
||||
|
||||
## CLI Improvements
|
||||
|
||||
The CLI is simpler and more helpful:
|
||||
|
||||
| Command | Description |
|
||||
| -------------------------------- | ----------------------------------------- |
|
||||
| `npx quartz create` | Interactive setup wizard with templates |
|
||||
| `npx quartz build --serve` | Build and serve with hot reload |
|
||||
| `npx quartz sync` | Commit and push to GitHub |
|
||||
| `npx quartz upgrade` | Pull latest Quartz updates |
|
||||
| `npx quartz plugin install` | Install plugins from lockfile |
|
||||
| `npx quartz plugin add <source>` | Add a new plugin |
|
||||
| `npx quartz plugin list` | List installed plugins |
|
||||
| `npx quartz plugin prune` | Remove unused plugins |
|
||||
| `npx quartz plugin doctor` | Diagnose plugin problems |
|
||||
| `npx quartz info` | Print version and plugins for bug reports |
|
||||
|
||||
Other improvements:
|
||||
|
||||
- **Node.js version check** — clear error message if running on Node < 22
|
||||
- **Port conflict handling** — helpful message when port is already in use
|
||||
- **Plugin lockfile** — `quartz.lock.json` pins plugin versions for reproducible builds
|
||||
- **Concurrency control** — `--concurrency` flag for memory-constrained environments
|
||||
|
||||
## Internationalization
|
||||
|
||||
Quartz 5 supports multiple locales out of the box. Set `locale: ja-JP` (or any supported locale) in your config to translate all UI strings — search placeholders, "table of contents", date formatting, and more.
|
||||
|
||||
## New Plugins
|
||||
|
||||
Plugins new to v5 (not available in v4):
|
||||
|
||||
```base
|
||||
filters:
|
||||
and:
|
||||
- file.ext == "md"
|
||||
- file.inFolder("plugins")
|
||||
- note["new-in-v5"] == true
|
||||
properties:
|
||||
title:
|
||||
displayName: Plugin
|
||||
repository:
|
||||
displayName: Repository
|
||||
description:
|
||||
displayName: Description
|
||||
views:
|
||||
- type: table
|
||||
name: New in v5
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
```
|
||||
|
||||
## For Plugin Developers
|
||||
|
||||
If you built plugins for v4, the development model has changed significantly:
|
||||
|
||||
- Plugins are **standalone npm packages** with their own `package.json`, `tsconfig.json`, and build system
|
||||
- The **factory function pattern** (inspired by Astro integrations) replaces class-based plugins
|
||||
- **`@quartz-community/types`** provides full type safety without depending on the Quartz core
|
||||
- **`@quartz-community/utils`** provides shared path, DOM, and language utilities
|
||||
- **`@quartz-community/runtime`** provides browser runtime utilities
|
||||
- Plugins can ship **components**, **frames**, **stylesheets**, and **client scripts**
|
||||
- A **plugin template** is available at [quartz-community/plugin-template](https://github.com/quartz-community/plugin-template)
|
||||
|
||||
See [[making plugins]] for the full guide.
|
||||
+99
-33
@@ -7,42 +7,51 @@ 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]].
|
||||
> The rest of this guide assumes that you've already created your own GitHub repository for Quartz. If you haven't already, follow the [[installation#Setting Up Your GitHub Repository|GitHub repository setup]] section of the installation guide.
|
||||
|
||||
> [!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!
|
||||
|
||||
> [!tip] Keeping plugins in sync
|
||||
> All hosting examples below use `npx quartz plugin install` to install plugins from the lockfile. If contributors may add plugins to `quartz.config.yaml` without updating the lockfile, add `npx quartz plugin install --from-config` after `install` in your build command to install any missing plugins. See [[cli/plugin#install|plugin install]] for details.
|
||||
|
||||
> [!note] Builds fail on broken plugins
|
||||
> Hosted builds run with the `CI` environment variable set, so a plugin that fails to load or needs a newer Quartz fails the deploy instead of publishing a site with a missing feature. Run `npx quartz plugin doctor` locally to find the cause, or set `QUARTZ_ALLOW_BROKEN_PLUGINS=1` / `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1` in the build environment to deploy anyway. See [[troubleshooting#Reading build output]].
|
||||
|
||||
## Cloudflare Pages
|
||||
|
||||
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
|
||||
2. In Account Home, select **Compute (Workers)** > **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**.
|
||||
3. Select the new GitHub repository that you created and, in the **Set up builds and deployments** section, provide the following information:
|
||||
|
||||
| Configuration option | Value |
|
||||
| ---------------------- | ------------------ |
|
||||
| Production branch | `v4` |
|
||||
| Framework preset | `None` |
|
||||
| Build command | `npx quartz build` |
|
||||
| Build output directory | `public` |
|
||||
| Configuration option | Value |
|
||||
| ---------------------- | ----------------------------------------------- |
|
||||
| Production branch | `v5` |
|
||||
| Framework preset | `None` |
|
||||
| Build command | `npx quartz plugin install && npx quartz build` |
|
||||
| Build output directory | `public` |
|
||||
|
||||
Press "Save and deploy" and Cloudflare should have a deployed version of your site in about a minute. Then, every time you sync your Quartz changes to GitHub, your site should be updated.
|
||||
|
||||
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`).
|
||||
> 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 plugin install && npx quartz build`).
|
||||
|
||||
> [!note]
|
||||
> For more detailed CI/CD configuration including caching and plugin management, see [[migrating#Updating Your CI/CD|the migration guide]].
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
In your local Quartz, create a new file `quartz/.github/workflows/deploy.yml`.
|
||||
In your local Quartz, create a new file `.github/workflows/deploy.yml` at the root of the repository.
|
||||
|
||||
```yaml title="quartz/.github/workflows/deploy.yml"
|
||||
```yaml title=".github/workflows/deploy.yml"
|
||||
name: Deploy Quartz site to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v4
|
||||
- v5
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -55,16 +64,32 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for git info
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
- name: Build Quartz
|
||||
run: npx quartz build
|
||||
- name: Upload artifact
|
||||
@@ -112,7 +137,11 @@ Here's how to add a custom domain to your GitHub pages deployment.
|
||||
- `185.199.111.153`
|
||||
- If you are using a subdomain, navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `quartz.example.com` for your user site, create a `CNAME` record that points `quartz.example.com` to `<github-username>.github.io`.
|
||||
|
||||
![[dns records.png]]_The above shows a screenshot of Google Domains configured for both `jzhao.xyz` (an apex domain) and `quartz.jzhao.xyz` (a subdomain)._
|
||||
![[dns records.png]]_The above shows a screenshot of Google Domains configured for both `jzhao.xyz`
|
||||
|
||||
(an apex domain) and `quartz.jzhao.xyz`
|
||||
|
||||
(a subdomain)._
|
||||
|
||||
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.
|
||||
|
||||
@@ -140,11 +169,11 @@ Before deploying to Vercel, a `vercel.json` file is required at the root of the
|
||||
3. Give the project a name (lowercase characters and hyphens only)
|
||||
4. Check that these configuration options are set:
|
||||
|
||||
| Configuration option | Value |
|
||||
| ----------------------------------------- | ------------------ |
|
||||
| Framework Preset | `Other` |
|
||||
| Root Directory | `./` |
|
||||
| Build and Output Settings > Build Command | `npx quartz build` |
|
||||
| Configuration option | Value |
|
||||
| ----------------------------------------- | ----------------------------------------------- |
|
||||
| Framework Preset | `Other` |
|
||||
| Root Directory | `./` |
|
||||
| Build and Output Settings > Build Command | `npx quartz plugin install && npx quartz build` |
|
||||
|
||||
5. Press Deploy. Once it's live, you'll have 2 `*.vercel.app` URLs to view the page.
|
||||
|
||||
@@ -153,7 +182,7 @@ Before deploying to Vercel, a `vercel.json` file is required at the root of the
|
||||
> [!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.
|
||||
1. Update the `baseUrl` in `quartz.config.yaml` if necessary.
|
||||
2. Go to the [Domains - Dashboard](https://vercel.com/dashboard/domains) page in Vercel.
|
||||
3. Connect the domain to Vercel
|
||||
4. Press "Add" to connect a custom domain to Vercel.
|
||||
@@ -165,7 +194,7 @@ Before deploying to Vercel, a `vercel.json` file is required at the root of the
|
||||
|
||||
Using `docs.example.com` is an example of a subdomain. They're a simple way of connecting multiple deployments to one domain.
|
||||
|
||||
1. Update the `baseUrl` in `quartz.config.js` if necessary.
|
||||
1. Update the `baseUrl` in `quartz.config.yaml` if necessary.
|
||||
2. Ensure your domain has been added to the [Domains - Dashboard](https://vercel.com/dashboard/domains) page in Vercel.
|
||||
3. Go to the [Vercel Dashboard](https://vercel.com/dashboard) and select your Quartz project.
|
||||
4. Go to the Settings tab and then click Domains in the sidebar
|
||||
@@ -175,7 +204,7 @@ Using `docs.example.com` is an example of a subdomain. They're a simple way of c
|
||||
|
||||
1. Log in to the [Netlify dashboard](https://app.netlify.com/) and click "Add new site".
|
||||
2. Select your Git provider and repository containing your Quartz project.
|
||||
3. Under "Build command", enter `npx quartz build`.
|
||||
3. Under "Build command", enter `npx quartz plugin install && npx quartz build`.
|
||||
4. Under "Publish directory", enter `public`.
|
||||
5. Press Deploy. Once it's live, you'll have a `*.netlify.app` URL to view the page.
|
||||
6. To add a custom domain, check "Domain management" in the left sidebar, just like with Vercel.
|
||||
@@ -189,31 +218,33 @@ stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
image: node:22
|
||||
cache: # Cache modules in between jobs
|
||||
key: $CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .npm/
|
||||
image: node:24
|
||||
cache:
|
||||
- key: npm-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .npm/
|
||||
- key: plugins-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .quartz/plugins/
|
||||
|
||||
build:
|
||||
stage: build
|
||||
rules:
|
||||
- if: '$CI_COMMIT_REF_NAME == "v4"'
|
||||
- if: '$CI_COMMIT_REF_NAME == "v5"'
|
||||
before_script:
|
||||
- hash -r
|
||||
- npm ci --cache .npm --prefer-offline
|
||||
script:
|
||||
- npx quartz plugin install
|
||||
- npx quartz build
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
tags:
|
||||
- gitlab-org-docker
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
rules:
|
||||
- if: '$CI_COMMIT_REF_NAME == "v4"'
|
||||
- if: '$CI_COMMIT_REF_NAME == "v5"'
|
||||
script:
|
||||
- echo "Deploying to GitLab Pages..."
|
||||
artifacts:
|
||||
@@ -286,3 +317,38 @@ example.com {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Caching
|
||||
|
||||
Quartz emits CSS and JS files with content hashes in their filenames (e.g. `index-a3f2c1b.css`, `component-7d4e2f.css`). Since the filename changes whenever the content changes, these files can be cached indefinitely. HTML files should not be cached long-term since they reference the hashed filenames and need to stay fresh.
|
||||
|
||||
### Cloudflare Pages / Vercel / Netlify
|
||||
|
||||
These platforms handle caching automatically. No configuration is needed — hashed assets will be served with appropriate cache headers out of the box.
|
||||
|
||||
### Nginx
|
||||
|
||||
```nginx title="nginx.conf"
|
||||
# Immutable cache for hashed assets
|
||||
location ~* \.(css|js)$ {
|
||||
if ($uri ~* "-[0-9a-f]{8}\.") {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Caddy
|
||||
|
||||
```caddy title="Caddyfile"
|
||||
@hashed path_regexp hashed -[0-9a-f]{8}\.(css|js)$
|
||||
header @hashed Cache-Control "public, max-age=31536000, immutable"
|
||||
```
|
||||
|
||||
### Apache
|
||||
|
||||
```apache title=".htaccess"
|
||||
# Immutable cache for content-hashed assets
|
||||
<FilesMatch "-[0-9a-f]{8}\.(css|js)$">
|
||||
Header set Cache-Control "public, max-age=31536000, immutable"
|
||||
</FilesMatch>
|
||||
```
|
||||
+36
-15
@@ -1,37 +1,58 @@
|
||||
---
|
||||
title: Welcome to Quartz 4
|
||||
title: Welcome to Quartz 5
|
||||
---
|
||||
|
||||
Quartz is a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites. Thousands of students, developers, and teachers are [[showcase|already using Quartz]] to publish personal notes, websites, and [digital gardens](https://jzhao.xyz/posts/networked-thought) to the web.
|
||||
|
||||
## 🪴 Get Started
|
||||
|
||||
Quartz requires **at least [Node](https://nodejs.org/) v22** and `npm` v10.9.2 to function correctly. Ensure you have this installed on your machine before continuing.
|
||||
Quartz requires **at least [Node](https://nodejs.org/) v22.22** and `npm` v10.9.2 to function correctly. Ensure you have these installed on your machine before continuing. See the [[getting-started/index#Prerequisites|prerequisites]] for help installing them.
|
||||
|
||||
Then, in your terminal of choice, enter the following commands line by line:
|
||||
> [!tip] GitHub users
|
||||
> You can also use the **[GitHub template](https://github.com/jackyzha0/quartz/generate)** to create your repository in one click, then clone that instead. See [[installation#Option A Use the GitHub Template Recommended|Option A]] in the installation guide.
|
||||
|
||||
```shell
|
||||
# 1. Clone the Quartz repository
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
|
||||
# 2. Install dependencies
|
||||
npm i
|
||||
|
||||
# 3. Initialize your site (choose a template, set your base URL, import content)
|
||||
# This also installs the plugins your template uses
|
||||
npx quartz create
|
||||
|
||||
# 4. Preview your site locally
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
This will guide you through initializing your Quartz with content. Once you've done so, see how to:
|
||||
Your site is now running at `http://localhost:8080`. From here:
|
||||
|
||||
1. [[authoring content|Writing content]] in Quartz
|
||||
2. [[configuration|Configure]] Quartz's behaviour
|
||||
3. Change Quartz's [[layout]]
|
||||
4. [[build|Build and preview]] Quartz
|
||||
5. Sync your changes with [[setting up your GitHub repository|GitHub]]
|
||||
6. [[hosting|Host]] Quartz online
|
||||
- **[[authoring-content|Write content]]** in the `content/` folder
|
||||
- **[[installation|Push to GitHub]]** with `npx quartz sync`
|
||||
- **[[hosting|Deploy]]** to GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
|
||||
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)
|
||||
For the full walkthrough, see the [[getting-started/index|Getting Started]] guide.
|
||||
|
||||
### Returning User?
|
||||
|
||||
Already have a Quartz repository and cloning it on a new machine?
|
||||
|
||||
```shell
|
||||
git clone https://github.com/<your-username>/<your-repo>.git
|
||||
cd <your-repo>
|
||||
npm ci
|
||||
npx quartz plugin install
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> If you hit build errors on a fresh clone, try `npx quartz plugin install --latest` to refresh plugins to their latest versions. See [[troubleshooting#Plugins fail to build on a fresh clone]] for details.
|
||||
|
||||
## 🔧 Features
|
||||
|
||||
- [[Obsidian compatibility]], [[full-text search]], [[graph view]], [[wikilinks|wikilinks, transclusions]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[comments]] and [many more](./features/) right out of the box
|
||||
- [[Obsidian compatibility]], [[full-text search]], [[graph view]], [[wikilinks|wikilinks, transclusions]], [[plugins/Backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[features/comments|comments]] and [many more](./features/) right out of the box
|
||||
- Hot-reload on configuration edits and incremental rebuilds for content edits
|
||||
- Simple JSX layouts and [[creating components|page components]]
|
||||
- [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes
|
||||
@@ -41,6 +62,6 @@ For a comprehensive list of features, visit the [features page](./features/). Yo
|
||||
|
||||
### 🚧 Troubleshooting + Updating
|
||||
|
||||
Having trouble with Quartz? Try searching for your issue using the search feature. If you haven't already, [[upgrading|upgrade]] to the newest version of Quartz to see if this fixes your issue.
|
||||
Having trouble with Quartz? Try searching for your issue using the search feature or check the [[troubleshooting]] page. If you haven't already, [[upgrading|upgrade]] to the newest version of Quartz to see if this fixes your issue.
|
||||
|
||||
If you're still having trouble, feel free to [submit an issue](https://github.com/jackyzha0/quartz/issues) if you feel you found a bug or ask for help in our [Discord Community](https://discord.gg/cRFFHYye7t).
|
||||
If you're still having trouble, feel free to [submit an issue](https://github.com/jackyzha0/quartz/issues) if you feel you found a bug (include the output of `npx quartz info`) or ask for help in our [Discord Community](https://discord.gg/cRFFHYye7t). You can also browse the [[community]] page for third-party plugins and resources.
|
||||
+171
-55
@@ -4,20 +4,96 @@ title: Higher-Order Layout Components
|
||||
|
||||
Quartz provides several higher-order components that help with layout composition and responsive design. These components wrap other components to add additional functionality or modify their behavior.
|
||||
|
||||
Most common use cases can be configured directly in `quartz.config.yaml` using layout properties. For advanced scenarios requiring custom logic, you can use the TS override approach in `quartz.ts`.
|
||||
|
||||
## `Flex` Component
|
||||
|
||||
The `Flex` component creates a [flexible box layout](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) that can arrange child components in various ways. It's particularly useful for creating responsive layouts and organizing components in rows or columns.
|
||||
|
||||
### YAML Configuration
|
||||
|
||||
In YAML, flex layouts are created using **groups**. Define a group in the top-level `layout.groups` section, then assign plugins to that group via their `layout.group` property:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/search
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 20
|
||||
group: toolbar
|
||||
groupOptions:
|
||||
grow: true # Search will grow to fill available space
|
||||
- source: github:quartz-community/darkmode
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 30
|
||||
group: toolbar # Darkmode keeps its natural size
|
||||
- source: github:quartz-community/reader-mode
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 35
|
||||
group: toolbar
|
||||
|
||||
layout:
|
||||
groups:
|
||||
toolbar:
|
||||
direction: row
|
||||
gap: 0.5rem
|
||||
```
|
||||
|
||||
The `groupOptions` field on each plugin entry supports the following flex item properties:
|
||||
|
||||
| Option | Type | Description |
|
||||
| --------- | --------------------------------------------------------------- | --------------------------------------------------------- |
|
||||
| `grow` | `boolean` | Whether the component should grow to fill available space |
|
||||
| `shrink` | `boolean` | Whether the component should shrink if needed |
|
||||
| `basis` | `string` | Initial main size of the component (e.g., `"200px"`) |
|
||||
| `order` | `number` | Order in the flex container |
|
||||
| `align` | `"start"` \| `"end"` \| `"center"` \| `"stretch"` | Cross-axis alignment |
|
||||
| `justify` | `"start"` \| `"end"` \| `"center"` \| `"between"` \| `"around"` | Main-axis alignment |
|
||||
|
||||
The top-level `layout.groups` section configures the flex container itself:
|
||||
|
||||
| Option | Type | Description |
|
||||
| ----------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
||||
| `direction` | `"row"` \| `"row-reverse"` \| `"column"` \| `"column-reverse"` | Flex direction |
|
||||
| `wrap` | `"nowrap"` \| `"wrap"` \| `"wrap-reverse"` | Flex wrap behavior |
|
||||
| `gap` | `string` | Gap between flex items (e.g., `"0.5rem"`) |
|
||||
| `priority` | `number` | Position of the whole group in its slot (defaults to its first member's priority) |
|
||||
|
||||
Groups work in the `header`, `beforeBody`, `afterBody`, `left` and `right` slots. Groups are formed per slot: members with different `position`s end up in separate groups. Avoid groups in the `footer` slot — the frames place footer components directly in the page grid, and a group wrapper is not assigned to the footer area.
|
||||
|
||||
### TS Override
|
||||
|
||||
For full programmatic control, use the `Component.Flex()` wrapper in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Component.Flex({
|
||||
components: [
|
||||
{
|
||||
Component: ExternalPlugin.Search(),
|
||||
grow: true, // Search will grow to fill available space
|
||||
},
|
||||
{ Component: ExternalPlugin.Darkmode() }, // Darkmode keeps its natural size
|
||||
],
|
||||
direction: "row",
|
||||
gap: "1rem",
|
||||
})
|
||||
```
|
||||
|
||||
```typescript
|
||||
type FlexConfig = {
|
||||
components: {
|
||||
Component: QuartzComponent
|
||||
grow?: boolean // whether component should grow to fill space
|
||||
shrink?: boolean // whether component should shrink if needed
|
||||
basis?: string // initial main size of the component
|
||||
order?: number // order in flex container
|
||||
align?: "start" | "end" | "center" | "stretch" // cross-axis alignment
|
||||
justify?: "start" | "end" | "center" | "between" | "around" // main-axis alignment
|
||||
grow?: boolean
|
||||
shrink?: boolean
|
||||
basis?: string
|
||||
order?: number
|
||||
align?: "start" | "end" | "center" | "stretch"
|
||||
justify?: "start" | "end" | "center" | "between" | "around"
|
||||
}[]
|
||||
direction?: "row" | "row-reverse" | "column" | "column-reverse"
|
||||
wrap?: "nowrap" | "wrap" | "wrap-reverse"
|
||||
@@ -25,24 +101,8 @@ type FlexConfig = {
|
||||
}
|
||||
```
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
Component.Flex({
|
||||
components: [
|
||||
{
|
||||
Component: Component.Search(),
|
||||
grow: true, // Search will grow to fill available space
|
||||
},
|
||||
{ Component: Component.Darkmode() }, // Darkmode keeps its natural size
|
||||
],
|
||||
direction: "row",
|
||||
gap: "1rem",
|
||||
})
|
||||
```
|
||||
|
||||
> [!note] Overriding behavior
|
||||
> Components inside `Flex` get an additional CSS class `flex-component` that add the `display: flex` property. If you want to override this behavior, you can add a `display` property to the component's CSS class in your custom CSS file.
|
||||
> Components inside `Flex` get an additional CSS class `flex-component` that adds the `display: flex` property. If you want to override this behavior, you can add a `display` property to the component's CSS class in your custom CSS file.
|
||||
>
|
||||
> ```scss
|
||||
> .flex-component {
|
||||
@@ -50,29 +110,102 @@ Component.Flex({
|
||||
> }
|
||||
> ```
|
||||
|
||||
## `MobileOnly` Component
|
||||
## `MobileOnly` / `DesktopOnly` Components
|
||||
|
||||
The `MobileOnly` component is a wrapper that makes its child component only visible on mobile devices. This is useful for creating responsive layouts where certain components should only appear on smaller screens.
|
||||
These components control whether a plugin is visible on mobile or desktop devices. This is useful for creating responsive layouts where certain components should only appear on specific screen sizes.
|
||||
|
||||
### Example Usage
|
||||
### YAML Configuration
|
||||
|
||||
```typescript
|
||||
In YAML, use the `display` property on a plugin's layout entry:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/table-of-contents
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 20
|
||||
display: desktop-only # Only visible on desktop
|
||||
```
|
||||
|
||||
Available `display` values:
|
||||
|
||||
| Value | Description |
|
||||
| -------------- | --------------------------------------------------------------------------- |
|
||||
| `all` | Visible on all screen sizes (default) |
|
||||
| `mobile-only` | Only visible below the `mobile` breakpoint (800px by default) |
|
||||
| `desktop-only` | Hidden below the `mobile` breakpoint (visible on tablet and desktop widths) |
|
||||
|
||||
Any other value is ignored with a build warning.
|
||||
|
||||
### TS Override
|
||||
|
||||
For the TS override approach, use `Component.MobileOnly()` or `Component.DesktopOnly()` wrappers:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Component.MobileOnly(Component.Spacer())
|
||||
```
|
||||
|
||||
## `DesktopOnly` Component
|
||||
|
||||
The `DesktopOnly` component is the counterpart to `MobileOnly`. It makes its child component only visible on desktop devices. This helps create responsive layouts where certain components should only appear on larger screens.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
Component.DesktopOnly(Component.TableOfContents())
|
||||
```ts title="quartz.ts (override)"
|
||||
Component.DesktopOnly(ExternalPlugin.TableOfContents())
|
||||
```
|
||||
|
||||
## `ConditionalRender` Component
|
||||
|
||||
The `ConditionalRender` component is a wrapper that conditionally renders its child component based on a provided condition function. This is useful for creating dynamic layouts where components should only appear under certain conditions.
|
||||
The `ConditionalRender` component conditionally renders a plugin based on page properties. This is useful for creating dynamic layouts where components should only appear under certain conditions.
|
||||
|
||||
### YAML Configuration
|
||||
|
||||
In YAML, use the `condition` property on a plugin's layout entry. Quartz provides several built-in condition presets:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/breadcrumbs
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index # Hide breadcrumbs on the root index page
|
||||
```
|
||||
|
||||
Available built-in conditions:
|
||||
|
||||
| Condition | Description |
|
||||
| ----------------- | --------------------------------------------------------------------------- |
|
||||
| `is-index` | Only render on the root `index.md` (the home page) |
|
||||
| `not-index` | Only render when the page is not the root `index.md` |
|
||||
| `is-folder-index` | Only render on a folder's index page (`folder/index.md` or a generated one) |
|
||||
| `has-tags` | Only render when the page has tags in its frontmatter |
|
||||
| `has-backlinks` | Only render when the page has backlinks |
|
||||
| `has-toc` | Only render when the page has a table of contents |
|
||||
| `not-<condition>` | Negates any other condition, e.g. `not-has-tags`, `not-has-backlinks` |
|
||||
|
||||
The `not-` prefix also works for conditions registered by plugins or in `quartz.ts`. To change the layout of a whole page type (folder pages, tag pages, …) rather than single pages, use `layout.byPageType` (see [[layout#Per-page-type overrides]]).
|
||||
|
||||
### TS Override
|
||||
|
||||
For custom conditions that aren't covered by the built-in presets, import the internal component utilities and the component you want to wrap in `quartz.ts`. Place `Component.ConditionalRender()` in the layout slot where the wrapped component should appear. For example, this renders Search in the left sidebar only for pages under `notes/`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
import * as Component from "./quartz/components"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: {
|
||||
left: [
|
||||
Component.ConditionalRender({
|
||||
component: ExternalPlugin.Search(),
|
||||
condition: (props) => props.fileData.slug?.startsWith("notes/") ?? false,
|
||||
}),
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
`./.quartz/plugins` is the generated index of all installed plugins, npm and Git alike (importing a single plugin from `./.quartz/plugins/<name>` only works for plugins installed from Git). The wrapped plugin must be installed and enabled in `quartz.config.yaml`. A TypeScript layout override replaces the selected slot, so include any other components you want to keep in that slot alongside the conditional component.
|
||||
|
||||
```typescript
|
||||
type ConditionalRenderConfig = {
|
||||
@@ -81,22 +214,5 @@ type ConditionalRenderConfig = {
|
||||
}
|
||||
```
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
Component.ConditionalRender({
|
||||
component: Component.Search(),
|
||||
condition: (props) => props.displayClass !== "fullpage",
|
||||
})
|
||||
```
|
||||
|
||||
The example above would only render the Search component when the page is not in fullpage mode.
|
||||
|
||||
```typescript
|
||||
Component.ConditionalRender({
|
||||
component: Component.Breadcrumbs(),
|
||||
condition: (page) => page.fileData.slug !== "index",
|
||||
})
|
||||
```
|
||||
|
||||
The example above would hide breadcrumbs on the root `index.md` page.
|
||||
> [!tip]
|
||||
> You can also register custom conditions for use in YAML: call `registerCondition(name, (props) => boolean)` from `./quartz/plugins/loader/conditions` at the top of `quartz.ts`, before `loadQuartzConfig()`, then use `condition: <name>` in a layout block.
|
||||
+262
-7
@@ -2,7 +2,12 @@
|
||||
title: Layout
|
||||
---
|
||||
|
||||
Certain emitters may also output [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) files. To enable easy customization, these emitters allow you to fully rearrange the layout of the page. The default page layouts can be found in `quartz.layout.ts`.
|
||||
Certain emitters may also output [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) files. To enable easy customization, these emitters allow you to fully rearrange the layout of the page.
|
||||
|
||||
In v5, the layout is defined in `quartz.config.yaml`. Each plugin controls its own layout position via `layout.position` and `layout.priority` fields. The top-level `layout` section provides two additional mechanisms:
|
||||
|
||||
- `layout.groups` defines flex containers (like `toolbar`) that group multiple components into a single row or column. See [[layout-components]] for details.
|
||||
- `layout.byPageType` contains per-page-type overrides (content, folder, tag, 404, …): `exclude` plugins, clear slots with `positions`, and optionally a `template` to control the page's [[#Page Frames|page frame]]. See [[#Per-page-type overrides]].
|
||||
|
||||
Each page is composed of multiple different sections which contain `QuartzComponents`. The following code snippet lists all of the valid sections that you can add components to:
|
||||
|
||||
@@ -15,7 +20,7 @@ export interface FullPageLayout {
|
||||
afterBody: QuartzComponent[] // laid out vertically
|
||||
left: QuartzComponent[] // vertical on desktop and tablet, horizontal on mobile
|
||||
right: QuartzComponent[] // vertical on desktop, horizontal on tablet and mobile
|
||||
footer: QuartzComponent // single component
|
||||
footer: QuartzComponent[] // laid out vertically
|
||||
}
|
||||
```
|
||||
|
||||
@@ -31,14 +36,264 @@ These correspond to following parts of the page:
|
||||
> 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`.
|
||||
> 2. `header` is a set of components that are laid out horizontally and appears _before_ the `beforeBody` section. You can place components in the header by setting `layout.position: header` in your plugin configuration. This enables layouts similar to Quartz 3's header bar with title, search bar, and dark mode toggle.
|
||||
|
||||
Quartz **components**, like plugins, can take in additional properties as configuration options. If you're familiar with React terminology, you can think of them as Higher-order Components.
|
||||
Layout components are configured in the `layout` section of `quartz.config.yaml`. Plugins declare their position and priority, and the layout system arranges them automatically:
|
||||
|
||||
See [a list of all the components](component.md) for all available components along with their configuration options. Additionally, Quartz provides several built-in higher-order components for layout composition - see [[layout-components]] for more details.
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: "@quartz-community/graph"
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
- source: "@quartz-community/search"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 20
|
||||
- source: "@quartz-community/backlinks"
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 30
|
||||
- source: "@quartz-community/article-title"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 10
|
||||
- source: "@quartz-community/content-meta"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 20
|
||||
- source: "@quartz-community/tag-list"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 30
|
||||
- source: "@quartz-community/darkmode"
|
||||
enabled: true
|
||||
layout:
|
||||
position: header
|
||||
priority: 10
|
||||
- source: "@quartz-community/footer"
|
||||
enabled: true
|
||||
options:
|
||||
links:
|
||||
GitHub: https://github.com/jackyzha0/quartz
|
||||
Discord Community: https://discord.gg/cRFFHYye7t
|
||||
layout:
|
||||
position: footer
|
||||
priority: 50
|
||||
|
||||
layout:
|
||||
groups:
|
||||
toolbar:
|
||||
direction: row
|
||||
gap: 0.5rem
|
||||
byPageType:
|
||||
content: {}
|
||||
folder:
|
||||
exclude:
|
||||
- reader-mode
|
||||
positions:
|
||||
right: []
|
||||
tag:
|
||||
exclude:
|
||||
- reader-mode
|
||||
positions:
|
||||
right: []
|
||||
"404":
|
||||
positions:
|
||||
beforeBody: []
|
||||
left: []
|
||||
right: []
|
||||
```
|
||||
|
||||
### Conditional Rendering
|
||||
|
||||
Plugins can specify a `condition` in their layout block to control when they appear. This uses built-in presets:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: "@quartz-community/breadcrumbs"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index
|
||||
```
|
||||
|
||||
Available conditions:
|
||||
|
||||
| Condition | Effect |
|
||||
| ----------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||
| `is-index` | Only shown on the root index page (the home page) |
|
||||
| `not-index` | Hidden on the root index page, shown everywhere else |
|
||||
| `is-folder-index` | Only shown on folder index pages (`folder/index.md` or a generated one), not on tag pages (`tags/` and `tags/<tag>`) |
|
||||
| `has-tags` | Only shown on pages that have tags in frontmatter |
|
||||
| `has-backlinks` | Only shown on pages that another (listed) page links to |
|
||||
| `has-toc` | Only shown on pages with a table of contents (needs `table-of-contents`) |
|
||||
| `not-<condition>` | Negates any condition, built-in or registered: `not-has-tags`, `not-has-toc` |
|
||||
|
||||
Plugins can register additional conditions. An unknown condition name prints a warning at build time and the component is always shown.
|
||||
|
||||
### Plugin layout fields
|
||||
|
||||
| Field | Required | Description |
|
||||
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `position` | no | `header`, `beforeBody`, `afterBody`, `left`, `right` or `footer`. Defaults to the plugin's `defaultPosition`. |
|
||||
| `priority` | no | Order within the slot, lower first. Defaults to the plugin's `defaultPriority`, else `50`. |
|
||||
| `display` | no | `all` (default), `mobile-only`, `desktop-only` — see [[layout-components]]. |
|
||||
| `condition` | no | One of the conditions above. |
|
||||
| `group` | no | Name of a flex group from `layout.groups`. Works in every slot except `footer`. |
|
||||
| `groupOptions` | no | Flex item options inside the group — see [[layout-components]]. |
|
||||
|
||||
Because `position` and `priority` fall back to the plugin's defaults, a layout block can contain only what you want to change, e.g. `layout: { condition: has-tags }`. A plugin without a `layout` block is placed at its default position (if it declares one).
|
||||
|
||||
Components with equal priority keep the order in which they appear in `quartz.config.yaml`; components placed by their plugin default come after explicitly configured ones.
|
||||
|
||||
### Per-page-type overrides
|
||||
|
||||
`layout.byPageType.<layout-key>` adjusts the layout for one page type. The key is the page type's layout name (`content`, `folder`, `tag`, `404`, `canvas`, `bases`, …).
|
||||
|
||||
| Field | Description |
|
||||
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `exclude` | Plugins to leave out on this page type. Use the plugin name (`reader-mode`); the full source (`@quartz-community/reader-mode`, `github:…/reader-mode`) works too. |
|
||||
| `positions` | Clear slots: `right: []` removes everything from the right sidebar. Only empty lists are supported. |
|
||||
| `template` | The [[#Page Frames\|page frame]] to use, e.g. `full-width` or `minimal`. |
|
||||
| `sidebars` | [[#Sidebar modes\|Sidebar modes]] for this page type (`left`/`right`: `fit`, `scroll` or `static`), merged over `layout.sidebars`. |
|
||||
|
||||
Slots that a page type does not change follow the defaults.
|
||||
|
||||
### Checking your layout
|
||||
|
||||
Layout problems that would otherwise silently drop or misplace a component are reported as `⚠ Layout:` warnings during the build — for example an unknown `position` (with a "did you mean" hint), an unknown `display` or `condition`, a `layout` block for a plugin that provides no component, a plugin listed twice, or a `byPageType` entry that excludes a plugin that doesn't exist.
|
||||
|
||||
To see where every component ended up, run the build with `--verbose`:
|
||||
|
||||
```bash
|
||||
npx quartz build --verbose
|
||||
```
|
||||
|
||||
This prints, for the defaults and for each page type, every slot with its components in render order, their priority, whether the position came from your config or the plugin default, and any `display`, `condition` or `group`; plus the frame each page type uses and which slots that frame does not render.
|
||||
|
||||
### Mobile layout
|
||||
|
||||
On screens narrower than the `mobile` [[#Layout breakpoints|breakpoint]] the left sidebar becomes a single horizontal row at the top of the page — intended for compact components such as the page title, search, darkmode toggle and the explorer menu button. Taller components placed in `left` (recent notes, graph, table of contents, …) get squeezed into that row. Give them `display: desktop-only`, or place them in `right`/`afterBody`, which stack below the content on mobile.
|
||||
|
||||
See [[layout-components]] for more details on conditional rendering and display options.
|
||||
|
||||
For advanced layout overrides using TypeScript (e.g. custom component wrappers or conditional logic), you can use the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: {
|
||||
// override default layout for all page types
|
||||
},
|
||||
byPageType: {
|
||||
content: {
|
||||
// override layout for content pages only
|
||||
},
|
||||
folder: {
|
||||
// override layout for folder pages only
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
`loadQuartzConfig()` must be called first (as in the default `quartz.ts`); calling `loadQuartzLayout()` with overrides afterwards applies them to the layout used for rendering. For each slot the precedence is, from highest to lowest:
|
||||
|
||||
1. `byPageType` in `quartz.ts`
|
||||
2. `layout.byPageType` changes in `quartz.config.yaml` (`exclude`, cleared `positions`)
|
||||
3. `defaults` in `quartz.ts`
|
||||
4. the layout built from each plugin's `layout` block
|
||||
|
||||
Component plugins are installed via `npx quartz plugin add @quartz-community/<name>` (or a `github:org/repo` source). See [[layout-components]] for built-in layout utilities (Flex, MobileOnly, DesktopOnly, etc.).
|
||||
|
||||
You can also checkout the guide on [[creating components]] if you're interested in further customizing the behaviour of Quartz.
|
||||
|
||||
### Page Frames
|
||||
|
||||
Page frames control the overall HTML structure of a page — specifically, how the layout slots (sidebars, header, content, footer) are arranged inside the page shell. Different page types can use different frames to produce fundamentally different layouts.
|
||||
|
||||
Quartz ships with three built-in frames:
|
||||
|
||||
| Frame | Description | Used by |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
||||
| `default` | Three-column layout with left sidebar, center content (header, beforeBody, content, afterBody), right sidebar, and footer. This is the standard Quartz layout. | ContentPage, FolderPage, TagPage, BasesPage |
|
||||
| `full-width` | No sidebars. Single center column spanning the full width with header, content, afterBody, and footer. | — |
|
||||
| `minimal` | No sidebars, no header or beforeBody chrome. Only content and footer. | NotFoundPage (404) |
|
||||
|
||||
Plugins can also provide their own frames. For example, the `canvas-page` plugin ships a `"canvas"` frame that provides a fullscreen canvas with a togglable sidebar.
|
||||
|
||||
#### How frames are resolved
|
||||
|
||||
Each page type can declare a default frame in its plugin source code via the `frame` property. The resolution order is:
|
||||
|
||||
1. **YAML config override**: `layout.byPageType.<name>.template` in `quartz.config.yaml`
|
||||
2. **Plugin-registered frame**: Frames registered by plugins via the Frame Registry (loaded from the plugin's `frames` export)
|
||||
3. **Plugin declaration**: The `frame` property set in the page type plugin's source code
|
||||
4. **Fallback**: `"default"`
|
||||
|
||||
For example, to override canvas pages to use the minimal frame:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
layout:
|
||||
byPageType:
|
||||
canvas:
|
||||
template: minimal
|
||||
```
|
||||
|
||||
#### Custom frames
|
||||
|
||||
There are two ways to provide custom frames:
|
||||
|
||||
**1. Plugin-provided frames (recommended for reusable frames):**
|
||||
|
||||
Plugins can ship their own frames by declaring them in `package.json` and exporting them from a `./frames` subpath. See [[making plugins#Providing Custom Frames|the plugin guide]] for details. When a plugin with frames is installed, its frames are automatically registered in the Frame Registry and available by name.
|
||||
|
||||
**2. Core frames (for project-specific frames):**
|
||||
|
||||
You can also create frames directly in `quartz/components/frames/` by implementing the `PageFrame` interface and registering the frame in `quartz/components/frames/index.ts`. See the [[architecture|architecture overview]] for the full `PageFrame` interface.
|
||||
|
||||
Frames are applied as a `data-frame` attribute on the `.page` element, which you can target in CSS:
|
||||
|
||||
```scss
|
||||
.page[data-frame="my-frame"] > #quartz-body {
|
||||
/* custom grid layout */
|
||||
}
|
||||
```
|
||||
|
||||
Frame CSS should be scoped with `[data-frame="name"]` selectors to avoid conflicts with other frames.
|
||||
|
||||
### Sidebar modes
|
||||
|
||||
`layout.sidebars` sets how each sidebar handles content taller than the screen:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
layout:
|
||||
sidebars:
|
||||
left: static
|
||||
right: fit
|
||||
```
|
||||
|
||||
- `fit` (default): the sidebar stays in view and is exactly one screen tall. Its components shrink and scroll themselves (the explorer and table of contents get their own scroll area).
|
||||
- `scroll`: the sidebar stays in view, and scrolls itself when its components are taller than the screen. Components take their natural height, so nothing can end up out of reach.
|
||||
- `static`: the sidebar scrolls away with the page, like most documentation sites. The [[create#Templates|docs template]] uses this for both sidebars.
|
||||
|
||||
The modes apply where a sidebar is a column: the left sidebar above mobile width, the right sidebar on desktop. A page type can override them with `byPageType.<type>.sidebars`, merged over `layout.sidebars`.
|
||||
|
||||
### Layout breakpoints
|
||||
|
||||
Quartz has different layouts depending on the width the screen viewing the website.
|
||||
@@ -58,9 +313,9 @@ $breakpoints: (
|
||||
|
||||
### Style
|
||||
|
||||
Most meaningful style changes like colour scheme and font can be done simply through the [[configuration#General Configuration|general configuration]] options. However, if you'd like to make more involved style changes, you can do this by writing your own styles. Quartz 4, like Quartz 3, uses [Sass](https://sass-lang.com/guide/) for styling.
|
||||
Most meaningful style changes like colour scheme and font can be done simply through the [[configuration#General Configuration|general configuration]] options. However, if you'd like to make more involved style changes, you can do this by writing your own styles. Quartz uses [Sass](https://sass-lang.com/guide/) for styling.
|
||||
|
||||
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.
|
||||
> Some components may provide their own styling as well! Community plugins bundle their own styles. If you'd like to customize styling for a specific component, double check the component definition to see how its styles are defined. See also [[customizing components]].
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
title: "Migrating from Quartz 3"
|
||||
---
|
||||
|
||||
As you already have Quartz locally, you don't need to fork or clone it again. Simply just checkout the alpha branch, install the dependencies, and import your old vault.
|
||||
|
||||
```bash
|
||||
git fetch
|
||||
git checkout v4
|
||||
git pull upstream v4
|
||||
npm i
|
||||
npx quartz create
|
||||
```
|
||||
|
||||
If you get an error like `fatal: 'upstream' does not appear to be a git repository`, make sure you add `upstream` as a remote origin:
|
||||
|
||||
```shell
|
||||
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.
|
||||
|
||||
## Key changes
|
||||
|
||||
1. **Removing Hugo and `hugo-obsidian`**: Hugo worked well for earlier versions of Quartz but it also made it hard for people outside of the Golang and Hugo communities to fully understand what Quartz was doing under the hood and be able to properly customize it to their needs. Quartz 4 now uses a Node-based static-site generation process which should lead to a much more helpful error messages and an overall smoother user experience.
|
||||
2. **Full-hot reload**: The many rough edges of how `hugo-obsidian` integrated with Hugo meant that watch mode didn't re-trigger `hugo-obsidian` to update the content index. This lead to a lot of weird cases where the watch mode output wasn't accurate. Quartz 4 now uses a cohesive parse, filter, and emit pipeline which gets run on every change so hot-reloads are always accurate.
|
||||
3. **Replacing Go template syntax with JSX**: Quartz 3 used [Go templates](https://pkg.go.dev/text/template) to create layouts for pages. However, the syntax isn't great for doing any sort of complex rendering (like [text processing](https://github.com/jackyzha0/quartz/blob/hugo/layouts/partials/textprocessing.html)) and it got very difficult to make any meaningful layout changes to Quartz 3. Quartz 4 uses an extension of JavaScript syntax called JSX which allows you to write layout code that looks like HTML in JavaScript which is significantly easier to understand and maintain.
|
||||
4. **A new extensible [[configuration]] and [[configuration#Plugins|plugin]] system**: Quartz 3 was hard to configure without technical knowledge of how Hugo's partials worked. Extensions were even hard to make. Quartz 4's configuration and plugin system is designed to be extended by users while making updating to new versions of Quartz easy.
|
||||
|
||||
## Things to update
|
||||
|
||||
- You will need to update your deploy scripts. See the [[hosting]] guide for more details.
|
||||
- Ensure that your default branch on GitHub is updated from `hugo` to `v4`.
|
||||
- [[folder and tag listings|Folder and tag listings]] have also changed.
|
||||
- Folder descriptions should go under `content/<folder-name>/index.md` where `<folder-name>` is the name of the folder.
|
||||
- Tag descriptions should go under `content/tags/<tag-name>.md` where `<tag-name>` is the name of the tag.
|
||||
- Some HTML layout may not be the same between Quartz 3 and Quartz 4. If you depended on a particular HTML hierarchy or class names, you may need to update your custom CSS to reflect these changes.
|
||||
- If you customized the layout of Quartz 3, you may need to translate these changes from Go templates back to JSX as Quartz 4 no longer uses Hugo. For components, check out the guide on [[creating components]] for more details on this.
|
||||
+1
-1
@@ -36,7 +36,7 @@ Quartz is designed first and foremost as a tool for publishing [digital gardens]
|
||||
At its core, Quartz is designed to be easy to use enough for non-technical people to get going but also powerful enough that senior developers can tweak it to work how they'd like it to work.
|
||||
|
||||
1. If you like the default configuration of Quartz and just want to change the content, the only thing that you need to change is the contents of the `content` folder.
|
||||
2. If you'd like to make basic configuration tweaks but don't want to edit source code, one can tweak the plugins and components in `quartz.config.ts` and `quartz.layout.ts` in a guided manner to their liking.
|
||||
2. If you'd like to make basic configuration tweaks but don't want to edit source code, one can tweak the plugins and components in `quartz.config.yaml` in a guided manner to their liking.
|
||||
3. If you'd like to tweak the actual source code of the underlying plugins, components, or even build process, Quartz purposefully ships its full source code to the end user to allow customization at this level too.
|
||||
|
||||
Most software either confines you to either
|
||||
|
||||
@@ -1,37 +1,70 @@
|
||||
---
|
||||
title: AliasRedirects
|
||||
description: Generates redirect pages from frontmatter aliases and case-preserving URLs.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image: https://images.unsplash.com/photo-1601735479770-bb5de9dbe844
|
||||
repository: "[quartz-community/alias-redirects](https://github.com/quartz-community/alias-redirects)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits HTML redirect pages for aliases and permalinks defined in the frontmatter of content files.
|
||||
This plugin emits HTML redirect pages so that old URLs redirect to the canonical page. It handles two types of redirects:
|
||||
|
||||
For example, A `foo.md` has the following frontmatter
|
||||
1. **Frontmatter aliases**: Redirect pages for aliases defined in your content's frontmatter.
|
||||
2. **Case-preserving redirects**: Automatic redirect pages for URLs that changed due to Quartz v5's lowercase slug normalization.
|
||||
|
||||
### Frontmatter Aliases
|
||||
|
||||
If `foo.md` has the following frontmatter:
|
||||
|
||||
```md title="foo.md"
|
||||
---
|
||||
title: "Foo"
|
||||
alias:
|
||||
aliases:
|
||||
- "bar"
|
||||
---
|
||||
```
|
||||
|
||||
The target `host.me/bar` will be redirected to `host.me/foo`
|
||||
The target `host.me/bar` will be permanently redirected to `host.me/foo`.
|
||||
|
||||
Note that these are permanent redirect.
|
||||
|
||||
The emitter supports the following aliases:
|
||||
The emitter supports the following frontmatter fields:
|
||||
|
||||
- `aliases`
|
||||
- `alias`
|
||||
|
||||
A note with a `permalink` is published at its permalink, and its file path becomes a redirect as well: `notes/foo.md` with `permalink: foo` lives at `host.me/foo`, and `host.me/notes/foo` redirects there. An alias that is another page's address (or the page's own) is skipped with a warning, so a redirect never replaces a page.
|
||||
|
||||
### Case-Preserving Redirects
|
||||
|
||||
Quartz v5 normalizes all URLs to lowercase. If you are migrating from v4 (which preserved the original casing), previously indexed URLs containing uppercase letters (e.g. `/Diary/My-Note`) would return 404 errors.
|
||||
|
||||
When `enableCaseRedirects` is enabled (the default), this plugin automatically detects files whose original path differs from the lowercased slug and generates redirect pages at the original-case URL. For example, if your content directory contains `Diary/2026-01-01.md`, the plugin generates:
|
||||
|
||||
- The canonical page at `/diary/2026-01-01` (produced by the normal build)
|
||||
- A redirect page at `/Diary/2026-01-01` (produced by this plugin)
|
||||
|
||||
The redirect page includes proper SEO signals:
|
||||
|
||||
- `<meta http-equiv="refresh" content="0; url=...">` for an instant redirect
|
||||
- `<link rel="canonical">` pointing to the lowercase URL
|
||||
- `<meta name="robots" content="noindex">` to prevent duplicate indexing
|
||||
|
||||
This preserves search engine rankings and ensures inbound links continue to work.
|
||||
|
||||
> [!note]
|
||||
> Case-preserving redirects have no effect on case-insensitive filesystems (macOS, Windows) where the server already resolves either casing to the same file. The plugin automatically detects the filesystem type and skips redirect generation when unnecessary.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin has no configuration options.
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `enableCaseRedirects`: If `true` (default), automatically generates redirect pages for URLs that changed casing due to v5's lowercase normalization. Set to `false` to disable this behavior.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `Plugin.AliasRedirects()`.
|
||||
- Source: [`quartz/plugins/emitters/aliases.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/aliases.ts).
|
||||
- Function name: `ExternalPlugin.AliasRedirects()`.
|
||||
- Source: [`quartz-community/alias-redirects`](https://github.com/quartz-community/alias-redirects)
|
||||
- Install: `npx quartz plugin add @quartz-community/alias-redirects` (included in the default configuration)
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: ArticleTitle
|
||||
description: Renders the article title as an h1 heading.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/article-title](https://github.com/quartz-community/article-title)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders the article title from the page's frontmatter as an `<h1>` heading at the top of the page content. It reads the `title` field from frontmatter (falling back to the filename if no title is set).
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin has no configuration options.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
- Function name: `ExternalPlugin.ArticleTitle()`.
|
||||
- Source: [`quartz-community/article-title`](https://github.com/quartz-community/article-title)
|
||||
- Install: `npx quartz plugin add @quartz-community/article-title` (included in the default configuration)
|
||||
+16
-5
@@ -2,19 +2,30 @@
|
||||
title: Assets
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image: https://images.unsplash.com/photo-1526304640581-d334cdbbf45e
|
||||
---
|
||||
|
||||
This plugin emits all non-Markdown static assets in your content folder (like images, videos, HTML, etc). The plugin respects the `ignorePatterns` in the global [[configuration]].
|
||||
This plugin emits the non-Markdown static assets in your content folder (like images, videos, PDFs, HTML, etc). The plugin respects the `ignorePatterns` in the global [[configuration]]. Files that a page type renders as pages (such as `.base` and `.canvas` files) are not copied as assets.
|
||||
|
||||
Note that all static assets will then be accessible through its path on your generated site, i.e: `host.me/path/to/static.pdf`
|
||||
Which assets are emitted depends on `configuration.publishAssets`:
|
||||
|
||||
- `"all"` (default): every asset in the content folder is copied.
|
||||
- `"referenced"`: only assets that published pages link to or embed (`src`, `href`, `data`, `poster` and `srcset` attributes) are copied. Use this together with [[private pages|publish filters]] so that images used only by unpublished notes don't end up on your site.
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
publishAssets: referenced
|
||||
```
|
||||
|
||||
Assets are written to their slugified path, so `content/path/to/My File.pdf` becomes `host.me/path/to/My-File.pdf`.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin has no configuration options.
|
||||
This plugin has no options of its own; it is always enabled.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `Plugin.Assets()`.
|
||||
- Source: [`quartz/plugins/emitters/assets.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/assets.ts).
|
||||
- Function name: `Plugin.Assets()` (internal plugin).
|
||||
- Source: [`quartz/plugins/emitters/assets.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/emitters/assets.ts).
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: Backlinks
|
||||
description: Shows pages that link to the current page.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/backlinks](https://github.com/quartz-community/backlinks)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Shows pages that link to the current page.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[features/backlinks|Backlinks]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `hideWhenEmpty`: Hide the backlinks section if the current page has no backlinks. Defaults to `true`.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/backlinks"
|
||||
enabled: true
|
||||
options:
|
||||
hideWhenEmpty: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 50
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
- Function name: `ExternalPlugin.Backlinks()`.
|
||||
- Source: [`quartz-community/backlinks`](https://github.com/quartz-community/backlinks)
|
||||
- Install: `npx quartz plugin add @quartz-community/backlinks`
|
||||
@@ -0,0 +1,118 @@
|
||||
---
|
||||
title: BasesPage
|
||||
description: Renders Obsidian Bases files as database-style views.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/bases-page](https://github.com/quartz-community/bases-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides support for [Obsidian Bases](https://obsidian.md/help/bases) (`.base` files) in Quartz. It reads `.base` files from your vault, resolves matching notes based on the query definition, and renders them as interactive database-like views with support for tables, lists, cards, galleries, and boards. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars).
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Features
|
||||
|
||||
- **Table view**: Sortable columns with automatic type rendering (strings, numbers, booleans, arrays, links).
|
||||
- **List view**: Compact list with metadata chips for each entry.
|
||||
- **Cards view**: Card layout with an optional cover image (`image` property, `imageFit`, `imageAspectRatio`).
|
||||
- **Gallery view**: Image-focused grid of thumbnails.
|
||||
- **Board view**: Kanban-style columns, one per value of the grouping property (`boardProperty` or `groupBy`).
|
||||
- **Multiple views**: A single `.base` file can define multiple views, displayed as switchable tabs. A base opens on its first view, as in Obsidian.
|
||||
- **Embedding**: `![[Tasks.base]]` embeds a base in a note, and `![[Tasks.base#Open tasks]]` embeds one view (matched by its name as written, case-sensitively). Inline ` ```base ` code blocks work too.
|
||||
- **Filters**: Recursive filter trees with `and`/`or`/`not` operators.
|
||||
- **Formulas**: Computed properties via formula expressions.
|
||||
- **Summaries**: Column-level aggregations (Sum, Average, Min, Max, Median, etc.).
|
||||
- **Property configuration**: Custom display names for properties.
|
||||
- **Link rendering**: Links (`link()`, link-valued properties such as `"[[Note]]"`) are rendered as clickable links; links to missing notes get Quartz's `broken` class.
|
||||
- **Tag links**: tags in tables, lists, cards and boards link to their tag pages (when [[TagPage]] is enabled).
|
||||
|
||||
Map views from Obsidian are not supported: a view with an unknown type shows `Unknown view type: <type>`.
|
||||
|
||||
## Obsidian compatibility
|
||||
|
||||
bases-page 1.2 (shipped with Quartz 5.1) brings evaluation in line with Obsidian. Notable behaviour, some of it changed from earlier versions:
|
||||
|
||||
- `file.name` is the name without the extension for Markdown notes (`Note`) and with it for other files (`Plan.canvas`, `Tasks.base`). `file.basename` never has the extension, `file.fullname` always does (`Note.md`).
|
||||
- `file.tags` lists tags as written, with `#` and their original case, inline tags first. The `tags` property holds only the frontmatter tags.
|
||||
- `file.hasTag("a/b")`, `file.tags.contains("a/b")`, `containsAny` and `containsAll` also match nested tags (`a/b/c`) by whole segments, ignoring case and a leading `#`. `file.hasTag("x", "y")` is true when the note has **any** of the tags.
|
||||
- Dates are shown as Obsidian shows them (moment's `L` / `L LT`) in the site's `configuration.locale`; `.format()` and `.relative()` are locale-aware. `date()` only reads ISO-style strings (`2024-03-05`, `2024-03-05 14:30`, `2024-03-05T14:30:00Z`) and `20240305`, in local time; other strings give an empty value.
|
||||
- Subtracting dates gives a duration, shown like `9 days`. Durations have `.days`, `.hours`, `.minutes`, `.seconds`, `.milliseconds`, `.weeks` (fractional), and `.months`/`.years`; `duration()` takes one whole number and one unit (`1d`, `2 weeks`).
|
||||
- `imageAspectRatio` on cards is height / width, as in Obsidian (0.5 is a wide cover, 2 a tall one; default 1).
|
||||
- `file.folder` of a file at the root of the vault is `/`.
|
||||
- `contains()`, `containsAny()` and `containsAll()` on text ignore case; on lists they are case-sensitive.
|
||||
- `this`: in a base embedded in a note, `this.<key>` and `this.file` are that note's properties and file; on the `.base` page itself, `this` is the `.base` file.
|
||||
- A formula error (such as an unknown function) is shown in its cell.
|
||||
- `.base` files are listed in bases like other files.
|
||||
|
||||
With Quartz 5.1, `.base` pages follow the site's publish filters (e.g. [[ExplicitPublish]], [[RemoveDrafts]]): a `.base` file has no frontmatter, so with ExplicitPublish it is published only when a published note links to it. A `.base` page links only to the notes its views show.
|
||||
|
||||
## Interaction with `unlisted` pages
|
||||
|
||||
`BasesPage` respects the `file.data.unlisted` convention written by [[UnlistedPages]] and [[EncryptedPages]]. Pages marked `unlisted: true` (or encrypted pages with `stealth: true`) are excluded from every rendered base view — table, list, board, cards, gallery, and any custom view — regardless of whether the base's filter expression would match them. Unlisted pages also cannot be dereferenced from formulas on visible pages via `.asFile()`.
|
||||
|
||||
> [!note]
|
||||
> Base views are **server-side rendered** HTML baked at build time. They do not update client-side after a visitor decrypts an encrypted page. Graph, explorer, and search all re-hydrate from the patched in-memory content index and show newly-unlocked pages for the rest of the browser session — base views do not, because they were materialized at build time with unlisted pages already excluded. A visitor who successfully decrypts a revealable encrypted page will see it appear in graph, explorer, and search, but **not** in any base view, until the site is rebuilt with that page listed. This is the same structural limitation that applies to backlinks, recent notes, folder listings, and tag listings.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `propertyLabels`: How column and property labels are shown. `"name"` (default) shows a property's name as Obsidian does (`priority`, `file name`); `"title"` title-cases it (`Priority`, `Name`). A property's `displayName` is always used.
|
||||
- `defaultViewType`: Open a base on its first view of this type. Unset by default: a base opens on its first view, as in Obsidian.
|
||||
- `linkResolution`: How to resolve internal links in view renderers. Should match `configuration.links.markdownLinkResolution` (built-in [[CrawlLinks|link processing]]). Can be `"absolute"`, `"relative"`, or `"shortest"`. Defaults to `"shortest"`.
|
||||
- `customViews`: A map of custom view renderers. Keys are view type names. These override built-in renderers for the same type, or add new view types. Requires a TS override.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/bases-page"
|
||||
enabled: true
|
||||
options:
|
||||
linkResolution: shortest
|
||||
order: 50
|
||||
```
|
||||
|
||||
For custom view renderers, use a TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.BasesPage({
|
||||
customViews: {
|
||||
myView: ({
|
||||
entries,
|
||||
view,
|
||||
basesData,
|
||||
total,
|
||||
locale,
|
||||
slug,
|
||||
allSlugs,
|
||||
linkResolution,
|
||||
options,
|
||||
tagPages,
|
||||
}) => {
|
||||
// return JSX
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
A view renderer receives the matching `entries`, the `view` definition, the parsed `basesData`, the `total` count, the site `locale`, the page's `slug`, `allSlugs` and `linkResolution` (for resolving links), the registration's `options`, and `tagPages` (whether tags link to tag pages). Plugins can also register view types (with their own `css` and `afterDOMLoaded` script) through `viewRegistry` from `@quartz-community/bases-page/registry`.
|
||||
|
||||
## Expressions
|
||||
|
||||
Filters and formulas use the Obsidian Bases expression language (see [Obsidian's Bases syntax](https://obsidian.md/help/bases/syntax) and [functions](https://obsidian.md/help/bases/functions)). The plugin's [README](https://github.com/quartz-community/bases-page#expression-engine) lists the supported properties, functions and methods, and the compiler API exported from `@quartz-community/bases-page/compiler`.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer, Page Type, Component
|
||||
- Function name: `ExternalPlugin.BasesPage()`.
|
||||
- Source: [`quartz-community/bases-page`](https://github.com/quartz-community/bases-page)
|
||||
- Install: `npx quartz plugin add @quartz-community/bases-page`
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: Breadcrumbs
|
||||
description: Breadcrumb navigation trail.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/breadcrumbs](https://github.com/quartz-community/breadcrumbs)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Navigation breadcrumb trail.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[features/breadcrumbs|Breadcrumbs]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `spacerSymbol`: The symbol to use between breadcrumb items. Defaults to `"❯"`.
|
||||
- `rootName`: The name of the root page. Defaults to `Home`.
|
||||
- `resolveFrontmatterTitle`: Whether to use the `title` frontmatter field for breadcrumb items. Defaults to `true`.
|
||||
- `showCurrentPage`: Whether to show the current page in the breadcrumb trail. Defaults to `true`.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/breadcrumbs"
|
||||
enabled: true
|
||||
options:
|
||||
spacerSymbol: "❯"
|
||||
rootName: Home
|
||||
resolveFrontmatterTitle: true
|
||||
showCurrentPage: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
- Function name: `ExternalPlugin.Breadcrumbs()`.
|
||||
- Source: [`quartz-community/breadcrumbs`](https://github.com/quartz-community/breadcrumbs)
|
||||
- Install: `npx quartz plugin add @quartz-community/breadcrumbs`
|
||||
@@ -1,10 +1,15 @@
|
||||
---
|
||||
title: CNAME
|
||||
description: Emits a CNAME file for custom domain deployment.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
repository: "[quartz-community/cname](https://github.com/quartz-community/cname)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits a `CNAME` record that points your subdomain to the default domain of your site.
|
||||
This plugin writes a `CNAME` file to the root of the output folder containing the hostname of `configuration.baseUrl` (for `baseUrl: quartz.example.com/docs` that is `quartz.example.com`). Hosts such as GitHub Pages read this file to serve the site on a custom domain. If `baseUrl` is not set, the plugin warns and writes nothing.
|
||||
|
||||
If you want to use a custom domain name like `quartz.example.com` for the site, then this is needed.
|
||||
|
||||
@@ -18,5 +23,6 @@ This plugin has no configuration options.
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `Plugin.CNAME()`.
|
||||
- Source: [`quartz/plugins/emitters/cname.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/cname.ts).
|
||||
- Function name: `ExternalPlugin.CNAME()`.
|
||||
- Source: [`quartz-community/cname`](https://github.com/quartz-community/cname)
|
||||
- Install: `npx quartz plugin add @quartz-community/cname`
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: CanvasPage
|
||||
description: Renders JSON Canvas files as interactive, pannable pages.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image: "#7852ee"
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/canvas-page](https://github.com/quartz-community/canvas-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is a page type plugin that renders [JSON Canvas](https://jsoncanvas.org) (`.canvas`) files as interactive, pannable and zoomable canvas pages. It uses a custom `"canvas"` [[layout#Page Frames|page frame]] that provides a fullscreen, always-on canvas experience with a togglable left sidebar for navigation. It supports the full [JSON Canvas 1.0 spec](https://jsoncanvas.org/spec/1.0/), including text nodes with Markdown rendering, file nodes that link to other pages in your vault, link nodes for external URLs, and group nodes for visual organization. Edges between nodes are rendered as SVG paths with optional labels, arrow markers, and colors.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `enableInteraction`: Whether to enable pan and zoom interaction on the canvas. Default: `true{:ts}`.
|
||||
- `initialZoom`: The initial zoom level when the canvas is first displayed. Default: `1{:ts}`.
|
||||
- `minZoom`: The minimum zoom level allowed when zooming out. Default: `0.1{:ts}`.
|
||||
- `maxZoom`: The maximum zoom level allowed when zooming in. Default: `5{:ts}`.
|
||||
- `wheelBehavior`: What the mouse wheel and two-finger trackpad scroll do. `"pan"` (default) moves the canvas, as in Obsidian (Shift + wheel: sideways); Ctrl/Cmd + wheel and pinching zoom. `"zoom"`: the wheel always zooms.
|
||||
- `textNodeMarkdown`: How text nodes are rendered. `"site"` (default): with the site's own Markdown plugins, like a note. `"basic"`: plain CommonMark + GFM, with wikilinks and links to notes still resolved.
|
||||
|
||||
### Canvas Frame
|
||||
|
||||
The canvas-page plugin provides its own `"canvas"` page frame via the [[layout#Page Frames|Frame Registry]]. This frame:
|
||||
|
||||
- Renders the canvas in **fullscreen mode** by default (100vw × 100vh), giving the canvas maximum screen space — leaning into the "endless canvas" concept of JSON Canvas.
|
||||
- Provides a **togglable left sidebar** that slides in from the left edge. This is the only layout slot available — it renders the same components as the `left` sidebar on content pages (e.g., Explorer, Search, Page Title).
|
||||
- The sidebar toggle button (hamburger/close icon) is positioned in the top-left corner.
|
||||
- Canvas controls (zoom in, zoom out, reset) are positioned on the right side.
|
||||
- On mobile, the sidebar overlays the canvas rather than pushing it aside.
|
||||
|
||||
Users can override this frame via `quartz.config.yaml` if needed:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
layout:
|
||||
byPageType:
|
||||
canvas:
|
||||
template: default # Use standard three-column layout instead
|
||||
```
|
||||
|
||||
### Features
|
||||
|
||||
- **Text nodes**: Rendered with the site's own Markdown plugins, like a note, as in Obsidian: wikilinks, callouts, [[Mermaid diagrams]], math, syntax highlighting and embedded notes (`![[Note#Section]]`). Tags in text nodes count as the canvas's tags, so they get tag pages.
|
||||
- **File nodes**: Link to other pages in your vault. Supports popover previews on hover.
|
||||
- **Link nodes**: Reference external URLs.
|
||||
- **Group nodes**: Visual grouping containers with optional labels and background colors.
|
||||
- **Edges**: SVG connections between nodes with optional labels, arrow markers, and colors. Supports all four sides (top, right, bottom, left) and both preset colors (1–6) and custom hex colors.
|
||||
- **Togglable sidebar**: Hamburger button in the top-left corner toggles the left sidebar for navigation. Press `Escape` or click the close button to dismiss.
|
||||
- **Preset colors**: Six preset colors (red, orange, yellow, green, cyan, purple) plus custom hex colors (`#RRGGBB`) for nodes and edges.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Page Type
|
||||
- Function name: `ExternalPlugin.CanvasPage()`.
|
||||
- Source: [`quartz-community/canvas-page`](https://github.com/quartz-community/canvas-page)
|
||||
- Install: `npx quartz plugin add @quartz-community/canvas-page` (included in the default configuration)
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: "Citations"
|
||||
title: Citations
|
||||
description: Academic citation and bibliography support via BibTeX.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image: https://images.unsplash.com/photo-1582079133805-43655f026448
|
||||
repository: "[quartz-community/citations](https://github.com/quartz-community/citations)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin adds Citation support to Quartz.
|
||||
@@ -15,10 +20,10 @@ This plugin accepts the following configuration options:
|
||||
- `suppressBibliography`: whether to suppress the bibliography at the end of the document. Defaults to `false`.
|
||||
- `linkCitations`: whether to link citations to the bibliography. Defaults to `false`.
|
||||
- `csl`: the citation style to use. Defaults to `apa`. Reference [rehype-citation](https://rehype-citation.netlify.app/custom-csl) for more options.
|
||||
- `prettyLink`: whether to use pretty links for citations. Defaults to `true`.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer
|
||||
- Function name: `Plugin.Citations()`.
|
||||
- Source: [`quartz/plugins/transformers/citations.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/transformers/citations.ts).
|
||||
- Function name: `ExternalPlugin.Citations()`.
|
||||
- Source: [`quartz-community/citations`](https://github.com/quartz-community/citations)
|
||||
- Install: `npx quartz plugin add @quartz-community/citations`
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: Comments
|
||||
description: Comment section powered by Giscus.
|
||||
tags:
|
||||
- plugin/component
|
||||
image: "[[giscus-results.png]]"
|
||||
repository: "[quartz-community/comments](https://github.com/quartz-community/comments)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
Adds a comment section to the bottom of each page, backed by [Giscus](https://giscus.app/) (GitHub Discussions). Giscus is currently the only provider.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[features/comments|Comments]] for setup instructions.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `provider`: The comment provider to use. Defaults to `giscus`, the only supported provider.
|
||||
- `options`: Provider-specific options. `repo`, `repoId`, `category` and `categoryId` are **required**; get them from the [Giscus site](https://giscus.app/).
|
||||
- `repo`: The GitHub repository to use for comments (`owner/name`).
|
||||
- `repoId`: The ID of the GitHub repository.
|
||||
- `category`: The discussion category to use.
|
||||
- `categoryId`: The ID of the discussion category.
|
||||
- `lang`: The language for the comment system. Defaults to `en`.
|
||||
- `themeUrl`: URL to a folder with custom themes. Defaults to `https://<baseUrl>/static/giscus`.
|
||||
- `lightTheme`: Filename for the light theme CSS file. Defaults to `light`.
|
||||
- `darkTheme`: Filename for the dark theme CSS file. Defaults to `dark`.
|
||||
- `mapping`: How to map pages to discussions (`url`, `title`, `og:title`, `specific`, `number`, `pathname`). Defaults to `url`.
|
||||
- `strict`: Use strict title matching. Defaults to `true`.
|
||||
- `reactionsEnabled`: Whether to enable reactions for the main post. Defaults to `true`.
|
||||
- `inputPosition`: Where to put the comment input box relative to the comments (`top` or `bottom`). Defaults to `bottom`.
|
||||
|
||||
Set `comments: false` in a page's frontmatter to hide the comment section on that page.
|
||||
|
||||
### Default options
|
||||
|
||||
The plugin is disabled by default. The default configuration contains:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/comments"
|
||||
enabled: false
|
||||
options:
|
||||
provider: giscus
|
||||
options: {}
|
||||
layout:
|
||||
position: afterBody
|
||||
priority: 10
|
||||
```
|
||||
|
||||
To enable it, set `enabled: true` and fill in the required options, for example:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/comments"
|
||||
enabled: true
|
||||
options:
|
||||
provider: giscus
|
||||
options:
|
||||
repo: jackyzha0/quartz
|
||||
repoId: MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg
|
||||
category: Announcements
|
||||
categoryId: DIC_kwDOFxRnmM4B-Xg6
|
||||
layout:
|
||||
position: afterBody
|
||||
priority: 10
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
- Function name: `ExternalPlugin.Comments()`.
|
||||
- Source: [`quartz-community/comments`](https://github.com/quartz-community/comments)
|
||||
- Install: `npx quartz plugin add @quartz-community/comments`
|
||||
@@ -2,6 +2,7 @@
|
||||
title: ComponentResources
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
---
|
||||
|
||||
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]].
|
||||
@@ -14,5 +15,5 @@ This plugin has no configuration options.
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `Plugin.ComponentResources()`.
|
||||
- Source: [`quartz/plugins/emitters/componentResources.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/componentResources.ts).
|
||||
- Internal plugin: always runs and has no entry in `quartz.config.yaml`.
|
||||
- Source: [`quartz/plugins/emitters/componentResources.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/emitters/componentResources.ts).
|
||||
@@ -1,27 +1,51 @@
|
||||
---
|
||||
title: ContentIndex
|
||||
description: Built-in content index, sitemap and RSS feed (formerly the content-index plugin). Configured under configuration.contentIndex.
|
||||
aliases:
|
||||
- contentIndex
|
||||
- content-index
|
||||
tags:
|
||||
- plugin/emitter
|
||||
- built-in
|
||||
image:
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits both RSS and an XML sitemap for your site. The [[RSS Feed]] allows users to subscribe to content on your site and the sitemap allows search engines to better index your site. The plugin also emits a `contentIndex.json` file which is used by dynamic frontend components like search and graph.
|
||||
The content index is [[built-in processing|built into Quartz]] (it used to be the `content-index` plugin). It emits both RSS and an XML sitemap for your site. The [[RSS Feed]] allows users to subscribe to content on your site and the sitemap allows search engines to better index your site. It also emits a `contentIndex.json` file which is used by dynamic frontend components like search and graph.
|
||||
|
||||
This plugin emits a comprehensive index of the site's content, generating additional resources such as a sitemap, an RSS feed, and a
|
||||
Configure it under `configuration.contentIndex` in `quartz.config.yaml`:
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
contentIndex:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
```
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
Options:
|
||||
|
||||
- `enableSiteMap`: If `true` (default), generates a sitemap XML file (`sitemap.xml`) listing all site URLs for search engines in content discovery.
|
||||
- `enableRSS`: If `true` (default), produces an RSS feed (`index.xml`) with recent content updates.
|
||||
- `rssLimit`: Defines the maximum number of entries to include in the RSS feed, helping to focus on the most recent or relevant content. Defaults to `10`.
|
||||
- `rssFullHtml`: If `true`, the RSS feed includes full HTML content. Otherwise it includes just summaries.
|
||||
- `rssFullHtml`: If `true`, the RSS feed includes the full rendered HTML content of each page. Defaults to `false`.
|
||||
- `rssSlug`: Slug to the generated RSS feed XML file. Defaults to `"index"`.
|
||||
- `includeEmptyFiles`: If `true` (default), content files with no body text are included in the generated index and resources.
|
||||
- `enabled`: set to `false` to emit none of these files ([[full-text search|search]], [[features/explorer|explorer]] and the [[graph view]] then have no data).
|
||||
|
||||
> [!note]
|
||||
> An existing `@quartz-community/content-index` entry is applied to `configuration.contentIndex` automatically. Run `npx quartz plugin doctor --fix` to move it.
|
||||
|
||||
## `contentIndex.json`
|
||||
|
||||
Each entry of `static/contentIndex.json` is keyed by slug and holds `slug`, `filePath`, `title`, `links`, `tags` and `content` (the page's text), plus `date` when the page has one: the date selected by `defaultDateType` of [[CreatedModifiedDate]] (the same date [[ContentMeta]] shows and the RSS feed uses), as an ISO 8601 string such as `"2024-01-02T03:04:05.000Z"`. Client-side components can use it to sort by date, e.g. `new Date(entry.date)`. When that date is the one the page's frontmatter sets for the configured date type (e.g. `modified:` / `lastmod:` with `defaultDateType: modified`), rather than one from git or the file system, the entry also has `dateFromFrontmatter: true`; otherwise the field is absent.
|
||||
|
||||
## Adding fields
|
||||
|
||||
Plugins can add their own fields to each entry of `contentIndex.json` with `extendContentIndex` — see [[making plugins#Extending the content index]].
|
||||
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `Plugin.ContentIndex()`.
|
||||
- Source: [`quartz/plugins/emitters/contentIndex.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz/plugins/emitters/contentIndex.ts).
|
||||
- Category: Emitter (built-in)
|
||||
- Source: [`quartz/plugins/builtins/contentIndex.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/builtins/contentIndex.ts)
|
||||
- Can be replaced by a plugin that declares `quartz.capabilities.provides.files: ["static/contentIndex.json"]`.
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: ContentMeta
|
||||
description: Displays the page date and reading time.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/content-meta](https://github.com/quartz-community/content-meta)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin displays content metadata below the article title: the page's date and the estimated reading time.
|
||||
|
||||
The date shown is the one selected by the `defaultDateType` option of [[CreatedModifiedDate]] (`modified` by default), so no date is shown when that plugin is disabled. Pages without text content show no metadata.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `showReadingTime`: Whether to display the estimated reading time. Defaults to `true`.
|
||||
- `showComma`: Whether to display a comma between metadata items. Defaults to `true`.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: "@quartz-community/content-meta"
|
||||
enabled: true
|
||||
options:
|
||||
showReadingTime: true
|
||||
showComma: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 20
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
- Function name: `ExternalPlugin.ContentMeta()`.
|
||||
- Source: [`quartz-community/content-meta`](https://github.com/quartz-community/content-meta)
|
||||
- Install: `npx quartz plugin add @quartz-community/content-meta`
|
||||
Loaded 100 of 384 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user