From 395c07e8e41a262d3ce534f8e1058302c5029f85 Mon Sep 17 00:00:00 2001 From: Chen Hui Jing <1461498+huijing@users.noreply.github.com> Date: Wed, 29 May 2024 12:02:52 +0800 Subject: [PATCH] Add starlight links validator --- astro.config.mjs | 2 ++ package.json | 7 ++++--- src/content/docs/content/markdown.mdx | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 028ca2c..7b8ccbc 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,6 +2,7 @@ import { defineConfig } from "astro/config"; import starlight from "@astrojs/starlight"; import remarkMath from "remark-math"; import rehypeMathjax from "rehype-mathjax"; +import starlightLinksValidator from "starlight-links-validator"; // https://astro.build/config export default defineConfig({ @@ -19,6 +20,7 @@ export default defineConfig({ "./node_modules/@interledger/docs-design-system/src/styles/teal-theme.css", "./node_modules/@interledger/docs-design-system/src/styles/ilf-docs.css", ], + plugins: [starlightLinksValidator()], expressiveCode: { styleOverrides: { borderColor: "transparent", diff --git a/package.json b/package.json index f2f61ca..aa411d6 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.22.3", + "@astrojs/starlight": "^0.23.2", "@interledger/docs-design-system": "^0.5.0", - "astro": "^4.8.3", + "astro": "^4.9.2", "rehype-mathjax": "^6.0.0", "remark-math": "^6.0.0", - "sharp": "^0.33.3" + "sharp": "^0.33.4", + "starlight-links-validator": "^0.9.0" } } diff --git a/src/content/docs/content/markdown.mdx b/src/content/docs/content/markdown.mdx index 50552ca..8aa999c 100644 --- a/src/content/docs/content/markdown.mdx +++ b/src/content/docs/content/markdown.mdx @@ -28,10 +28,10 @@ Text can be **bold**, _italic_, or ~~strikethrough~~. Text can be **bold**, _italic_, or ~~strikethrough~~. ``` -You can [link to another page](/getting-started/). +You can [link to another page](/). ```md -You can [link to another page](/getting-started/). +You can [link to another page](/). ``` You can highlight `inline code` with backticks. @@ -120,6 +120,7 @@ npm create astro@latest -- --template starlight ### Custom titles You can specify a custom title for the aside in square brackets following the aside type. For example: + ``` :::tip[Did you know?] ``` @@ -213,7 +214,7 @@ I mean, at least it works by default now, right? ````js ```js title="Starlight default title style" I mean, at least it works by default now, right? -``` +```; ```` Code blocks will be rendered as a terminal window if their language identifier is `bash`, `shellscript`, `shell`, `sh`, or `zsh`. Titles are styled differently in this context.