Skip to content

Commit a9ab571

Browse files
authored
Merge pull request #96 from cloudlinux/bogdanssh-patch-5
Update config.ts
2 parents 3ad7316 + ae09e3f commit a9ab571

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/.vuepress/config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export default defineUserConfig({
99
headers: {
1010
level: [2, 3, 4, 5],
1111
},
12+
anchor: {
13+
permalink: true,
14+
permalinkBefore: true,
15+
permalinkSymbol: '#',
16+
},
1217
},
1318
plugins,
1419
bundler: viteBundler({
@@ -19,4 +24,14 @@ export default defineUserConfig({
1924
},
2025
}),
2126
head: headFunctions,
27+
scrollBehavior(to, from, savedPosition) {
28+
if (to.hash) {
29+
return {
30+
el: to.hash,
31+
behavior: 'smooth',
32+
top: 80, // Adjust based on your header height
33+
}
34+
}
35+
return savedPosition || { top: 0 }
36+
},
2237
});

0 commit comments

Comments
 (0)