Skip to content

Commit 1ac172c

Browse files
committed
docs($cn): docs: extend Hero example with core properties (#1088)
1 parent 14084c7 commit 1ac172c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/@vuepress/plugin-blog/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ module.exports = (options, ctx) => {
6565
}) => {
6666
if (when(pageCtx)) {
6767
Object.keys(frontmatter).forEach(key => {
68-
rawFrontmatter[key] = rawFrontmatter[key] || frontmatter[key]
68+
if (!frontmatter[key]) {
69+
rawFrontmatter[key] || frontmatter[key]
70+
}
6971
})
7072
Object.assign(pageCtx, data)
7173
}

packages/docs/docs/zh/theme/default-theme-config.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
## 首页
88

9-
默认的主题提供了一个首页(Homepage)的布局 (用于 [这个网站的主页](../README.md))。想要使用它,需要在你的根级 `README.md`[YAML front matter](../guide/markdown.md#front-matter) 指定 `home: true`以下是这个网站实际使用的数据
9+
默认的主题提供了一个首页(Homepage)的布局 (用于 [这个网站的主页](../README.md))。想要使用它,需要在你的根级 `README.md`[YAML front matter](../guide/markdown.md#front-matter) 指定 `home: true`以下是一个如何使用的例子
1010

1111
``` yaml
1212
---
1313
home: true
1414
heroImage: /hero.png
15+
heroText: Hero 标题
16+
tagline: Hero 副标题
1517
actionText: 快速上手 →
1618
actionLink: /zh/guide/
1719
features:

0 commit comments

Comments
 (0)