diff --git a/docs/.vitepress/theme/config.ts b/docs/.vitepress/theme/config.ts index a5d0c8d3e..18bcd6133 100644 --- a/docs/.vitepress/theme/config.ts +++ b/docs/.vitepress/theme/config.ts @@ -8,10 +8,22 @@ interface HomePageConfig { buttons: ButtonItem[] } -export interface ButtonItem { +export interface ButtonItem extends Link { + primary?: boolean +} + +export interface Link { text?: string link?: string - primary?: boolean + + /** + * VitePress intercepts `` tag clicks for SPA navigation, which can cause routing errors for external links.
+ * Adding a `target` attribute allows the browser to handle the navigation natively, avoiding this problem. + * + * See:
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#target
+ * https://stackoverflow.com/questions/79348337/redirect-main-title-link-in-vitepress-to-my-personal-website/79386388#79386388 + */ target?: string }