Skip to content

Commit e79a13e

Browse files
authored
feat(theme): support footer frontmatter config (vuejs#2574)
1 parent 37d5b27 commit e79a13e

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

docs/reference/default-theme-config.md

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ type SocialLinkIcon =
246246
## footer
247247
248248
- Type: `Footer`
249+
- Can be overridden per page via [frontmatter](./frontmatter-config#footer)
249250
250251
Footer configuration. You can add a message or copyright text on the footer, however, it will only be displayed when the page doesn't contain a sidebar. This is due to design concerns.
251252

docs/reference/default-theme-footer.md

+10
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@ Only inline elements can be used in `message` and `copyright` as they are render
4141
:::
4242

4343
Note that footer will not be displayed when the [SideBar](./default-theme-sidebar) is visible.
44+
45+
## Frontmatter Config
46+
47+
This can be disabled per-page using the `footer` option on frontmatter:
48+
49+
```yaml
50+
---
51+
footer: false
52+
---
53+
```

docs/reference/frontmatter-config.md

+13
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,16 @@ Whether to display [Edit Link](./default-theme-edit-link) in the footer of the c
160160
editLink: false
161161
---
162162
```
163+
164+
### footer <Badge type="info" text="default theme only" />
165+
166+
- Type: `boolean`
167+
- Default: `true`
168+
169+
Whether to display [Footer](./default-theme-footer) in the footer of the current page.
170+
171+
```yaml
172+
---
173+
footer: false
174+
---
175+
```

src/client/theme-default/components/VPFooter.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import { useData } from '../composables/data'
33
import { useSidebar } from '../composables/sidebar'
44
5-
const { theme } = useData()
5+
const { theme, frontmatter } = useData()
66
const { hasSidebar } = useSidebar()
77
</script>
88

99
<template>
10-
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
10+
<footer v-if="theme.footer && frontmatter.footer !== false" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
1111
<div class="container">
1212
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
1313
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>

0 commit comments

Comments
 (0)