Skip to content

Commit

Permalink
Add Layout Assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
misike12 committed Jun 29, 2024
1 parent aabd614 commit 7b4369f
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ import taskLists from 'markdown-it-task-checkbox'
// https://vitepress.dev/reference/site-config
export default defineConfig({

vite: {
optimizeDeps: {
exclude: [
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
],
},
ssr: {
noExternal: [
// If there are other packages that need to be processed by Vite, you can add them here.
'@nolebase/vitepress-plugin-enhanced-readabilities',
],
},
},

title: "MCDOC",
lang: 'en-US',
description: "An Ultimate Collection of Minecraft History, Tools & Unlockers.",
Expand Down
13 changes: 12 additions & 1 deletion .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { onMounted, watch, nextTick } from 'vue';

import giscusTalk from 'vitepress-plugin-comment-with-giscus';

import {
NolebaseEnhancedReadabilitiesMenu,
NolebaseEnhancedReadabilitiesScreenMenu,
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'

import Video from './components/Video.vue'
import MNavLinks from './components/MNavLinks.vue'
import Navlink from './components/Navlink.vue'
Expand All @@ -35,7 +41,12 @@ export default {
props.class = frontmatter.value.layoutClass
}

return h(DefaultTheme.Layout, props)
return h(DefaultTheme.Layout, props, {
// A enhanced readabilities menu for wider screens
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
// A enhanced readabilities menu for narrower screens (usually smaller than iPad Mini)
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
})
},

setup() {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"devDependencies": {
"@mdit-vue/shared": "^2.1.3",
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.2.0",
"less": "^4.2.0",
"medium-zoom": "^1.1.0",
"sass": "^1.77.6",
"vite": "^5.3.2",
"vitepress": "1.2.3",
"vitepress-markdown-timeline": "^1.2.1",
"vitepress-plugin-comment-with-giscus": "^1.1.15",
Expand Down
107 changes: 107 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from 'vite'

export default defineConfig(() => {
return {
optimizeDeps: {
exclude: [
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
'vitepress'
],
},
ssr: {
noExternal: [
// If there are other packages that need to be processed by Vite, you can add them here.
'@nolebase/vitepress-plugin-enhanced-readabilities',
],
},
plugins: [
// other vite plugins...
],
// other vite configurations...
}
})

0 comments on commit 7b4369f

Please sign in to comment.