diff --git a/.github/workflows/lock-threads.yml b/.github/workflows/lock-threads.yml index 73ffade6..5dfb3fcc 100644 --- a/.github/workflows/lock-threads.yml +++ b/.github/workflows/lock-threads.yml @@ -17,7 +17,7 @@ jobs: if: github.repository == 'vuejs/vitepress' runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v4 + - uses: dessant/lock-threads@v5 with: issue-inactive-days: 7 pr-inactive-days: 7 diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 1aa123ab..84a03487 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create Release for Tag id: release_tag diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index ac4dc17e..3c646aa3 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -6,7 +6,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: days-before-stale: 30 days-before-close: -1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e36c5ee2..915171b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,13 +27,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v2 - name: Set node version to ${{ matrix.node_version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} cache: pnpm diff --git a/CHANGELOG.md b/CHANGELOG.md index a89b2515..271ca1eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,69 @@ +# [1.0.0-rc.44](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.43...v1.0.0-rc.44) (2024-2-19) + +### Reverts + +- types for internal components ([e703429](https://github.com/vuejs/vitepress/commit/e7034294731493a198cdd4789198f1c94f21b181)) + +# [1.0.0-rc.43](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.42...v1.0.0-rc.43) (2024-2-17) + +### Bug Fixes + +- handle process.env being undefined while process is not ([b63e0a0](https://github.com/vuejs/vitepress/commit/b63e0a0c57f886f49aa7e073ff623c918164bd0b)), closes [#3579](https://github.com/vuejs/vitepress/issues/3579) +- make local search work in combination with vue-i18n ([#3559](https://github.com/vuejs/vitepress/issues/3559)) ([6624bb7](https://github.com/vuejs/vitepress/commit/6624bb748610079b88e2dcef7ea1810833a54a85)) +- **theme:** adjust mathjax svg styles ([#3567](https://github.com/vuejs/vitepress/issues/3567)) ([2051100](https://github.com/vuejs/vitepress/commit/20511006dba516ca8c06ed1dd3516547af668a0e)) + +### Features + +- **theme:** auto style markdown content in home page ([#3561](https://github.com/vuejs/vitepress/issues/3561)) ([0903027](https://github.com/vuejs/vitepress/commit/09030272b4a5c8f723b7e11303265f24b7481575)) + +### Performance Improvements + +- **theme:** move svg icons to css ([#3537](https://github.com/vuejs/vitepress/issues/3537)) ([636cca0](https://github.com/vuejs/vitepress/commit/636cca042dfbca006af2d702ddec0a2ff601cb46)) + +### BREAKING CHANGES + +- The default theme now styles the markdown content in the home page. If you have custom styles that rely on the markdown content not being styled, you may need to adjust your styles, or add `markdownStyles: false` to the frontmatter of your home page. + +# [1.0.0-rc.42](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.41...v1.0.0-rc.42) (2024-2-6) + +### Bug Fixes + +- **md:** dont break on nesting blockquotes inside gfm alerts ([8f8a6fe](https://github.com/vuejs/vitepress/commit/8f8a6feb053b3f521a2c90e343dffa7f98bb63b3)), closes [#3512](https://github.com/vuejs/vitepress/issues/3512) +- **theme:** correctly normalize paths ending with "index" ([#3544](https://github.com/vuejs/vitepress/issues/3544)) ([c582a8d](https://github.com/vuejs/vitepress/commit/c582a8d5fd82b84d412c7e6c84e74faeb23beac6)) + +# [1.0.0-rc.41](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.40...v1.0.0-rc.41) (2024-2-1) + +### Bug Fixes + +- handle CRLF in snippet plugin ([5811b62](https://github.com/vuejs/vitepress/commit/5811b626576ec4569fa0079d921b8e328d87ca91)), closes [#3499](https://github.com/vuejs/vitepress/issues/3499) +- lazy evaluate known extensions to allow env set in config ([04f794b](https://github.com/vuejs/vitepress/commit/04f794bf55f8191ea9eed62f545b812f346017d8)) + +### Features + +- **home:** add target and rel attribute to home actions ([#3528](https://github.com/vuejs/vitepress/issues/3528)) ([ab39fd8](https://github.com/vuejs/vitepress/commit/ab39fd8592c994fbc6feba5ee369ca1205c50f04)) +- rename shiki packages ([#3506](https://github.com/vuejs/vitepress/issues/3506)) ([b8487d3](https://github.com/vuejs/vitepress/commit/b8487d3a97679f5b2eb225ee1eb85754b66fee30)) +- wrap site title in span ([#3522](https://github.com/vuejs/vitepress/issues/3522)) ([6b1f951](https://github.com/vuejs/vitepress/commit/6b1f951928a3b9e53dcc9697327b5aba4a5905e2)) +- **theme:** add hero slots that are inside container ([#3524](https://github.com/vuejs/vitepres/issues/3524)) ([28870e6](https://github.com/vuejs/vitepress/commit/28870e68faf0ddaa418ffe0d4371316f6b0bcd02)) + +### BREAKING CHANGES + +- vitepress now uses shiki instead of shikiji. If you’re on the latest version and using shikiji specific features, you just need to change imports. The shikijiSetup hook is renamed to shikiSetup. + +# [1.0.0-rc.40](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.39...v1.0.0-rc.40) (2024-1-22) + +### Bug Fixes + +- **client:** handle head orphans added in initial load ([#3474](https://github.com/vuejs/vitepress/issues/3474)) ([5e2d853](https://github.com/vuejs/vitepress/commit/5e2d853e1a315216dce5fc98ee2efd15c724a25d)) +- **theme:** avoid selecting summary on toggling details ([77a318c](https://github.com/vuejs/vitepress/commit/77a318c2a348d341dd3ea1e1650fcf8ad3abfcd7)) +- **theme:** hover color for code links inside custom containers ([#3467](https://github.com/vuejs/vitepress/issues/3467)) ([d529ed4](https://github.com/vuejs/vitepress/commit/d529ed49756841f055024c559d09875501bc6d76)) +- **type:** fix missed `VPBadge` type in `theme.d.ts` ([#3470](https://github.com/vuejs/vitepress/issues/3470)) ([fcf828c](https://github.com/vuejs/vitepress/commit/fcf828c2a71892dad5af8d21e405f4d1e2cc280c)) + +### Features + +- support GitHub-flavored alerts ([#3482](https://github.com/vuejs/vitepress/issues/3482)) ([ac87d19](https://github.com/vuejs/vitepress/commit/ac87d19ca1bbc966e5fe1cca5f433f5ea4b11be3)) +- support specifying custom extensions to escape routing ([#3466](https://github.com/vuejs/vitepress/issues/3466)) ([c22f5d9](https://github.com/vuejs/vitepress/commit/c22f5d983f3e5d5c4f0ed0683a93ece564487c13)) +- **theme:** add npm icon ([#3483](https://github.com/vuejs/vitepress/issues/3483)) ([c882fa1](https://github.com/vuejs/vitepress/commit/c882fa1469a7bd0d6e28196e7a841adf48e803f1)) + # [1.0.0-rc.39](https://github.com/vuejs/vitepress/compare/v1.0.0-rc.38...v1.0.0-rc.39) (2024-01-16) ### Bug Fixes diff --git a/docs/.vitepress/config/shared.ts b/docs/.vitepress/config/shared.ts index a99b7702..b6c610de 100644 --- a/docs/.vitepress/config/shared.ts +++ b/docs/.vitepress/config/shared.ts @@ -6,6 +6,7 @@ export const shared = defineConfig({ lastUpdated: true, cleanUrls: true, + metaChunk: true, markdown: { math: true, @@ -31,10 +32,12 @@ export const shared = defineConfig({ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/vitepress-logo-mini.svg' }], ['link', { rel: 'icon', type: 'image/png', href: '/vitepress-logo-mini.png' }], ['meta', { name: 'theme-color', content: '#5f67ee' }], - ['meta', { name: 'og:type', content: 'website' }], - ['meta', { name: 'og:locale', content: 'en' }], - ['meta', { name: 'og:site_name', content: 'VitePress' }], - ['meta', { name: 'og:image', content: 'https://vitepress.dev/vitepress-og.jpg' }], + ['meta', { property: 'og:type', content: 'website' }], + ['meta', { property: 'og:locale', content: 'en' }], + ['meta', { property: 'og:title', content: 'VitePress | Vite & Vue Powered Static Site Generator' }], + ['meta', { property: 'og:site_name', content: 'VitePress' }], + ['meta', { property: 'og:image', content: 'https://vitepress.dev/vitepress-og.jpg' }], + ['meta', { property: 'og:url', content: 'https://vitepress.dev/' }], ['script', { src: 'https://cdn.usefathom.com/script.js', 'data-site': 'AZBRSFGG', 'data-spa': 'auto', defer: '' }] ], diff --git a/docs/guide/asset-handling.md b/docs/guide/asset-handling.md index 7d2ce57a..eeedc8c0 100644 --- a/docs/guide/asset-handling.md +++ b/docs/guide/asset-handling.md @@ -12,6 +12,10 @@ You can reference static assets in your markdown files, your `*.vue` components Common image, media, and font filetypes are detected and included as assets automatically. +::: tip Linked files are not treated as assets +PDFs or other documents referenced by links within markdown files are not automatically treated as assets. To make linked files accessible, you must manually place them within the [`public`](#the-public-directory) directory of your project. +::: + All referenced assets, including those using absolute paths, will be copied to the output directory with a hashed file name in the production build. Never-referenced assets will not be copied. Image assets smaller than 4kb will be base64 inlined - this can be configured via the [`vite`](../reference/site-config#vite) config option. All **static** path references, including absolute paths, should be based on your working directory structure. diff --git a/docs/guide/custom-theme.md b/docs/guide/custom-theme.md index 83625a23..1d168ce9 100644 --- a/docs/guide/custom-theme.md +++ b/docs/guide/custom-theme.md @@ -196,7 +196,7 @@ export default { If the theme requires special VitePress config, you will need to also extend it in your own config: ```ts -// .vitepress/theme/config.ts +// .vitepress/config.ts import baseConfig from 'awesome-vitepress-theme/config' export default { @@ -208,7 +208,7 @@ export default { Finally, if the theme provides types for its theme config: ```ts -// .vitepress/theme/config.ts +// .vitepress/config.ts import baseConfig from 'awesome-vitepress-theme/config' import { defineConfigWithTheme } from 'vitepress' import type { ThemeConfig } from 'awesome-vitepress-theme' diff --git a/docs/guide/deploy.md b/docs/guide/deploy.md index f7c60322..83835eed 100644 --- a/docs/guide/deploy.md +++ b/docs/guide/deploy.md @@ -153,26 +153,24 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # Not needed if lastUpdated is not enabled # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: npm # or pnpm / yarn - name: Setup Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v4 - name: Install dependencies run: npm ci # or pnpm install / yarn install / bun install - name: Build with VitePress - run: | - npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build - touch docs/.vitepress/dist/.nojekyll + run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: docs/.vitepress/dist @@ -187,7 +185,7 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 ``` ::: warning diff --git a/docs/guide/extending-default-theme.md b/docs/guide/extending-default-theme.md index b7b29bde..71f369f9 100644 --- a/docs/guide/extending-default-theme.md +++ b/docs/guide/extending-default-theme.md @@ -195,7 +195,10 @@ Full list of slots available in the default theme layout: - `aside-ads-after` - When `layout: 'home'` is enabled via frontmatter: - `home-hero-before` + - `home-hero-info-before` - `home-hero-info` + - `home-hero-info-after` + - `home-hero-actions-after` - `home-hero-image` - `home-hero-after` - `home-features-before` diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 7dccbe7e..d5b68de6 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -263,9 +263,45 @@ Wraps in a
}) ``` +## GitHub-flavored Alerts + +VitePress also supports [GitHub-flavored alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) to render as callouts. They will be rendered the same as the [custom containers](#custom-containers). + +```md +> [!NOTE] +> Highlights information that users should take into account, even when skimming. + +> [!TIP] +> Optional information to help a user be more successful. + +> [!IMPORTANT] +> Crucial information necessary for users to succeed. + +> [!WARNING] +> Critical content demanding immediate user attention due to potential risks. + +> [!CAUTION] +> Negative potential consequences of an action. +``` + +> [!NOTE] +> Highlights information that users should take into account, even when skimming. + +> [!TIP] +> Optional information to help a user be more successful. + +> [!IMPORTANT] +> Crucial information necessary for users to succeed. + +> [!WARNING] +> Critical content demanding immediate user attention due to potential risks. + +> [!CAUTION] +> Negative potential consequences of an action. + ## Syntax Highlighting in Code Blocks -VitePress uses [Shikiji](https://github.com/antfu/shikiji) (an improved version of [Shiki](https://shiki.matsu.io/)) to highlight language syntax in Markdown code blocks, using coloured text. Shiki supports a wide variety of programming languages. All you need to do is append a valid language alias to the beginning backticks for the code block: +VitePress uses [Shiki](https://github.com/shikijs/shiki) to highlight language syntax in Markdown code blocks, using coloured text. Shiki supports a wide variety of programming languages. All you need to do is append a valid language alias to the beginning backticks for the code block: **Input** @@ -305,7 +341,7 @@ export default { ``` -A [list of valid languages](https://github.com/antfu/shikiji/blob/main/docs/languages.md) is available on Shikiji's repository. +A [list of valid languages](https://shiki.style/languages) is available on Shiki's repository. You may also customize syntax highlight theme in app config. Please see [`markdown` options](../reference/site-config#markdown) for more details. diff --git a/docs/lunaria.config.json b/docs/lunaria.config.json index 0a4c5077..93eb6010 100644 --- a/docs/lunaria.config.json +++ b/docs/lunaria.config.json @@ -26,5 +26,6 @@ "lang": "zh" } ], - "outDir": ".vitepress/dist/_translations" + "outDir": ".vitepress/dist/_translations", + "ignoreKeywords": ["lunaria-ignore"] } diff --git a/docs/package.json b/docs/package.json index 119d8def..162e4e72 100644 --- a/docs/package.json +++ b/docs/package.json @@ -10,7 +10,7 @@ "lunaria:open": "open-cli .vitepress/dist/_translations/index.html" }, "devDependencies": { - "@lunariajs/core": "npm:@brc-dd/lunaria-core@latest", + "@lunariajs/core": "^0.0.28", "markdown-it-mathjax3": "^4.3.2", "open-cli": "^8.0.0", "vitepress": "workspace:*" diff --git a/docs/reference/default-theme-config.md b/docs/reference/default-theme-config.md index fb6d30b5..f41fb7ad 100644 --- a/docs/reference/default-theme-config.md +++ b/docs/reference/default-theme-config.md @@ -244,8 +244,10 @@ type SocialLinkIcon = | 'instagram' | 'linkedin' | 'mastodon' + | 'npm' | 'slack' | 'twitter' + | 'x' | 'youtube' | { svg: string } ``` diff --git a/docs/reference/default-theme-home-page.md b/docs/reference/default-theme-home-page.md index 765c585e..f7baecca 100644 --- a/docs/reference/default-theme-home-page.md +++ b/docs/reference/default-theme-home-page.md @@ -69,6 +69,12 @@ interface HeroAction { // Destination link of the button. link: string + + // Link target attribute. + target?: string + + // Link rel attribute. + rel?: string } ``` @@ -144,6 +150,9 @@ interface Feature { // // e.g. `external` rel?: string + + // Link target attribute for the `link` option. + target?: string } type FeatureIcon = @@ -157,3 +166,30 @@ type FeatureIcon = height: string } ``` + +## Markdown Content + +You can add additional content to your site's homepage just by adding Markdown below the `---` frontmatter divider. + +````md +--- +layout: home + +hero: + name: VitePress + text: Vite & Vue powered static site generator. +--- + +## Getting Started + +You can get started using VitePress right away using `npx`! + +```sh +npm init +npx vitepress init +``` +```` + +::: info +VitePress didn't always auto-style the extra content of the `layout: home` page. To revert to older behavior, you can add `markdownStyles: false` to the frontmatter. +::: diff --git a/docs/reference/site-config.md b/docs/reference/site-config.md index 1cf9d726..ec853063 100644 --- a/docs/reference/site-config.md +++ b/docs/reference/site-config.md @@ -31,10 +31,10 @@ If you need to dynamically generate the config, you can also default export a fu ```ts import { defineConfig } from 'vitepress' -export default async () => defineConfig({ +export default async () => { const posts = await (await fetch('https://my-cms.com/blog-posts')).json() - return { + return defineConfig({ // app level config options lang: 'en-US', title: 'VitePress', @@ -49,8 +49,8 @@ export default async () => defineConfig({ })) ] } - } -}) + }) +} ``` You can also use top-level `await`. For example: @@ -510,7 +510,7 @@ When using the default theme, enabling this option will display each page's last - Type: `MarkdownOption` -Configure Markdown parser options. VitePress uses [Markdown-it](https://github.com/markdown-it/markdown-it) as the parser, and [Shikiji](https://github.com/antfu/shikiji) (an improved version of [Shiki](https://shiki.matsu.io/)) to highlight language syntax. Inside this option, you may pass various Markdown related options to fit your needs. +Configure Markdown parser options. VitePress uses [Markdown-it](https://github.com/markdown-it/markdown-it) as the parser, and [Shiki](https://github.com/shikijs/shiki) to highlight language syntax. Inside this option, you may pass various Markdown related options to fit your needs. ```js export default { @@ -645,6 +645,24 @@ export default { } ``` +#### Example: Adding a canonical URL `` + +```ts +export default { + transformPageData(pageData) { + const canonicalUrl = `https://example.com/${pageData.relativePath}` + .replace(/index\.md$/, '') + .replace(/\.md$/, '.html') + + pageData.frontmatter.head ??= [] + pageData.frontmatter.head.push([ + 'link', + { rel: 'canonical', href: canonicalUrl } + ]) + } +} +``` + ### transformHtml - Type: `(code: string, id: string, context: TransformContext) => Awaitable` diff --git a/docs/zh/guide/asset-handling.md b/docs/zh/guide/asset-handling.md index fa6478ca..69259a6a 100644 --- a/docs/zh/guide/asset-handling.md +++ b/docs/zh/guide/asset-handling.md @@ -2,7 +2,7 @@ ## 引用静态资源 {#referencing-static-assets} -所有的 Markdown 文件都会被编译成 Vue 组件,并由 [Vite](https://vitejs.dev/guide/assets.html) 处理。可以**并且应该**使用相对路径来引用资源: +所有的 Markdown 文件都会被编译成 Vue 组件,并由 [Vite](https://cn.vitejs.dev/guide/assets.html) 处理。可以**并且应该**使用相对路径来引用资源: ```md ![An image](./image.png) @@ -12,6 +12,10 @@ 常见的图像,媒体和字体文件会被自动检测并视作资源。 +::: tip 通过链接引用的文件不会视作资源 +在 Markdown 内,通过链接引用的 PDF 或者其他文档不会被自动视作资源。要使这些文件可用,你必须手动将其放在项目的 [`public`](#the-public-directory) 目录内。 +::: + 所有引用的资源,包括那些使用绝对路径的,都会在生产构建过程中被复制到输出目录,并使用哈希文件名。从未使用过的资源将不会被复制。小于 4kb 的图像资源将会采用 base64 内联——这可以通过 [`vite`](../reference/site-config#vite) 配置选项进行配置。 所有**静态**路径引用,包括绝对路径,都应基于你的工作目录的结构。 diff --git a/docs/zh/guide/custom-theme.md b/docs/zh/guide/custom-theme.md index 4a78185f..e5eb760b 100644 --- a/docs/zh/guide/custom-theme.md +++ b/docs/zh/guide/custom-theme.md @@ -196,7 +196,7 @@ export default { 如果主题需要特殊的 VitePress 配置,也需要在配置中扩展: ```ts -// .vitepress/theme/config.ts +// .vitepress/config.ts import baseConfig from 'awesome-vitepress-theme/config' export default { @@ -208,7 +208,7 @@ export default { 最后,如果主题为其主题配置提供了类型: ```ts -// .vitepress/theme/config.ts +// .vitepress/config.ts import baseConfig from 'awesome-vitepress-theme/config' import { defineConfigWithTheme } from 'vitepress' import type { ThemeConfig } from 'awesome-vitepress-theme' diff --git a/docs/zh/guide/deploy.md b/docs/zh/guide/deploy.md index 17525cd4..d8ac6cca 100644 --- a/docs/zh/guide/deploy.md +++ b/docs/zh/guide/deploy.md @@ -153,26 +153,24 @@ Cache-Control: max-age=31536000,immutable runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # 如果未启用 lastUpdated,则不需要 # - uses: pnpm/action-setup@v2 # 如果使用 pnpm,请取消注释 # - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: npm # 或 pnpm / yarn - name: Setup Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v4 - name: Install dependencies run: npm ci # 或 pnpm install / yarn install / bun install - name: Build with VitePress - run: | - npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build - touch docs/.vitepress/dist/.nojekyll + run: npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: docs/.vitepress/dist @@ -187,7 +185,7 @@ Cache-Control: max-age=31536000,immutable steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 ``` ::: warning diff --git a/docs/zh/guide/extending-default-theme.md b/docs/zh/guide/extending-default-theme.md index a58e35f4..4bb495fa 100644 --- a/docs/zh/guide/extending-default-theme.md +++ b/docs/zh/guide/extending-default-theme.md @@ -194,7 +194,10 @@ export default { - `aside-ads-after` - 当 `layout: 'home'` 在 frontmatter 中被启用时: - `home-hero-before` + - `home-hero-info-before` - `home-hero-info` + - `home-hero-info-after` + - `home-hero-actions-after` - `home-hero-image` - `home-hero-after` - `home-features-before` diff --git a/docs/zh/guide/frontmatter.md b/docs/zh/guide/frontmatter.md index 778b8111..4bcec7ea 100644 --- a/docs/zh/guide/frontmatter.md +++ b/docs/zh/guide/frontmatter.md @@ -2,7 +2,7 @@ ## 用法 {#usage} -VitePress 支持在所有 Markdown 文件中使用 YAML frontmatter,并使用 [gray-matter](https://github.com/jonschlinkert/gray-matter) 解析。frontmatter 必须位于 Markdown 文件的顶部 (在任何元素之前,包括 ` diff --git a/src/client/theme-default/components/VPHomeContent.vue b/src/client/theme-default/components/VPHomeContent.vue new file mode 100644 index 00000000..fe689b6e --- /dev/null +++ b/src/client/theme-default/components/VPHomeContent.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/client/theme-default/components/VPHomeHero.vue b/src/client/theme-default/components/VPHomeHero.vue index 5d482944..972a1f61 100644 --- a/src/client/theme-default/components/VPHomeHero.vue +++ b/src/client/theme-default/components/VPHomeHero.vue @@ -15,7 +15,10 @@ const { frontmatter: fm } = useData() :image="fm.hero.image" :actions="fm.hero.actions" > + + + diff --git a/src/client/theme-default/components/VPHomeSponsors.vue b/src/client/theme-default/components/VPHomeSponsors.vue index 7847ac96..1343e776 100644 --- a/src/client/theme-default/components/VPHomeSponsors.vue +++ b/src/client/theme-default/components/VPHomeSponsors.vue @@ -1,5 +1,4 @@ diff --git a/src/client/theme-default/components/VPSwitchAppearance.vue b/src/client/theme-default/components/VPSwitchAppearance.vue index f63d1ce4..7b13355f 100644 --- a/src/client/theme-default/components/VPSwitchAppearance.vue +++ b/src/client/theme-default/components/VPSwitchAppearance.vue @@ -2,8 +2,6 @@ import { inject, computed } from 'vue' import { useData } from '../composables/data' import VPSwitch from './VPSwitch.vue' -import VPIconMoon from './icons/VPIconMoon.vue' -import VPIconSun from './icons/VPIconSun.vue' const { isDark, theme } = useData() @@ -25,8 +23,8 @@ const switchTitle = computed(() => { :aria-checked="isDark" @click="toggleAppearance" > - - + + diff --git a/src/client/theme-default/components/VPTeamMembersItem.vue b/src/client/theme-default/components/VPTeamMembersItem.vue index 5acb21e8..f84bdc03 100644 --- a/src/client/theme-default/components/VPTeamMembersItem.vue +++ b/src/client/theme-default/components/VPTeamMembersItem.vue @@ -1,6 +1,5 @@