refactor(style): 🎨 Move changelog and suggestion box to footer (#315)
parent
53755e47ba
commit
306aae354c
|
@ -8,6 +8,7 @@ export {}
|
|||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
AppearanceToggle: typeof import('./theme/components/AppearanceToggle.vue')['default']
|
||||
AppFooter: typeof import('./theme/components/AppFooter.vue')['default']
|
||||
AppSBox: typeof import('./theme/components/AppSBox.vue')['default']
|
||||
ArticlesMenu: typeof import('./theme/components/ArticlesMenu.vue')['default']
|
||||
CopyrightInfo: typeof import('./theme/components/CopyrightInfo.vue')['default']
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import { NolebaseGitChangelog } from '@nolebase/vitepress-plugin-git-changelog/client'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="vp-doc">
|
||||
<h2 id="意见反馈">
|
||||
意见反馈
|
||||
</h2>
|
||||
<AppSBox />
|
||||
<h2 id="文件历史">
|
||||
文件历史
|
||||
</h2>
|
||||
<NolebaseGitChangelog />
|
||||
</div>
|
||||
</template>
|
|
@ -1,12 +1,11 @@
|
|||
// https://vitepress.dev/guide/custom-theme
|
||||
import { h } from 'vue'
|
||||
import type { Theme } from 'vitepress'
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import AppearanceToggle from './components/AppearanceToggle.vue'
|
||||
import { h } from 'vue'
|
||||
|
||||
import {
|
||||
NolebaseEnhancedReadabilitiesPlugin,
|
||||
NolebaseEnhancedReadabilitiesMenu,
|
||||
NolebaseEnhancedReadabilitiesPlugin,
|
||||
NolebaseEnhancedReadabilitiesScreenMenu,
|
||||
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
|
||||
|
||||
|
@ -15,25 +14,28 @@ import {
|
|||
} from '@nolebase/vitepress-plugin-highlight-targeted-heading/client'
|
||||
|
||||
import {
|
||||
NolebaseGitChangelogPlugin
|
||||
NolebaseGitChangelogPlugin,
|
||||
} from '@nolebase/vitepress-plugin-git-changelog/client'
|
||||
import AppearanceToggle from './components/AppearanceToggle.vue'
|
||||
|
||||
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
|
||||
import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
|
||||
import '@nolebase/vitepress-plugin-git-changelog/client/style.css'
|
||||
import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
|
||||
|
||||
import 'uno.css'
|
||||
import AppFooter from './components/AppFooter.vue'
|
||||
import './style.css'
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout: () => {
|
||||
return h(AppearanceToggle, null, {
|
||||
'default': () => h(DefaultTheme.Layout, null, {
|
||||
default: () => h(DefaultTheme.Layout, null, {
|
||||
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||
'doc-top': () => [
|
||||
h(NolebaseHighlightTargetedHeading),
|
||||
],
|
||||
'doc-after': () => [h(AppFooter)],
|
||||
'nav-bar-content-after': () => [
|
||||
h(NolebaseEnhancedReadabilitiesMenu),
|
||||
],
|
||||
|
@ -47,15 +49,15 @@ export default {
|
|||
app.use(NolebaseEnhancedReadabilitiesPlugin, {
|
||||
spotlight: {
|
||||
defaultToggle: true,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
app.use(NolebaseGitChangelogPlugin, {
|
||||
locales: {
|
||||
'zh-CN': {
|
||||
lastEditedDateFnsLocaleName: 'zhCN',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
} satisfies Theme
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
import { GitChangelog, GitChangelogMarkdownSection } from '@nolebase/vitepress-plugin-git-changelog/vite'
|
||||
import {
|
||||
MarkdownSectionWrapper,
|
||||
PageHeaderTemplate,
|
||||
TemplateAppSBox,
|
||||
TemplateCopyrightInfo
|
||||
TemplateCopyrightInfo,
|
||||
} from './.vitepress/plugins/MarkdownSectionWrapper'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
import { GitChangelog, GitChangelogMarkdownSection } from '@nolebase/vitepress-plugin-git-changelog/vite'
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
|
@ -20,44 +20,45 @@ export default defineConfig({
|
|||
changeOrigin: true,
|
||||
autoRewrite: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
MarkdownSectionWrapper(
|
||||
[PageHeaderTemplate, TemplateCopyrightInfo],
|
||||
[TemplateAppSBox],
|
||||
{
|
||||
excludes: [],
|
||||
exclude: (_, { helpers }): boolean => {
|
||||
if (helpers.idEquals('index.md'))
|
||||
return true
|
||||
[PageHeaderTemplate, TemplateCopyrightInfo],
|
||||
[],
|
||||
{
|
||||
excludes: [],
|
||||
exclude: (_, { helpers }): boolean => {
|
||||
if (helpers.idEquals('index.md'))
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
}),
|
||||
return false
|
||||
},
|
||||
},
|
||||
),
|
||||
GitChangelog({
|
||||
repoURL: 'https://github.com/project-trans/RLE-wiki',
|
||||
maxGitLogCount: 1000,
|
||||
rewritePaths: {
|
||||
'docs/': '',
|
||||
}
|
||||
},
|
||||
}),
|
||||
GitChangelogMarkdownSection({
|
||||
sections: {
|
||||
disableChangelog: false,
|
||||
disableContributors: true
|
||||
},
|
||||
getChangelogTitle: (): string => {
|
||||
return '文件历史'
|
||||
},
|
||||
excludes: [],
|
||||
exclude: (_, { helpers }): boolean => {
|
||||
if (helpers.idEquals('index.md'))
|
||||
return true
|
||||
// GitChangelogMarkdownSection({
|
||||
// sections: {
|
||||
// disableChangelog: false,
|
||||
// disableContributors: true,
|
||||
// },
|
||||
// getChangelogTitle: (): string => {
|
||||
// return '文件历史'
|
||||
// },
|
||||
// excludes: [],
|
||||
// exclude: (_, { helpers }): boolean => {
|
||||
// if (helpers.idEquals('index.md'))
|
||||
// return true
|
||||
|
||||
return false
|
||||
},
|
||||
}),
|
||||
// return false
|
||||
// },
|
||||
// }),
|
||||
Components({
|
||||
dirs: resolve(__dirname, '.vitepress/theme/components'),
|
||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||
|
|
Loading…
Reference in New Issue