diff --git a/.vitepress/config.js b/.vitepress/config.js index 92992ae..9fccc76 100644 --- a/.vitepress/config.js +++ b/.vitepress/config.js @@ -1,21 +1,36 @@ +import { fileURLToPath, URL } from 'node:url' + export default { - title: '学思刻', - description: '一个优质学习资源导航平台。', - lastUpdated: true, - titleTemplate: false, - srcDir: './src', - outDir: './dist', - themeConfig: { - outline: { - label: '页面导航' - }, - lastUpdatedText: '最后更新于', - editLink: { - pattern: 'https://github.com/awxiaoxian2020/thidy/edit/master/src/:path', - text: '在 GitHub 编辑此页面' - }, - footer: { - message: '皖ICP备2021004162号-2' + title: "学思刻", + description: "一个优质学习资源导航平台。", + lastUpdated: true, + titleTemplate: false, + srcDir: "./src", + outDir: "./dist", + themeConfig: { + outline: { + label: "页面导航", + }, + lastUpdatedText: "最后更新于", + editLink: { + pattern: "https://github.com/awxiaoxian2020/thidy/edit/master/src/:path", + text: "在 GitHub 编此页面", + }, + footer: { + icpRecordCode: "皖ICP备2021004162号-2", + publicSecurityRecordCode: "皖公网安备 34011102003461 号" + }, + }, + vite: { + resolve: { + alias: [ + { + find: /^.*\/VPFooter\.vue$/, + replacement: fileURLToPath( + new URL('./theme/CustomFooter.vue', import.meta.url) + ) } - } -} + ] + } + } +}; diff --git a/.vitepress/theme/CustomFooter.vue b/.vitepress/theme/CustomFooter.vue new file mode 100644 index 0000000..b014c49 --- /dev/null +++ b/.vitepress/theme/CustomFooter.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/.vitepress/theme/MyLayout.vue b/.vitepress/theme/MyLayout.vue new file mode 100644 index 0000000..44f0156 --- /dev/null +++ b/.vitepress/theme/MyLayout.vue @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.vitepress/theme/index.js b/.vitepress/theme/index.js new file mode 100644 index 0000000..2e76c2e --- /dev/null +++ b/.vitepress/theme/index.js @@ -0,0 +1,11 @@ +// .vitepress/theme/index.js +// .vitepress/theme/index.js +import DefaultTheme from 'vitepress/theme' +import MyLayout from './MyLayout.vue' + +export default { + ...DefaultTheme, + // override the Layout with a wrapper component that + // injects the slots + Layout: MyLayout +} \ No newline at end of file