From 662c7daaf3a614d2fc74fe06cda13593cfa103c0 Mon Sep 17 00:00:00 2001 From: Ashley Marques Date: Fri, 1 Dec 2023 01:40:41 -0300 Subject: [PATCH] add vue 2 nes banner (#2581) --- .../inlined-scripts/restorePreference.js | 4 +- .vitepress/theme/components/Banner.vue | 355 +++++++++++++++++- .vitepress/theme/index.ts | 4 +- 3 files changed, 340 insertions(+), 23 deletions(-) diff --git a/.vitepress/inlined-scripts/restorePreference.js b/.vitepress/inlined-scripts/restorePreference.js index 5e18b50ffa..265db2737a 100644 --- a/.vitepress/inlined-scripts/restorePreference.js +++ b/.vitepress/inlined-scripts/restorePreference.js @@ -8,6 +8,6 @@ restore('vue-docs-prefer-composition', 'prefer-composition', true) restore('vue-docs-prefer-sfc', 'prefer-sfc', true) - // window.__VUE_BANNER_ID__ = '' - // restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed') + window.__VUE_BANNER_ID__ = 'herodevs-vue2-nes' + restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed') })() diff --git a/.vitepress/theme/components/Banner.vue b/.vitepress/theme/components/Banner.vue index 6730fcd48d..e60de21c8d 100644 --- a/.vitepress/theme/components/Banner.vue +++ b/.vitepress/theme/components/Banner.vue @@ -22,24 +22,168 @@ function dismiss() { diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 7084831abc..11dd675691 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -9,14 +9,14 @@ import { } from './components/preferences' import SponsorsAside from './components/SponsorsAside.vue' import VueSchoolLink from './components/VueSchoolLink.vue' -// import Banner from './components/Banner.vue' +import Banner from './components/Banner.vue' // import TextAd from './components/TextAd.vue' export default Object.assign({}, VPTheme, { Layout: () => { // @ts-ignore return h(VPTheme.Layout, null, { - // banner: () => h(Banner), + banner: () => h(Banner), 'sidebar-top': () => h(PreferenceSwitch), 'aside-mid': () => h(SponsorsAside) })