Skip to content

Commit 753df05

Browse files
authoredJan 17, 2022
feat(theme-default): set home footer with markdown slot (close: #2993) (#2994)
1 parent f59598a commit 753df05

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed
 

‎packages/@vuepress/theme-default/components/Home.vue

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
>
5858
{{ data.footer }}
5959
</div>
60+
61+
<Content
62+
v-else
63+
slot-key="footer"
64+
class="footer"
65+
/>
6066
</main>
6167
</template>
6268

‎packages/docs/docs/index.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ home: true
33
heroImage: /hero.png
44
actionText: Get Started →
55
actionLink: /guide/getting-started.html
6-
footer: MIT Licensed | Copyright © 2018-present Evan You
76
---
87

98
<div class="features">
@@ -20,3 +19,7 @@ footer: MIT Licensed | Copyright © 2018-present Evan You
2019
<p>VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.</p>
2120
</div>
2221
</div>
22+
23+
::: slot footer
24+
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
25+
:::

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

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ Any extra content after the `YAML front matter` will be parsed as normal Markdow
3535

3636
To use a fully custom homepage layout, you can also use a [Custom Layout](#custom-layout-for-specific-pages).
3737

38+
## Rich-text footer
39+
40+
Note that you can also set `footer` with [Markdown Slot Syntax](../guide/markdown-slot.md) to support rich text:
41+
42+
```md
43+
---
44+
home: true
45+
---
46+
47+
::: slot footer
48+
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
49+
:::
50+
```
51+
3852
## Navbar
3953

4054
The Navbar may contain your page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](../guide/i18n.md) and [Repository Link](#git-repo-and-edit-links), they all depend on your configuration.

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

+14
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ footer: MIT Licensed | Copyright © 2018-present Evan You
3131

3232
任何 `YAML front matter` 之后额外的内容将会以普通的 markdown 被渲染,并插入到 `features` 的后面。
3333

34+
## 富文本 footer
35+
36+
你还可以使用 [Markdown Slot Syntax](../guide/markdown-slot.md) 来设置 `footer`,以支持富文本:
37+
38+
```md
39+
---
40+
home: true
41+
---
42+
43+
::: slot footer
44+
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
45+
:::
46+
```
47+
3448
## 导航栏
3549

3650
导航栏可能包含你的页面标题、[搜索框](#搜索框)[导航栏链接](#导航栏链接)[多语言切换](../guide/i18n.md)[仓库链接](#git-仓库和编辑链接),它们均取决于你的配置。

0 commit comments

Comments
 (0)
Please sign in to comment.