docs: add custom anchor example (#2130)

pull/2131/head
Danny Lin 2 years ago committed by GitHub
parent ae3041142e
commit 399117088b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,6 +6,16 @@ VitePress comes with built in Markdown Extensions.
Headers automatically get anchor links applied. Rendering of anchors can be configured using the `markdown.anchor` option.
### Custom anchors
To specify a custom anchor tag for a heading instead of using the auto-generated one, add a suffix to the heading:
```
# Using custom anchors {#my-anchor}
```
This allows you to link to the heading as `#my-anchor` instead of the default `#using-custom-anchors`.
## Links
Both internal and external links gets special treatments.

Loading…
Cancel
Save