Skip to content

Commit 104a0c3

Browse files
authored
Table of contents in blog (#46)
1 parent 1ca8b07 commit 104a0c3

File tree

12 files changed

+202
-213
lines changed

12 files changed

+202
-213
lines changed

mdsvex.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// import remarkPlugins from './src/plugins/remark/index.js';
21
import relativeImages from 'mdsvex-relative-images'
32
import rehypeExternalLinks from 'rehype-external-links'
3+
import rehypeSlug from 'rehype-slug'
44
import rehypePlugins from './src/plugins/rehype/index.js'
5+
import remarkExportToc from './src/plugins/remark-toc.js'
56

67
export default {
78
extensions: ['.md'],
89
smartypants: {
9-
dashes: 'oldschool'
10+
dashes: 'oldschool',
1011
},
11-
remarkPlugins: [relativeImages],
12-
// remarkPlugins: [...Object.values(remarkPlugins)],
12+
remarkPlugins: [remarkExportToc, relativeImages],
1313
rehypePlugins: [
14-
[rehypeExternalLinks, { target: '_blank', rel: ['noopener', 'noreferrer'] }],
15-
...Object.values(rehypePlugins)
16-
]
14+
[rehypeSlug, rehypeExternalLinks, { target: '_blank', rel: ['noopener', 'noreferrer'] }],
15+
...Object.values(rehypePlugins),
16+
],
1717
}

package-lock.json

Lines changed: 73 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"tailwindcss": "^3.4.4",
4444
"tslib": "^2.4.1",
4545
"typescript": "^5.0.0",
46+
"unist-util-visit": "^5.0.0",
4647
"vite": "^5.0.3",
4748
"vite-plugin-compression2": "^1.3.3",
4849
"vite-plugin-image-optimizer": "^1.1.8"

src/lib/app.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
html {
1010
scroll-behavior: smooth;
11+
scroll-padding-top: 80px;
1112
}
1213

1314
@font-face {

0 commit comments

Comments
 (0)