Skip to content

Commit 09d2d44

Browse files
committed
add astro-rehype-relative-markdown-links
1 parent 9d4149c commit 09d2d44

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

docs_headless/astro.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import rehypeCodeGroup from 'rehype-code-group';
99
import expressiveCode from 'astro-expressive-code';
1010
import { pluginFullscreen } from 'expressive-code-fullscreen';
1111
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections';
12+
import rehypeAstroRelativeMarkdownLinks from 'astro-rehype-relative-markdown-links';
1213

1314
// https://astro.build/config
1415
export default defineConfig({
@@ -117,7 +118,16 @@ export default defineConfig({
117118
mdx(),
118119
],
119120
markdown: {
120-
rehypePlugins: [rehypeCodeGroup],
121+
rehypePlugins: [
122+
rehypeCodeGroup,
123+
[
124+
rehypeAstroRelativeMarkdownLinks,
125+
{
126+
// Do not apply a base segment to the transformed URL path
127+
collectionBase: false,
128+
},
129+
],
130+
],
121131
},
122132
vite: {
123133
plugins: [tailwindcss()],

docs_headless/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@types/react-dom": "^19.1.6",
2121
"astro": "5.12.6",
2222
"astro-expressive-code": "^0.41.3",
23+
"astro-rehype-relative-markdown-links": "^0.18.1",
2324
"expressive-code-fullscreen": "^1.0.0",
2425
"react": "^18.3.1",
2526
"react-dom": "^18.3.1",

docs_headless/src/content/docs/headless/reference/example.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Less concerned with telling a story or addressing a specific use case, they shou
88

99
## Tests
1010

11-
- [General Concepts](/guides/architecture)
12-
- [Data Fetching](/guides/datafetchingguide)
11+
- [General Concepts](../guides/Architecture.md)
12+
- [Data Fetching](../guides/datafetchingguide.mdx)

docs_headless/src/content/docs/shadcn/reference/example.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Less concerned with telling a story or addressing a specific use case, they shou
88

99
## Tests
1010

11-
- [General Concepts](/guides/architecture)
12-
- [Data Fetching](/guides/datafetchingguide)
11+
- [General Concepts](../guides/Architecture.md)
12+
- [Data Fetching](../guides/DataFetchingGuide.md)

yarn.lock

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7769,6 +7769,24 @@ __metadata:
77697769
languageName: node
77707770
linkType: hard
77717771

7772+
"astro-rehype-relative-markdown-links@npm:^0.18.1":
7773+
version: 0.18.1
7774+
resolution: "astro-rehype-relative-markdown-links@npm:0.18.1"
7775+
dependencies:
7776+
catch-unknown: "npm:^2.0.0"
7777+
debug: "npm:^4.4.0"
7778+
github-slugger: "npm:^2.0.0"
7779+
gray-matter: "npm:^4.0.3"
7780+
is-absolute-url: "npm:^4.0.1"
7781+
unified: "npm:^11.0.5"
7782+
unist-util-visit: "npm:^5.0.0"
7783+
zod: "npm:^3.23.8"
7784+
peerDependencies:
7785+
astro: ">=2 <6"
7786+
checksum: f1819464b8ba0d27dcb7656c7b1115ea750b3e0968bbee0d1eb2a6d7b96217dc98822fbbe20a3b43cc7ffaf6957cf44e99d6332702b7b3bf5204c7319976b399
7787+
languageName: node
7788+
linkType: hard
7789+
77727790
"astro@npm:5.12.6":
77737791
version: 5.12.6
77747792
resolution: "astro@npm:5.12.6"
@@ -8599,6 +8617,13 @@ __metadata:
85998617
languageName: node
86008618
linkType: hard
86018619

8620+
"catch-unknown@npm:^2.0.0":
8621+
version: 2.0.0
8622+
resolution: "catch-unknown@npm:2.0.0"
8623+
checksum: eee47640c39949ab732885f7962dafed4cb61d42502d04719045ebdca30e31e361e703df9c4db4061dd3e5977612cc72e404d117fbeabfbf17f1fa14e0d8e7eb
8624+
languageName: node
8625+
linkType: hard
8626+
86028627
"ccount@npm:^2.0.0":
86038628
version: 2.0.1
86048629
resolution: "ccount@npm:2.0.1"
@@ -11638,6 +11663,15 @@ __metadata:
1163811663
languageName: node
1163911664
linkType: hard
1164011665

11666+
"extend-shallow@npm:^2.0.1":
11667+
version: 2.0.1
11668+
resolution: "extend-shallow@npm:2.0.1"
11669+
dependencies:
11670+
is-extendable: "npm:^0.1.0"
11671+
checksum: ee1cb0a18c9faddb42d791b2d64867bd6cfd0f3affb711782eb6e894dd193e2934a7f529426aac7c8ddb31ac5d38000a00aa2caf08aa3dfc3e1c8ff6ba340bd9
11672+
languageName: node
11673+
linkType: hard
11674+
1164111675
"extend@npm:^3.0.0, extend@npm:~3.0.2":
1164211676
version: 3.0.2
1164311677
resolution: "extend@npm:3.0.2"
@@ -12831,6 +12865,18 @@ __metadata:
1283112865
languageName: node
1283212866
linkType: hard
1283312867

12868+
"gray-matter@npm:^4.0.3":
12869+
version: 4.0.3
12870+
resolution: "gray-matter@npm:4.0.3"
12871+
dependencies:
12872+
js-yaml: "npm:^3.13.1"
12873+
kind-of: "npm:^6.0.2"
12874+
section-matter: "npm:^1.0.0"
12875+
strip-bom-string: "npm:^1.0.0"
12876+
checksum: e38489906dad4f162ca01e0dcbdbed96d1a53740cef446b9bf76d80bec66fa799af07776a18077aee642346c5e1365ed95e4c91854a12bf40ba0d4fb43a625a6
12877+
languageName: node
12878+
linkType: hard
12879+
1283412880
"h3@npm:^1.15.3":
1283512881
version: 1.15.3
1283612882
resolution: "h3@npm:1.15.3"
@@ -13853,6 +13899,13 @@ __metadata:
1385313899
languageName: node
1385413900
linkType: hard
1385513901

13902+
"is-absolute-url@npm:^4.0.1":
13903+
version: 4.0.1
13904+
resolution: "is-absolute-url@npm:4.0.1"
13905+
checksum: 6f8f603945bd9f2c6031758bbc12352fc647bd5d807cad10d96cc6300fd0e15240cc091521a61db767e4ec0bacff257b4f1015fd5249c147bbb4a4497356c72e
13906+
languageName: node
13907+
linkType: hard
13908+
1385613909
"is-alphabetical@npm:^2.0.0":
1385713910
version: 2.0.1
1385813911
resolution: "is-alphabetical@npm:2.0.1"
@@ -14039,6 +14092,13 @@ __metadata:
1403914092
languageName: node
1404014093
linkType: hard
1404114094

14095+
"is-extendable@npm:^0.1.0":
14096+
version: 0.1.1
14097+
resolution: "is-extendable@npm:0.1.1"
14098+
checksum: dd5ca3994a28e1740d1e25192e66eed128e0b2ff161a7ea348e87ae4f616554b486854de423877a2a2c171d5f7cd6e8093b91f54533bc88a59ee1c9838c43879
14099+
languageName: node
14100+
linkType: hard
14101+
1404214102
"is-extendable@npm:^1.0.0":
1404314103
version: 1.0.1
1404414104
resolution: "is-extendable@npm:1.0.1"
@@ -15403,7 +15463,7 @@ __metadata:
1540315463
languageName: node
1540415464
linkType: hard
1540515465

15406-
"kind-of@npm:^6.0.2, kind-of@npm:^6.0.3":
15466+
"kind-of@npm:^6.0.0, kind-of@npm:^6.0.2, kind-of@npm:^6.0.3":
1540715467
version: 6.0.3
1540815468
resolution: "kind-of@npm:6.0.3"
1540915469
checksum: 61cdff9623dabf3568b6445e93e31376bee1cdb93f8ba7033d86022c2a9b1791a1d9510e026e6465ebd701a6dd2f7b0808483ad8838341ac52f003f512e0b4c4
@@ -19441,6 +19501,7 @@ __metadata:
1944119501
"@types/react-dom": "npm:^19.1.6"
1944219502
astro: "npm:5.12.6"
1944319503
astro-expressive-code: "npm:^0.41.3"
19504+
astro-rehype-relative-markdown-links: "npm:^0.18.1"
1944419505
expressive-code-fullscreen: "npm:^1.0.0"
1944519506
prettier: "npm:^3.2.5"
1944619507
prettier-plugin-astro: "npm:^0.14.1"
@@ -21361,6 +21422,16 @@ __metadata:
2136121422
languageName: node
2136221423
linkType: hard
2136321424

21425+
"section-matter@npm:^1.0.0":
21426+
version: 1.0.0
21427+
resolution: "section-matter@npm:1.0.0"
21428+
dependencies:
21429+
extend-shallow: "npm:^2.0.1"
21430+
kind-of: "npm:^6.0.0"
21431+
checksum: 8007f91780adc5aaa781a848eaae50b0f680bbf4043b90cf8a96778195b8fab690c87fe7a989e02394ce69890e330811ec8dab22397d384673ce59f7d750641d
21432+
languageName: node
21433+
linkType: hard
21434+
2136421435
"semver-compare@npm:^1.0.0":
2136521436
version: 1.0.0
2136621437
resolution: "semver-compare@npm:1.0.0"
@@ -22396,6 +22467,13 @@ __metadata:
2239622467
languageName: node
2239722468
linkType: hard
2239822469

22470+
"strip-bom-string@npm:^1.0.0":
22471+
version: 1.0.0
22472+
resolution: "strip-bom-string@npm:1.0.0"
22473+
checksum: 5c5717e2643225aa6a6d659d34176ab2657037f1fe2423ac6fcdb488f135e14fef1022030e426d8b4d0989e09adbd5c3288d5d3b9c632abeefd2358dfc512bca
22474+
languageName: node
22475+
linkType: hard
22476+
2239922477
"strip-bom@npm:^3.0.0":
2240022478
version: 3.0.0
2240122479
resolution: "strip-bom@npm:3.0.0"
@@ -24701,7 +24779,7 @@ __metadata:
2470124779
languageName: node
2470224780
linkType: hard
2470324781

24704-
"zod@npm:^3.22.1, zod@npm:^3.24.2, zod@npm:^3.24.4":
24782+
"zod@npm:^3.22.1, zod@npm:^3.23.8, zod@npm:^3.24.2, zod@npm:^3.24.4":
2470524783
version: 3.25.76
2470624784
resolution: "zod@npm:3.25.76"
2470724785
checksum: 5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c

0 commit comments

Comments
 (0)