diff --git a/docs/README.md b/docs/README.md index 7cfed14e..efc51407 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,11 +1,76 @@ --- home: true -banner: https://file.mo7.cc/api/public/bz -bannerMask: - light: 0.1 - dark: 0.3 -hero: - name: 鹏展博 - tagline: 前端开发工程师 - text: 简单介绍专业技能信息相关的描述 +config: + - + type: hero + full: true + background: filter + hero: + name: Theme Plume + tagline: Vuepress Next Theme + text: 一个简约的,功能丰富的 vuepress 文档&博客 主题 + actions: + - + theme: brand + text: 快速开始 → + link: / + - + theme: alt + text: Github + link: / + - + type: features + title: 标题 + description: 随便描述 + features: + - + title: 特性1 + icon: 🖨 + details: 特性说明 + - + title: 特性1 + icon: 🖨 + details: 特性说明 + - + title: 特性1 + icon: 🖨 + details: 特性说明 + - + title: 特性1 + icon: 🖨 + details: 特性说明 + - + title: 特性1 + icon: 🖨 + details: 特性说明 + - + type: custom + - + type: text-image + title: 标题 + description: 随便描述 + list: + - + title: 描述 + description: 随便描述一下 + - 随便描述一下 + - 随便描述一下 + image: /images/blogger.png + - + type: image-text + title: 标题 + description: 随便描述 + list: + - + title: 描述 + description: 随便描述一下 + - 随便描述一下 + - 随便描述一下 + image: /images/blogger.png + - + type: profile + name: 鹏展博 + description: 前端开发工程师, 热爱前端, 热爱生活, 热爱互联网, 热爱技术, 热爱开源, 热爱生命。 --- + +这里是自定义的内容,你可以随意添加你自己的内容 diff --git a/theme/src/client/components/Home.vue b/theme/src/client/components/Home.vue deleted file mode 100644 index 82896dcb..00000000 --- a/theme/src/client/components/Home.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/theme/src/client/components/Home/Home.vue b/theme/src/client/components/Home/Home.vue new file mode 100644 index 00000000..df255f06 --- /dev/null +++ b/theme/src/client/components/Home/Home.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/theme/src/client/layouts/Layout.vue b/theme/src/client/layouts/Layout.vue index f126eb2a..30184c3e 100644 --- a/theme/src/client/layouts/Layout.vue +++ b/theme/src/client/layouts/Layout.vue @@ -5,7 +5,7 @@ import type { PlumeThemePageData } from '../../shared/index.js' import Backdrop from '../components/Backdrop.vue' import Blog from '../components/Blog/Blog.vue' import Friends from '../components/Friends.vue' -import Home from '../components/Home.vue' +import Home from '../components/Home/Home.vue' import LayoutContent from '../components/LayoutContent.vue' import LocalNav from '../components/Nav/LocalNav.vue' import Nav from '../components/Nav/index.vue' diff --git a/theme/src/shared/frontmatter.ts b/theme/src/shared/frontmatter.ts index 7aacf2e0..274e57c5 100644 --- a/theme/src/shared/frontmatter.ts +++ b/theme/src/shared/frontmatter.ts @@ -1,15 +1,18 @@ -import type { NavItemWithLink } from '.' +import type { NavItemWithLink, PlumeThemeImage } from '.' -export interface PlumeThemeHomeFrontmatter { +/* =============================== Home begin ==================================== */ +export interface PlumeThemeHomeFrontmatter extends Omit { home?: true - banner?: string - bannerMask?: number | { light?: number, dark?: number } - hero: { - name: string - tagline?: string - text?: string - actions: PlumeThemeHeroAction[] - } + config?: PlumeThemeHomeConfig[] +} + +export type PlumeThemeHomeConfig = PlumeThemeHomeBanner | PlumeThemeHomeTextImage | PlumeThemeHomeFeatures | PlumeThemeHomeProfile + +export interface PlumeThemeHero { + name: string + tagline?: string + text?: string + actions: PlumeThemeHeroAction[] } export interface PlumeThemeHeroAction { @@ -18,6 +21,83 @@ export interface PlumeThemeHeroAction { link?: string } +export interface PlumeHomeConfigBase { + type: 'banner' | 'hero' | 'text-image' | 'image-text' | 'features' | 'profile' | 'custom' +} + +export interface PlumeThemeHomeBanner extends PlumeHomeConfigBase { + type: 'banner' + banner?: string + bannerMask?: number | { light?: number, dark?: number } + hero: PlumeThemeHero +} + +export interface PlumeThemeHomeHero extends PlumeHomeConfigBase { + type: 'hero' + hero: PlumeThemeHero + full?: boolean + background?: 'filter' | (string & { zz_IGNORE?: never }) +} + +export interface PlumeThemeHomeTextImage extends PlumeHomeConfigBase { + type: 'text-image' | 'image-text' + image: PlumeThemeImage + width?: number | string + title?: string + description?: string + list: (string | { title?: string, description?: string })[] + backgroundImage?: string | { light: string, dark: string } + backgroundAttachment?: 'fixed' | 'local' +} + +export interface PlumeThemeHomeFeatures extends PlumeHomeConfigBase { + type: 'features' + title?: string + description?: string + features: PlumeThemeHomeFeature[] +} + +export interface PlumeThemeHomeFeature { + icon?: FeatureIcon + title: string + details?: string + link?: string + linkText?: string + rel?: string + target?: string +} + +export type FeatureIcon = string | { + src: string + alt?: string | undefined + width?: string | undefined + height?: string | undefined + wrap?: boolean | undefined +} | { + light: string + dark: string + alt?: string | undefined + width?: string | undefined + height?: string | undefined + wrap?: boolean | undefined +} + +export interface PlumeThemeHomeProfile extends PlumeHomeConfigBase { + type: 'profile' + name?: string + description?: string + avatar?: PlumeThemeImage + circle?: boolean +} + +export interface PlumeThemeHomeCustom extends PlumeHomeConfigBase { + type: 'custom' + backgroundImage?: string | { light: string, dark: string } + backgroundAttachment?: 'fixed' | 'local' +} + +/* =============================== Home end ==================================== */ + export interface PlumeThemePageFrontmatter { comments?: boolean editLink?: boolean