Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
misike12 committed Dec 28, 2024
1 parent d63ae7a commit de9cf5f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 37 deletions.
31 changes: 8 additions & 23 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,24 @@ import { BiDirectionalLinks } from '@nolebase/markdown-it-bi-directional-links'
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import { InlineLinkPreviewElementTransform } from '@nolebase/vitepress-plugin-inline-link-preview/markdown-it'
import { GitChangelog, GitChangelogMarkdownSection } from '@nolebase/vitepress-plugin-git-changelog/vite'
import { PageProperties } from '@nolebase/vitepress-plugin-page-properties/vite'

// https://vitepress.dev/reference/site-config
export default defineConfig({

extends: {
vite: {
plugins: [
GitChangelog({
// Fill in your repository URL here
repoURL: () => 'https://github.com/openm-project/mcdoc.github.io',
}),
}) as any,
GitChangelogMarkdownSection({
sections: {
disableChangelog: false,
disableContributors: true,
},
}),
}) as any,
PageProperties(),
],
build: {
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.css')) {
return `assets/css/[name][extname]`
}
return `assets/[name][extname]`
}
}
}
},
},
},

Expand Down Expand Up @@ -67,7 +55,6 @@ export default defineConfig({
],

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: '/favicon.ico',
siteTitle: 'MCDOC',
nav: [
Expand Down Expand Up @@ -159,7 +146,6 @@ export default defineConfig({
copyright: 'Copyright © 2024 OpenM Project',
},

// Page - Next & Previous Buttons
docFooter: {
prev: 'Prev',
next: 'Next',
Expand Down Expand Up @@ -195,17 +181,16 @@ export default defineConfig({
timeStyle: 'medium'
}
},

},

markdown: {
lineNumbers: true,

config: (md) => {
md.use(timeline);
md.use(BiDirectionalLinks())
md.use(InlineLinkPreviewElementTransform)
md.use(tabsMarkdownPlugin)
md.use(timeline as any);
md.use(BiDirectionalLinks() as any);
md.use(InlineLinkPreviewElementTransform as any);
md.use(tabsMarkdownPlugin as any);
},

image: {
Expand Down
12 changes: 2 additions & 10 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// https://vitepress.dev/guide/custom-theme
import { h, onMounted, watch, nextTick, toRefs} from 'vue'
import { useData , useRoute } from 'vitepress'
import type { Theme } from 'vitepress'
Expand Down Expand Up @@ -40,7 +39,6 @@ export default {
app.component('xgplayer' , xgplayer)
app.component('vImageViewer', vImageViewer);
app.provide(InjectionKey, {
// Configuration
defaultMode: 'LayoutMode.Original',
diableAnimation: false,
} as Options)
Expand All @@ -50,15 +48,11 @@ export default {
newestOnTop: true,
};
app.use(Toast, options);
app.use(NolebaseGitChangelogPlugin)
app.use(NolebaseInlineLinkPreviewPlugin)
app.use(NolebaseGitChangelogPlugin, {
// Configuration
})
app.use(NolebaseGitChangelogPlugin, {})
app.use(autoAnimatePlugin)
enhanceAppWithTabs(app)
vitepressBackToTop({
// default
threshold:300
})
},
Expand Down Expand Up @@ -97,9 +91,7 @@ export default {
}

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-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
'layout-top': () => [
h(NolebaseHighlightTargetedHeading),
Expand Down
2 changes: 0 additions & 2 deletions docs/devtest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ title: Development test Page
import * as pkg from "vue-toastification"
const { useToast } = pkg

// Get toast interface
const toast = useToast();

const myMethod = () => {
// Since you returned `toast` from setup(), you can access it now
toast("Test!", {
timeout: 2000,
closeOnClick: true,
Expand Down
12 changes: 10 additions & 2 deletions docs/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ export default defineConfig(() => {
},
build: {
chunkSizeWarningLimit: 100000000,
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.css')) {
return `assets/css/[name][extname]`
}
return `assets/[name][extname]`
}
}
},
},
plugins: [
],
}
})

0 comments on commit de9cf5f

Please sign in to comment.