diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index cdab503..1ad384d 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -9,6 +9,11 @@ export default defineUserConfig({ headers: { level: [2, 3, 4, 5], }, + anchor: { + permalink: true, + permalinkBefore: true, + permalinkSymbol: '#', + }, }, plugins, bundler: viteBundler({ @@ -19,4 +24,14 @@ export default defineUserConfig({ }, }), head: headFunctions, + scrollBehavior(to, from, savedPosition) { + if (to.hash) { + return { + el: to.hash, + behavior: 'smooth', + top: 80, // Adjust based on your header height + } + } + return savedPosition || { top: 0 } + }, });