diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 05561720..6517952b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "vue.volar", - "Vue.vscode-typescript-vue-plugin", "dbaeumer.vscode-eslint" ] } 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/Archives.vue b/theme/src/client/components/Blog/Archives.vue similarity index 93% rename from theme/src/client/components/Archives.vue rename to theme/src/client/components/Blog/Archives.vue index 3e142575..e39cfe6f 100644 --- a/theme/src/client/components/Archives.vue +++ b/theme/src/client/components/Blog/Archives.vue @@ -1,6 +1,6 @@ + + + + + + + + + + {{ theme.encryptButtonText ?? 'Confirm' }} + + + + + diff --git a/theme/src/client/components/EncryptGlobal.vue b/theme/src/client/components/EncryptGlobal.vue index 2b8a26b6..f5342387 100644 --- a/theme/src/client/components/EncryptGlobal.vue +++ b/theme/src/client/components/EncryptGlobal.vue @@ -1,10 +1,10 @@ @@ -40,24 +25,7 @@ function compare() { {{ title }} - - - - - - - - {{ theme.encryptButtonText ?? 'Confirm' }} - - + @@ -131,62 +99,4 @@ function compare() { text-align: center; transition: color var(--t-color); } - -.encrypt { - margin-top: 20px; -} - -.encrypt-text { - margin-top: 40px; - margin-bottom: 30px; - color: var(--vp-c-text-1); - text-align: center; -} - -.encrypt-input-wrapper { - position: relative; -} - -.icon-lock { - position: absolute; - top: 10px; - left: 10px; - color: var(--vp-c-border); -} - -.encrypt-input { - width: 100%; - padding: 8px 12px 8px 32px; - background-color: var(--vp-c-bg); - border: 1px solid var(--vp-c-border); - border-radius: 4px; - outline: none; - transition: border-color var(--t-color), background-color var(--t-color); -} - -.encrypt-input:focus { - border-color: var(--vp-c-brand-1); -} - -.encrypt-input.error { - border-color: var(--vp-c-danger-3); -} - -.encrypt-button { - width: 100%; - padding: 8px 12px; - margin-top: 20px; - font-weight: 500; - color: var(--vp-c-white); - cursor: pointer; - background-color: var(--vp-c-brand-1); - border: none; - border-radius: 4px; - outline: none; - transition: background-color var(--t-color); -} - -.encrypt-button:hover { - background-color: var(--vp-c-brand-2); -} diff --git a/theme/src/client/components/EncryptPage.vue b/theme/src/client/components/EncryptPage.vue index 5464a54d..83b7069b 100644 --- a/theme/src/client/components/EncryptPage.vue +++ b/theme/src/client/components/EncryptPage.vue @@ -1,26 +1,11 @@ @@ -28,24 +13,7 @@ function compare() { - - - - - - - - {{ theme.encryptButtonText ?? 'Confirm' }} - - + @@ -68,64 +36,4 @@ function compare() { transition-property: box-shadow, background-color; } } - -.encrypt { - margin-top: 20px; -} - -.encrypt-text { - margin-top: 20px; - margin-bottom: 30px; - color: var(--vp-c-text-1); - text-align: center; - transition: color var(--t-color); -} - -.encrypt-input-wrapper { - position: relative; -} - -.icon-lock { - position: absolute; - top: 10px; - left: 10px; - color: var(--vp-c-border); - transition: color var(--t-color); -} - -.encrypt-input { - width: 100%; - padding: 8px 12px 8px 32px; - background-color: var(--vp-c-bg-soft); - border: 1px solid var(--vp-c-border); - border-radius: 4px; - outline: none; - transition: border-color var(--t-color), background-color var(--t-color); -} - -.encrypt-input:focus { - border-color: var(--vp-c-brand-1); -} - -.encrypt-input.error { - border-color: var(--vp-c-danger-3); -} - -.encrypt-button { - width: 100%; - padding: 8px 12px; - margin-top: 20px; - font-weight: 500; - color: var(--vp-c-white); - cursor: pointer; - background-color: var(--vp-c-brand-1); - border: none; - border-radius: 4px; - outline: none; - transition: background-color var(--t-color); -} - -.encrypt-button:hover { - background-color: var(--vp-c-brand-2); -} diff --git a/theme/src/client/components/Home/Home.vue b/theme/src/client/components/Home/Home.vue new file mode 100644 index 00000000..2bcf57ae --- /dev/null +++ b/theme/src/client/components/Home/Home.vue @@ -0,0 +1,81 @@ + + + + + + + + + + + + + diff --git a/theme/src/client/components/Home.vue b/theme/src/client/components/Home/HomeBanner.vue similarity index 55% rename from theme/src/client/components/Home.vue rename to theme/src/client/components/Home/HomeBanner.vue index 82896dcb..cd1eb82b 100644 --- a/theme/src/client/components/Home.vue +++ b/theme/src/client/components/Home/HomeBanner.vue @@ -1,48 +1,43 @@ - - + + @@ -54,7 +49,7 @@ const actions = computed(() => { {{ text }} - + { diff --git a/theme/src/client/components/Home/HomeFeature.vue b/theme/src/client/components/Home/HomeFeature.vue new file mode 100644 index 00000000..7b36ffac --- /dev/null +++ b/theme/src/client/components/Home/HomeFeature.vue @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + {{ linkText }} + + + + + + + diff --git a/theme/src/client/components/Home/HomeFeatures.vue b/theme/src/client/components/Home/HomeFeatures.vue new file mode 100644 index 00000000..f2153118 --- /dev/null +++ b/theme/src/client/components/Home/HomeFeatures.vue @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + diff --git a/theme/src/client/components/Home/HomeHero.vue b/theme/src/client/components/Home/HomeHero.vue new file mode 100644 index 00000000..9672b407 --- /dev/null +++ b/theme/src/client/components/Home/HomeHero.vue @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/theme/src/client/components/Home/HomeProfile.vue b/theme/src/client/components/Home/HomeProfile.vue new file mode 100644 index 00000000..c5b755e6 --- /dev/null +++ b/theme/src/client/components/Home/HomeProfile.vue @@ -0,0 +1,91 @@ + + + + + + + + {{ profile.name }} + + + {{ profile.description }} + + + + + + diff --git a/theme/src/client/components/Home/HomeTextImage.vue b/theme/src/client/components/Home/HomeTextImage.vue new file mode 100644 index 00000000..0eb1b3f7 --- /dev/null +++ b/theme/src/client/components/Home/HomeTextImage.vue @@ -0,0 +1,170 @@ + + + + + + + + + + + + {{ title }} + + + + + + + + + + + + + + + + + + diff --git a/theme/src/client/components/DocOutlineItem.vue b/theme/src/client/components/Nav/DocOutlineItem.vue similarity index 100% rename from theme/src/client/components/DocOutlineItem.vue rename to theme/src/client/components/Nav/DocOutlineItem.vue diff --git a/theme/src/client/components/LocalNav.vue b/theme/src/client/components/Nav/LocalNav.vue similarity index 95% rename from theme/src/client/components/LocalNav.vue rename to theme/src/client/components/Nav/LocalNav.vue index ffec25ed..0842f667 100644 --- a/theme/src/client/components/LocalNav.vue +++ b/theme/src/client/components/Nav/LocalNav.vue @@ -4,9 +4,9 @@ import { useWindowScroll } from '@vueuse/core' import { computed, onMounted, ref } from 'vue' import type { PlumeThemePageData, -} from '../../shared/index.js' -import { useSidebar, useThemeLocaleData } from '../composables/index.js' -import IconAlignLeft from './icons/IconAlignLeft.vue' +} from '../../../shared/index.js' +import { useSidebar, useThemeLocaleData } from '../../composables/index.js' +import IconAlignLeft from '../icons/IconAlignLeft.vue' import LocalNavOutlineDropdown from './LocalNavOutlineDropdown.vue' const props = defineProps<{ diff --git a/theme/src/client/components/LocalNavOutlineDropdown.vue b/theme/src/client/components/Nav/LocalNavOutlineDropdown.vue similarity index 96% rename from theme/src/client/components/LocalNavOutlineDropdown.vue rename to theme/src/client/components/Nav/LocalNavOutlineDropdown.vue index 59206313..2f7d5084 100644 --- a/theme/src/client/components/LocalNavOutlineDropdown.vue +++ b/theme/src/client/components/Nav/LocalNavOutlineDropdown.vue @@ -2,9 +2,9 @@ import type { PageHeader } from 'vuepress/client' import { onClickOutside } from '@vueuse/core' import { nextTick, ref, watch } from 'vue' -import { useThemeLocaleData } from '../composables/index.js' +import { useThemeLocaleData } from '../../composables/index.js' +import IconChevronRight from '../icons/IconChevronRight.vue' import DocOutlineItem from './DocOutlineItem.vue' -import IconChevronRight from './icons/IconChevronRight.vue' const props = defineProps<{ headers: PageHeader[] diff --git a/theme/src/client/components/VFooter.vue b/theme/src/client/components/VFooter.vue index c66c2550..d6ad206b 100644 --- a/theme/src/client/components/VFooter.vue +++ b/theme/src/client/components/VFooter.vue @@ -43,7 +43,6 @@ onMounted(() => { position: relative; z-index: var(--vp-z-index-footer); padding: 24px; - background-color: var(--vp-c-bg); border-top: 1px solid var(--vp-c-gutter); transition: all var(--t-color); } @@ -71,6 +70,10 @@ onMounted(() => { .plume-footer { padding: 24px; } + + .plume-footer.has-sidebar { + margin-right: calc(0px - ((100vw - var(--vp-layout-max-width)) / 2)); + } } .container { diff --git a/theme/src/client/layouts/Layout.vue b/theme/src/client/layouts/Layout.vue index deb2d5c0..30184c3e 100644 --- a/theme/src/client/layouts/Layout.vue +++ b/theme/src/client/layouts/Layout.vue @@ -3,11 +3,11 @@ import { usePageData, useRoute } from 'vuepress/client' import { computed, provide, watch } from 'vue' import type { PlumeThemePageData } from '../../shared/index.js' import Backdrop from '../components/Backdrop.vue' -import Blog from '../components/Blog.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/LocalNav.vue' +import LocalNav from '../components/Nav/LocalNav.vue' import Nav from '../components/Nav/index.vue' import Page from '../components/Page.vue' import Sidebar from '../components/Sidebar.vue' diff --git a/theme/src/client/styles/content.scss b/theme/src/client/styles/content.scss index 3d573b46..0004727c 100644 --- a/theme/src/client/styles/content.scss +++ b/theme/src/client/styles/content.scss @@ -30,7 +30,7 @@ line-height: 32px; letter-spacing: -0.02em; border-top: 1px solid var(--vp-c-divider); - transition: border-top var(--t-color); + transition: border-top var(--t-color), color var(--t-color); } .plume-content h2:first-of-type { diff --git a/theme/src/client/styles/vars.scss b/theme/src/client/styles/vars.scss index e7077e1d..d4ebf5a8 100644 --- a/theme/src/client/styles/vars.scss +++ b/theme/src/client/styles/vars.scss @@ -316,6 +316,7 @@ :root { --vp-layout-max-width: 1440px; + --content-width: var(--vp-layout-max-width); } /** diff --git a/theme/src/node/defaultOptions.ts b/theme/src/node/defaultOptions.ts index 38f1940f..33f3f5a9 100644 --- a/theme/src/node/defaultOptions.ts +++ b/theme/src/node/defaultOptions.ts @@ -49,7 +49,7 @@ const defaultLocales: NonNullable = { export const fallbackLocaleOption: Partial = { article: '/article/', - notes: { link: '/note', dir: 'notes', notes: [] }, + notes: { link: '/', dir: 'notes', notes: [] }, appearance: true, // page meta editLink: true, 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
+ + +
- - -
{{ text }}
+ {{ linkText }} +
+ {{ profile.description }} +