Skip to content

Commit

Permalink
add code fold feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Dec 16, 2023
1 parent 28305a5 commit 01b9979
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
5 changes: 5 additions & 0 deletions learn/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme';
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import codeblocksFold from 'vitepress-plugin-codeblocks-fold';
import 'vitepress-plugin-codeblocks-fold/style/index.scss';
import { useData, useRoute } from 'vitepress';

export default {
Expand All @@ -13,6 +15,9 @@ export default {
const { frontmatter } = useData();
const route = useRoute();

// code fold support
codeblocksFold({ route, frontmatter }, true, 400);

// Obtain configuration from: https://giscus.app/
giscusTalk({
repo: 'learnzig/learnzig',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"vitepress": "^1.0.0-rc.11"
},
"dependencies": {
"sass": "^1.69.5",
"vitepress-plugin-codeblocks-fold": "^1.2.28",
"vitepress-plugin-comment-with-giscus": "^1.1.11"
}
}

0 comments on commit 01b9979

Please sign in to comment.