commit 9ef386f1d713e9ac5c65513f26652319fd9dfff6
parent 0aba8dd0b1adf5b0efb3be3af7843d66fac77367
Author: bot-for-notamitgamer <bot-for-notamitgamer@users.noreply.github.com>
Date: Sat, 26 Sep 2026 12:39:17 +0000
Fix footer landing mid-page on homepage instead of at the bottom
'home-features-after' fires right after the frontmatter 'features'
array, but VPHome.vue puts <Content /> (the page's markdown body,
where the 'Why this archive' section actually lives) AFTER that slot
with nothing below it — so the footer was sandwiching itself between
the 3 feature cards and the rest of the homepage's own content.
Switched to 'layout-bottom', which fires after VPContent entirely
(including <Content />) and even after VitePress's own VPFooter,
regardless of layout type — genuinely the last thing on the page.
Since 'layout-bottom' also fires on regular doc pages (which already
get the footer correctly via 'doc-after'), added HomeFooterGate.vue
to only render it there when frontmatter.layout === 'home', avoiding
a duplicate on every other page.
Verified in the actual built dist/index.html (not just that the
build passed) that the footer's HTML now comes after the 'Why this
archive' section, and confirmed exactly one footer instance on a
regular doc page (no duplicate).
Diffstat:
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/docs/.vitepress/theme/components/HomeFooterGate.vue b/docs/.vitepress/theme/components/HomeFooterGate.vue
@@ -0,0 +1,16 @@
+<script setup>
+import { useData } from 'vitepress'
+import DocFooterExtra from './DocFooterExtra.vue'
+
+// 'layout-bottom' fires on every page type, after everything (including the
+// home page's markdown body below the features array — see VPHome.vue,
+// which puts <Content /> after 'home-features-after' with no slot below it).
+// Doc pages already get the footer correctly via 'doc-after', so only
+// render it here when this page is actually using the home layout —
+// otherwise doc pages would get it twice.
+const { frontmatter } = useData()
+</script>
+
+<template>
+ <DocFooterExtra v-if="frontmatter.layout === 'home'" />
+</template>
diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts
@@ -10,6 +10,7 @@ import Breadcrumbs from './components/Breadcrumbs.vue'
import Labels from './components/Labels.vue'
import SidebarTags from './components/SidebarTags.vue'
import DocFooterExtra from './components/DocFooterExtra.vue'
+import HomeFooterGate from './components/HomeFooterGate.vue'
import './style.css'
export default {
@@ -19,7 +20,8 @@ export default {
return h(DefaultTheme.Layout, null, {
'layout-bottom': () => h(Fragment, [
h(Banner),
- h(ExternalLinkWarning)
+ h(ExternalLinkWarning),
+ h(HomeFooterGate)
]),
'doc-before': () => h('div', { class: 'bsc-doc-toolbar' }, [
h(Breadcrumbs),
@@ -32,10 +34,6 @@ export default {
'doc-after': () => h(Fragment, [
h(DocFooterExtra)
]),
- // The homepage uses `layout: home`, which does not render 'doc-after'
- // at all — that slot only exists in VitePress's 'doc' layout. Hook the
- // home layout's own slot so the footer shows there too.
- 'home-features-after': () => h(DocFooterExtra),
'sidebar-nav-after': () => h(SidebarTags),
'nav-bar-content-after': () => h(SponsorButton)
})