create-eziwiki 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +3 -2
  2. package/package.json +1 -1
  3. package/template/app/[...slug]/page.tsx +3 -1
  4. package/template/app/globals.css +8 -4
  5. package/template/app/layout.tsx +46 -24
  6. package/template/app/robots.ts +11 -3
  7. package/template/components/graph/GraphView.tsx +20 -7
  8. package/template/components/layout/LocalGraph.tsx +52 -0
  9. package/template/components/layout/MobileMenu.tsx +16 -1
  10. package/template/components/layout/PageLayout.tsx +11 -3
  11. package/template/components/layout/Sidebar.tsx +30 -2
  12. package/template/components/markdown/LinkPreview.tsx +164 -0
  13. package/template/components/markdown/MarkdownContent.tsx +3 -1
  14. package/template/components/search/SearchTrigger.tsx +11 -4
  15. package/template/lib/content/assets.ts +158 -0
  16. package/template/lib/content/excerpt.test.ts +68 -0
  17. package/template/lib/content/excerpt.ts +142 -0
  18. package/template/lib/graph/build.ts +55 -0
  19. package/template/lib/markdown/rehype-plugins.ts +24 -2
  20. package/template/lib/markdown/remark-wikilink.ts +201 -14
  21. package/template/lib/markdown/render.ts +130 -10
  22. package/template/lib/markdown/wikilink.test.ts +30 -0
  23. package/template/lib/markdown/wikilink.ts +12 -4
  24. package/template/lib/payload/schema.ts +1 -0
  25. package/template/lib/payload/types.ts +7 -0
  26. package/template/package-lock.json +3 -83
  27. package/template/package.json +2 -0
  28. package/template/public/fonts/Pretendard/pretendard-400-korean.woff2 +0 -0
  29. package/template/public/fonts/Pretendard/pretendard-400-latin.woff2 +0 -0
  30. package/template/public/fonts/Pretendard/pretendard-600-korean.woff2 +0 -0
  31. package/template/public/fonts/Pretendard/pretendard-600-latin.woff2 +0 -0
  32. package/template/public/fonts/Pretendard/pretendard-700-korean.woff2 +0 -0
  33. package/template/public/fonts/Pretendard/pretendard-700-latin.woff2 +0 -0
  34. package/template/styles/markdown.css +76 -2
  35. package/template/styles/theme.css +7 -0
  36. package/template/vercel.json +31 -0
  37. package/template/public/fonts/Pretandard/Pretendard-Bold.woff2 +0 -0
  38. package/template/public/fonts/Pretandard/Pretendard-Regular.woff2 +0 -0
  39. package/template/public/fonts/Pretandard/Pretendard-SemiBold.woff2 +0 -0
  40. package/template/public/fonts/SUITE/SUITE-Bold.woff2 +0 -0
  41. package/template/public/fonts/SUITE/SUITE-Regular.woff2 +0 -0
  42. package/template/public/fonts/SUITE/SUITE-SemiBold.woff2 +0 -0
@@ -7,14 +7,17 @@
7
7
  "": {
8
8
  "name": "my-wiki",
9
9
  "version": "0.1.0",
10
+ "license": "MIT",
10
11
  "dependencies": {
11
12
  "@shikijs/rehype": "^4.3.1",
12
13
  "ajv": "^8.12.0",
13
14
  "ajv-formats": "^3.0.1",
15
+ "github-slugger": "^2.0.0",
14
16
  "gray-matter": "^4.0.3",
15
17
  "hast-util-to-string": "^3.0.1",
16
18
  "katex": "^0.16.47",
17
19
  "lucide-react": "^0.554.0",
20
+ "mdast-util-to-string": "^4.0.0",
18
21
  "minisearch": "^7.2.0",
19
22
  "next": "^14.2.0",
20
23
  "react": "^18.3.0",
@@ -1047,15 +1050,6 @@
1047
1050
  "url": "https://opencollective.com/pkgr"
1048
1051
  }
1049
1052
  },
1050
- "node_modules/@polka/url": {
1051
- "version": "1.0.0-next.29",
1052
- "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz",
1053
- "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==",
1054
- "dev": true,
1055
- "license": "MIT",
1056
- "optional": true,
1057
- "peer": true
1058
- },
1059
1053
  "node_modules/@rollup/rollup-android-arm-eabi": {
1060
1054
  "version": "4.53.2",
1061
1055
  "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.2.tgz",
@@ -2222,30 +2216,6 @@
2222
2216
  "url": "https://opencollective.com/vitest"
2223
2217
  }
2224
2218
  },
2225
- "node_modules/@vitest/ui": {
2226
- "version": "4.0.9",
2227
- "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.0.9.tgz",
2228
- "integrity": "sha512-6HV2HHl9aRJ09TlYj/WAQxaa797Ezb5u0LpgabthlASAUAWKgw/W1DSPX7t848mMZmIUvzZgnUHGIylAoYHP0w==",
2229
- "dev": true,
2230
- "license": "MIT",
2231
- "optional": true,
2232
- "peer": true,
2233
- "dependencies": {
2234
- "@vitest/utils": "4.0.9",
2235
- "fflate": "^0.8.2",
2236
- "flatted": "^3.3.3",
2237
- "pathe": "^2.0.3",
2238
- "sirv": "^3.0.2",
2239
- "tinyglobby": "^0.2.15",
2240
- "tinyrainbow": "^3.0.3"
2241
- },
2242
- "funding": {
2243
- "url": "https://opencollective.com/vitest"
2244
- },
2245
- "peerDependencies": {
2246
- "vitest": "4.0.9"
2247
- }
2248
- },
2249
2219
  "node_modules/@vitest/utils": {
2250
2220
  "version": "4.0.9",
2251
2221
  "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.9.tgz",
@@ -4288,15 +4258,6 @@
4288
4258
  "reusify": "^1.0.4"
4289
4259
  }
4290
4260
  },
4291
- "node_modules/fflate": {
4292
- "version": "0.8.2",
4293
- "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
4294
- "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
4295
- "dev": true,
4296
- "license": "MIT",
4297
- "optional": true,
4298
- "peer": true
4299
- },
4300
4261
  "node_modules/file-entry-cache": {
4301
4262
  "version": "6.0.1",
4302
4263
  "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
@@ -6793,18 +6754,6 @@
6793
6754
  "integrity": "sha512-dqT2XBYUOZOiC5t2HRnwADjhNS2cecp9u+TJRiJ1Qp/f5qjkeT5APcGPjHw+bz89Ms8Jp+cG4AlE+QZ/QnDglg==",
6794
6755
  "license": "MIT"
6795
6756
  },
6796
- "node_modules/mrmime": {
6797
- "version": "2.0.1",
6798
- "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",
6799
- "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==",
6800
- "dev": true,
6801
- "license": "MIT",
6802
- "optional": true,
6803
- "peer": true,
6804
- "engines": {
6805
- "node": ">=10"
6806
- }
6807
- },
6808
6757
  "node_modules/ms": {
6809
6758
  "version": "2.1.3",
6810
6759
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -8349,23 +8298,6 @@
8349
8298
  "url": "https://github.com/sponsors/isaacs"
8350
8299
  }
8351
8300
  },
8352
- "node_modules/sirv": {
8353
- "version": "3.0.2",
8354
- "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz",
8355
- "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==",
8356
- "dev": true,
8357
- "license": "MIT",
8358
- "optional": true,
8359
- "peer": true,
8360
- "dependencies": {
8361
- "@polka/url": "^1.0.0-next.24",
8362
- "mrmime": "^2.0.0",
8363
- "totalist": "^3.0.0"
8364
- },
8365
- "engines": {
8366
- "node": ">=18"
8367
- }
8368
- },
8369
8301
  "node_modules/slash": {
8370
8302
  "version": "3.0.0",
8371
8303
  "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -8955,18 +8887,6 @@
8955
8887
  "node": ">=8.0"
8956
8888
  }
8957
8889
  },
8958
- "node_modules/totalist": {
8959
- "version": "3.0.1",
8960
- "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz",
8961
- "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==",
8962
- "dev": true,
8963
- "license": "MIT",
8964
- "optional": true,
8965
- "peer": true,
8966
- "engines": {
8967
- "node": ">=6"
8968
- }
8969
- },
8970
8890
  "node_modules/trim-lines": {
8971
8891
  "version": "3.0.1",
8972
8892
  "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
@@ -24,10 +24,12 @@
24
24
  "@shikijs/rehype": "^4.3.1",
25
25
  "ajv": "^8.12.0",
26
26
  "ajv-formats": "^3.0.1",
27
+ "github-slugger": "^2.0.0",
27
28
  "gray-matter": "^4.0.3",
28
29
  "hast-util-to-string": "^3.0.1",
29
30
  "katex": "^0.16.47",
30
31
  "lucide-react": "^0.554.0",
32
+ "mdast-util-to-string": "^4.0.0",
31
33
  "minisearch": "^7.2.0",
32
34
  "next": "^14.2.0",
33
35
  "react": "^18.3.0",
@@ -31,14 +31,14 @@
31
31
  font-size: 0.75rem;
32
32
  text-transform: uppercase;
33
33
  letter-spacing: 0.03em;
34
- color: var(--color-text-muted);
34
+ color: var(--color-code-muted);
35
35
  }
36
36
 
37
37
  .ezw-code__copy {
38
38
  font-size: 0.75rem;
39
39
  padding: 0.25rem 0.5rem;
40
40
  border-radius: 0.25rem;
41
- color: var(--color-text-muted);
41
+ color: var(--color-code-muted);
42
42
  background: transparent;
43
43
  transition:
44
44
  color 0.15s ease,
@@ -165,3 +165,77 @@ html.dark .ezw-broken-link {
165
165
  white-space: normal;
166
166
  }
167
167
  }
168
+
169
+ /* Content pulled in from another page with `![[wiki link]]`.
170
+ Set apart so a reader can tell borrowed text from the page's own, and
171
+ attributed so they can follow it back to where it is maintained. */
172
+ .ezw-transclusion {
173
+ margin: 1.5rem 0;
174
+ padding: 1rem 1.25rem;
175
+ border: 1px solid var(--color-border);
176
+ border-left: 3px solid var(--color-primary, #2563eb);
177
+ border-radius: 0.375rem;
178
+ background: var(--color-sidebar-bg);
179
+ }
180
+
181
+ .ezw-transclusion > :first-child {
182
+ margin-top: 0;
183
+ }
184
+
185
+ .ezw-transclusion__source {
186
+ margin: 0.75rem 0 0;
187
+ padding-top: 0.5rem;
188
+ border-top: 1px solid var(--color-border);
189
+ font-size: 0.8125rem;
190
+ color: var(--color-text-muted);
191
+ }
192
+
193
+ .ezw-transclusion__source::before {
194
+ content: 'From ';
195
+ }
196
+
197
+ /* Card shown when a reader hovers or focuses a wiki link. Its contents are
198
+ already on the anchor from the build, so it never waits on a request. */
199
+ .ezw-link-preview {
200
+ position: fixed;
201
+ z-index: 60;
202
+ padding: 0.75rem 0.875rem;
203
+ border: 1px solid var(--color-border);
204
+ border-radius: 0.5rem;
205
+ background: var(--color-background);
206
+ box-shadow:
207
+ 0 4px 6px -1px rgb(0 0 0 / 0.1),
208
+ 0 2px 4px -2px rgb(0 0 0 / 0.1);
209
+ /* Purely informational, so it never intercepts the pointer heading for the
210
+ link underneath it. */
211
+ pointer-events: none;
212
+ }
213
+
214
+ .ezw-link-preview__title {
215
+ margin: 0;
216
+ font-size: 0.875rem;
217
+ font-weight: 600;
218
+ color: var(--color-text);
219
+ }
220
+
221
+ .ezw-link-preview__excerpt {
222
+ margin: 0.375rem 0 0;
223
+ font-size: 0.8125rem;
224
+ line-height: 1.5;
225
+ color: var(--color-text-muted);
226
+ }
227
+
228
+ @media (prefers-reduced-motion: no-preference) {
229
+ .ezw-link-preview {
230
+ animation: ezw-link-preview-in 120ms ease-out;
231
+ }
232
+
233
+ @keyframes ezw-link-preview-in {
234
+ from {
235
+ opacity: 0;
236
+ }
237
+ to {
238
+ opacity: 1;
239
+ }
240
+ }
241
+ }
@@ -28,6 +28,11 @@
28
28
  /* Code block colors */
29
29
  --color-code-bg: #f3f4f6;
30
30
  --color-code-text: #1f2937;
31
+ /* Secondary text inside a code block. Darker than --color-text-muted, which
32
+ reaches only 4.39:1 against the code background and so falls short of the
33
+ 4.5:1 that the small type used for the language label and the copy button
34
+ needs. */
35
+ --color-code-muted: #4b5563;
31
36
 
32
37
  /* Border colors */
33
38
  --color-border: #e5e7eb;
@@ -59,6 +64,8 @@
59
64
  /* Code block colors */
60
65
  --color-code-bg: #374151;
61
66
  --color-code-text: #f9fafb;
67
+ /* See the light theme: the muted grey reaches only 4.06:1 here. */
68
+ --color-code-muted: #d1d5db;
62
69
 
63
70
  /* Border colors */
64
71
  --color-border: #374151;
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://openapi.vercel.sh/vercel.json",
3
+ "headers": [
4
+ {
5
+ "source": "/fonts/(.*)",
6
+ "headers": [{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }]
7
+ },
8
+ {
9
+ "source": "/images/(.*)",
10
+ "headers": [{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }]
11
+ },
12
+ {
13
+ "source": "/(search-index.json|favicon.svg|og-image.svg)",
14
+ "headers": [
15
+ {
16
+ "key": "Cache-Control",
17
+ "value": "public, max-age=0, s-maxage=86400, stale-while-revalidate=604800"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "source": "/(.*)",
23
+ "headers": [
24
+ { "key": "X-Content-Type-Options", "value": "nosniff" },
25
+ { "key": "X-Frame-Options", "value": "SAMEORIGIN" },
26
+ { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" },
27
+ { "key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=()" }
28
+ ]
29
+ }
30
+ ]
31
+ }