Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme-default): set home footer with markdown slot (close: #2993) #2994

Merged
merged 1 commit into from Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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