From 340926bcd30980ae91467d9673020c5cb90d0e8e Mon Sep 17 00:00:00 2001 From: Relakkes Date: Thu, 26 Sep 2024 15:38:18 +0800 Subject: [PATCH] chore: add vitepress doc custom theme --- docs/.vitepress/theme/DynamicAds.vue | 85 ++++++++++++++++++++++++++++ docs/.vitepress/theme/MyLayout.vue | 14 +++++ docs/.vitepress/theme/custom.css | 9 +++ docs/.vitepress/theme/index.js | 9 +++ 4 files changed, 117 insertions(+) create mode 100644 docs/.vitepress/theme/DynamicAds.vue create mode 100644 docs/.vitepress/theme/MyLayout.vue create mode 100644 docs/.vitepress/theme/custom.css create mode 100644 docs/.vitepress/theme/index.js diff --git a/docs/.vitepress/theme/DynamicAds.vue b/docs/.vitepress/theme/DynamicAds.vue new file mode 100644 index 0000000..213d20a --- /dev/null +++ b/docs/.vitepress/theme/DynamicAds.vue @@ -0,0 +1,85 @@ + + + + + + + diff --git a/docs/.vitepress/theme/MyLayout.vue b/docs/.vitepress/theme/MyLayout.vue new file mode 100644 index 0000000..517f3b3 --- /dev/null +++ b/docs/.vitepress/theme/MyLayout.vue @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css new file mode 100644 index 0000000..fcc8e90 --- /dev/null +++ b/docs/.vitepress/theme/custom.css @@ -0,0 +1,9 @@ +/* .vitepress/theme/custom.css */ +/** + * Component: Sidebar + * -------------------------------------------------------------------------- */ + +:root { + --vp-sidebar-width: 285px; + --vp-sidebar-bg-color: var(--vp-c-bg-alt); +} \ No newline at end of file diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js new file mode 100644 index 0000000..d3eb3e7 --- /dev/null +++ b/docs/.vitepress/theme/index.js @@ -0,0 +1,9 @@ +// .vitepress/theme/index.js +import DefaultTheme from 'vitepress/theme' +import MyLayout from './MyLayout.vue' + +export default { + extends: DefaultTheme, + // 使用注入插槽的包装组件覆盖 Layout + Layout: MyLayout +} \ No newline at end of file