diff --git a/.vitepress/config.mts b/.vitepress/config.mts index de24b3a0..1ed00719 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -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.", diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 599e919c..ab211c63 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -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' @@ -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() { diff --git a/package.json b/package.json index 51136c91..1dd6ddc7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c3882592..8f35409d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@mdit-vue/shared': specifier: ^2.1.3 version: 2.1.3 + '@nolebase/vitepress-plugin-enhanced-readabilities': + specifier: ^2.2.0 + version: 2.2.0(@algolia/client-search@4.24.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0) less: specifier: ^4.2.0 version: 4.2.0 @@ -20,6 +23,9 @@ importers: sass: specifier: ^1.77.6 version: 1.77.6 + vite: + specifier: ^5.3.2 + version: 5.3.2(less@4.2.0)(sass@1.77.6) vitepress: specifier: 1.2.3 version: 1.2.3(@algolia/client-search@4.24.0)(less@4.2.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0) @@ -283,6 +289,18 @@ packages: peerDependencies: vue: '>=3.2.0' + '@iconify-json/carbon@1.1.36': + resolution: {integrity: sha512-NC3VcqLtwLZpi7+LeXj+99/byv+asrnCQxiDNCZV6hKr9WcNh6C25kJguJYfN+dV54kOkw78e+6PitQi2Bppnw==} + + '@iconify-json/icon-park-outline@1.1.15': + resolution: {integrity: sha512-jQbk/ETARyYPjX6HolkdjSLJHsNCfSBfYUqcUQLXYK/1tfuVnQsUdWG2IM2a7VBpxJtrK7r4n1iwPOFaZ5T46g==} + + '@iconify-json/octicon@1.1.55': + resolution: {integrity: sha512-TWVO7olfquviijdmdrEbvpjPTxBmVvU0ZoR9BBx9pIhvEsG7emefrLg7eZm1CYGYM+9StkksDbqha8HCy/6kzQ==} + + '@iconify/types@2.0.0': + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} @@ -298,6 +316,12 @@ packages: '@mdit-vue/types@2.1.0': resolution: {integrity: sha512-TMBB/BQWVvwtpBdWD75rkZx4ZphQ6MN0O4QB2Bc0oI5PC2uE57QerhNxdRZ7cvBHE2iY2C+BUNUziCfJbjIRRA==} + '@nolebase/ui@2.2.0': + resolution: {integrity: sha512-i2OITf/g/3lpwib1X8NFzJNDOZC2rgUxG0gkwo8mBV2C9pq5WHixBybrwDM54QY1n38Rpg/ZXgoH1jiVuPQewQ==} + + '@nolebase/vitepress-plugin-enhanced-readabilities@2.2.0': + resolution: {integrity: sha512-qdE+yDs4Eso5LZ44vsCO7nG0IGOxmaBhXxrbAm58/vESer/V6/sTWNv5LyrsrQ+QUbLooBEK7PQwrQ5ClKe4fA==} + '@rollup/rollup-android-arm-eabi@4.18.0': resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} cpu: [arm] @@ -1054,6 +1078,20 @@ snapshots: giscus: 1.5.0 vue: 3.4.31 + '@iconify-json/carbon@1.1.36': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/icon-park-outline@1.1.15': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/octicon@1.1.55': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify/types@2.0.0': {} + '@jridgewell/sourcemap-codec@1.4.15': {} '@lit-labs/ssr-dom-shim@1.2.0': {} @@ -1070,6 +1108,75 @@ snapshots: '@mdit-vue/types@2.1.0': {} + '@nolebase/ui@2.2.0(@algolia/client-search@4.24.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0)': + dependencies: + '@iconify-json/octicon': 1.1.55 + less: 4.2.0 + vitepress: 1.2.3(@algolia/client-search@4.24.0)(less@4.2.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0) + vue: 3.4.31 + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/node' + - '@types/react' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode + - lightningcss + - markdown-it-mathjax3 + - nprogress + - postcss + - qrcode + - react + - react-dom + - sass + - search-insights + - sortablejs + - stylus + - sugarss + - terser + - typescript + - universal-cookie + + '@nolebase/vitepress-plugin-enhanced-readabilities@2.2.0(@algolia/client-search@4.24.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0)': + dependencies: + '@iconify-json/carbon': 1.1.36 + '@iconify-json/icon-park-outline': 1.1.15 + '@nolebase/ui': 2.2.0(@algolia/client-search@4.24.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0) + less: 4.2.0 + vitepress: 1.2.3(@algolia/client-search@4.24.0)(less@4.2.0)(postcss@8.4.38)(sass@1.77.6)(search-insights@2.14.0) + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/node' + - '@types/react' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode + - lightningcss + - markdown-it-mathjax3 + - nprogress + - postcss + - qrcode + - react + - react-dom + - sass + - search-insights + - sortablejs + - stylus + - sugarss + - terser + - typescript + - universal-cookie + '@rollup/rollup-android-arm-eabi@4.18.0': optional: true diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 00000000..5d301479 --- /dev/null +++ b/vite.config.js @@ -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... + } +}) \ No newline at end of file