chore(docs): added comment for target field (#1465)
--------- Signed-off-by: 秋雨落 <i@rain.cx> Co-authored-by-agent: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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 `<a>` tag clicks for SPA navigation, which can cause routing errors for external links.<br/>
|
||||
* Adding a `target` attribute allows the browser to handle the navigation natively, avoiding this problem.
|
||||
*
|
||||
* See:<br/>
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#target<br/>
|
||||
* https://stackoverflow.com/questions/79348337/redirect-main-title-link-in-vitepress-to-my-personal-website/79386388#79386388
|
||||
*/
|
||||
target?: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user