Skip to content

Commit d0c22b8

Browse files
Merge pull request #681 from DuendeSoftware/external-links-rehype
Add rehype-external-links for external link handling
2 parents de6d5f4 + c12463b commit d0c22b8

File tree

3 files changed

+26
-30
lines changed

3 files changed

+26
-30
lines changed

astro.config.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import starlightLlmsTxt from "starlight-llms-txt";
1111
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
1212
import opengraphImages from "astro-opengraph-images";
1313
import { duendeOpenGraphImage } from "./src/components/duende-og-image.js";
14+
import rehypeExternalLinks from "rehype-external-links";
1415
import * as fs from "node:fs";
1516

1617
// https://astro.build/config
@@ -75,7 +76,7 @@ export default defineConfig({
7576
defer: true,
7677
async: true,
7778
},
78-
}
79+
},
7980
],
8081
logo: {
8182
light: "./src/assets/duende-logo.svg",
@@ -191,6 +192,13 @@ export default defineConfig({
191192
},
192193
},
193194
],
195+
[
196+
rehypeExternalLinks,
197+
{
198+
target: "_blank",
199+
rel: ["noopener", "noreferrer"],
200+
},
201+
],
194202
],
195203
},
196204
});

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"jsdom": "^26.0.0",
3636
"patch-package": "^8.0.0",
3737
"react": "^19.0.0",
38+
"rehype-external-links": "^3.0.0",
3839
"satori": "^0.12.1",
3940
"sharp": "^0.34.1",
4041
"starlight-auto-sidebar": "^0.1.1",

0 commit comments

Comments
 (0)