From ca478f19b138166a6bf5b71e7a7764880bb1f35d Mon Sep 17 00:00:00 2001 From: Neo <558368+wangxiao@users.noreply.github.com> Date: Fri, 15 Sep 2023 21:53:14 +0800 Subject: [PATCH] feat: Support in-document advertising. --- docs/.vitepress/theme/AdComponent.vue | 43 +++++++++++++++++++++++++++ docs/.vitepress/theme/documate.vue | 5 ++++ docs/.vitepress/theme/index.ts | 13 ++++++++ 3 files changed, 61 insertions(+) create mode 100644 docs/.vitepress/theme/AdComponent.vue create mode 100644 docs/.vitepress/theme/documate.vue create mode 100644 docs/.vitepress/theme/index.ts diff --git a/docs/.vitepress/theme/AdComponent.vue b/docs/.vitepress/theme/AdComponent.vue new file mode 100644 index 00000000..b7bd9d5c --- /dev/null +++ b/docs/.vitepress/theme/AdComponent.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/docs/.vitepress/theme/documate.vue b/docs/.vitepress/theme/documate.vue new file mode 100644 index 00000000..d89e2f40 --- /dev/null +++ b/docs/.vitepress/theme/documate.vue @@ -0,0 +1,5 @@ + diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 00000000..002640f1 --- /dev/null +++ b/docs/.vitepress/theme/index.ts @@ -0,0 +1,13 @@ +// .vitepress/theme/index.js +import { h } from 'vue' +import DefaultTheme from 'vitepress/theme' +import AdComponent from './AdComponent.vue' + +export default { + ...DefaultTheme, + Layout() { + return h(DefaultTheme.Layout, null, { + 'doc-before': () => h(AdComponent), + }) + } +}