Skip to content

Commit

Permalink
Update config.ts
Browse files Browse the repository at this point in the history
fixing internal links blank page behaviour
  • Loading branch information
bogdanssh authored Jan 17, 2025
1 parent 3ad7316 commit ae09e3f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export default defineUserConfig({
headers: {
level: [2, 3, 4, 5],
},
anchor: {
permalink: true,
permalinkBefore: true,
permalinkSymbol: '#',
},
},
plugins,
bundler: viteBundler({
Expand All @@ -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 }
},
});

0 comments on commit ae09e3f

Please sign in to comment.