feat(theme): add site footer and marketing sections

- Add SiteFooter, rendered through the Layout bottom slot so it appears on
  every page type. themeConfig.footer is deliberately left unset: setting
  it would render the built-in HomeFooter as well, on the home page only.
- Add a frontmatter-driven section system (advantages, contentGrid,
  techStack, cases and cta) with a single ordered array, so bands can be
  reordered or removed without touching code.
- Bands render only when they have content, so an unfilled page degrades
  to its heading rather than showing empty boxes.
- Add a SHOW_COPY_PLACEHOLDERS flag for drafting, false by default.
This commit is contained in:
zihluwang committed 2026-09-25 14:48:42 +08:00
1 parent b2eb6b9638
commit 638c71da44
14 files changed
+652 -3

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
import type { ReactNode } from "react"
import { SHOW_COPY_PLACEHOLDERS } from "./placeholder"
import { str, type Section } from "./types"
interface SectionBandProps {
section: Section
/** Whether the section body produced any content. */
hasContent: boolean
children: ReactNode
}
/**
* Shell for a marketing band: the `<section>` wrapper, its heading and its
* subtitle. Renders nothing at all when the section has neither content nor a
* heading, so an unfilled page degrades to just its hero.
*/
export function SectionBand({ section, hasContent, children }: SectionBandProps) {
const title = str(section.title)
const subtitle = str(section.subtitle)
if (!hasContent && !title && !subtitle) {
if (!SHOW_COPY_PLACEHOLDERS) return null
return (
<section id={section.id} className="rp-site-section">
<div className="mx-auto max-w-5xl px-6">
<div className="rounded-lg border border-dashed border-(--rp-c-divider) p-8 text-center text-sm text-(--rp-c-text-3)">
TODO: {section.type}
</div>
</div>
</section>
)
}
return (
<section id={section.id} className="rp-site-section">
<div className="mx-auto max-w-5xl px-6">
{(title || subtitle) && (
<header className="mb-10 text-center">
{title && <h2 className="m-0 text-3xl font-semibold text-(--rp-c-text-1)">{title}</h2>}
{subtitle && (
<p className="mx-auto mt-3 max-w-2xl text-base text-(--rp-c-text-2)">{subtitle}</p>
)}
</header>
)}
{children}
</div>
</section>
)
}