Skip to content

Commit

Permalink
feat(theme-default): set home footer with markdown slot (close: #2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Jan 17, 2022
1 parent f59598a commit 90b9326
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/@vuepress/theme-default/components/Home.vue
Expand Up @@ -57,6 +57,12 @@
>
{{ data.footer }}
</div>

<Content
v-else
slot-key="footer"
class="footer"
/>
</main>
</template>

Expand Down
5 changes: 4 additions & 1 deletion packages/docs/docs/index.md
Expand Up @@ -3,7 +3,6 @@ home: true
heroImage: /hero.png
actionText: Get Started →
actionLink: /guide/getting-started.html
footer: MIT Licensed | Copyright © 2018-present Evan You
---

<div class="features">
Expand All @@ -20,3 +19,7 @@ footer: MIT Licensed | Copyright © 2018-present Evan You
<p>VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.</p>
</div>
</div>

::: slot footer
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
:::
14 changes: 14 additions & 0 deletions packages/docs/docs/theme/default-theme-config.md
Expand Up @@ -35,6 +35,20 @@ Any extra content after the `YAML front matter` will be parsed as normal Markdow

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

## Rich-text footer

Note that you can also set `footer` with [Markdown Slot Syntax](../guide/markdown-slot.md) to support rich text:

```md
---
home: true
---

::: slot footer
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
:::
```

## Navbar

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.
Expand Down
14 changes: 14 additions & 0 deletions packages/docs/docs/zh/theme/default-theme-config.md
Expand Up @@ -31,6 +31,20 @@ footer: MIT Licensed | Copyright © 2018-present Evan You

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

## 富文本 footer

你还可以使用 [Markdown Slot Syntax](../guide/markdown-slot.md) 来设置 `footer`,以支持富文本:

```md
---
home: true
---

::: slot footer
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
:::
```

## 导航栏

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

0 comments on commit 90b9326

Please sign in to comment.