diff --git a/docs/README.md b/docs/README.md index efc51407..3efdb55f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ config: - type: hero full: true - background: filter + background: filter-blur hero: name: Theme Plume tagline: Vuepress Next Theme diff --git a/theme/src/client/components/Home/Home.vue b/theme/src/client/components/Home/Home.vue index 2bcf57ae..82d81ccd 100644 --- a/theme/src/client/components/Home/Home.vue +++ b/theme/src/client/components/Home/Home.vue @@ -19,6 +19,12 @@ const components: Record> = { 'custom': HomeCustom, } +const DEFAULT_HERO = { + name: 'Theme Plume', + tagline: 'VuePress Next Theme', + text: '一个简约的,功能丰富的 vuepress 文档&博客 主题', +} + const matter = usePageFrontmatter() const config = computed(() => { @@ -26,15 +32,22 @@ const config = computed(() => { if (config && config.length) return config + // @deprecated + // 适配旧版本配置,将在正式版本中删去 + if (matter.value.banner) { + return [{ + type: 'banner', + banner: matter.value.banner, + bannerMask: matter.value.bannerMask, + hero: matter.value.hero ?? DEFAULT_HERO, + }] + } + return [{ type: 'hero', full: true, background: 'filter', - hero: matter.value.hero ?? { - name: 'Theme Plume', - tagline: 'VuePress Next Theme', - text: '一个简约的,功能丰富的 vuepress 文档&博客 主题', - }, + hero: matter.value.hero ?? DEFAULT_HERO, }] }) diff --git a/theme/src/client/components/Home/HomeBanner.vue b/theme/src/client/components/Home/HomeBanner.vue index cd1eb82b..292d3de7 100644 --- a/theme/src/client/components/Home/HomeBanner.vue +++ b/theme/src/client/components/Home/HomeBanner.vue @@ -6,7 +6,7 @@ import type { PlumeThemeHomeBanner, PlumeThemeHomeFrontmatter } from '../../../s import { useDarkMode } from '../../composables/darkMode.js' import VButton from '../VButton.vue' -const props = defineProps() +const props = defineProps() const DEFAULT_BANNER = 'http://file.mo7.cc/api/public/bz' @@ -49,6 +49,7 @@ const actions = computed(() => props.hero?.actions ?? matter.value.hero?.actions

{{ text }}

+
props.hero?.actions ?? matter.value.hero?.actions font-size: 16px; font-weight: 500; color: var(--vp-c-text-hero-text); - - /* padding: 6px 20px; */ border-radius: 5px; - - /* background-color: rgba(0, 0, 0, 0.25); */ } @media (min-width: 960px) { diff --git a/theme/src/client/components/Home/HomeCustom.vue b/theme/src/client/components/Home/HomeCustom.vue index f7d7176a..a5858748 100644 --- a/theme/src/client/components/Home/HomeCustom.vue +++ b/theme/src/client/components/Home/HomeCustom.vue @@ -1,59 +1,13 @@ - - diff --git a/theme/src/client/components/Home/HomeFeatures.vue b/theme/src/client/components/Home/HomeFeatures.vue index f2153118..4e61f139 100644 --- a/theme/src/client/components/Home/HomeFeatures.vue +++ b/theme/src/client/components/Home/HomeFeatures.vue @@ -2,10 +2,9 @@ import { computed } from 'vue' import type { PlumeThemeHomeFeatures } from '../../../shared/index.js' import HomeFeature from './HomeFeature.vue' +import HomeBox from './HomeBox.vue' -const props = defineProps<{ - onlyOnce?: boolean -} & PlumeThemeHomeFeatures>() +const props = defineProps() const grid = computed(() => { const length = props.features?.length @@ -30,56 +29,40 @@ const grid = computed(() => {