> For AI agents: the complete documentation index is available at https://rspress.rs/zh/llms.txt, the full documentation bundle is available at https://rspress.rs/zh/llms-full.txt.

# Home 主页

Rspress 提供了开箱即用的 Home 主页功能，用户可以通过在 frontmatter 中声明 `pageType: home` 快速生成一个可用的站点首页。

你可以通过 frontmatter 来定义 Home 页面的内容，详细类型可见 [FrontMatter 配置](https://rspress.rs/zh/api/config/config-frontmatter.md#hero)。下面是一个简单的例子：

```yaml title="docs/index.mdx"
---
pageType: home
title: Rspress
titleSuffix: '基于 Rsbuild 的静态站点生成器'

hero:
  name: Rspress
  text: 文档工程解决方案
  tagline: 现代化文档开发技术栈
  actions:
    - theme: brand
      text: 介绍
      link: /zh/guide/introduction
    - theme: alt
      text: 快速开始
      link: /zh/guide/getting-started

features:
  - title: 'MDX: 使用灵活语法编写内容'
    details: MDX 是一种强大的内容编写方式，你可以在 Markdown 中使用 React 组件。
    icon: 📦
  - title: '功能丰富: 一站式解决方案'
    details: 对全文搜索、国际化等常见功能可以做到开箱即用。
    icon: 🎨
  - title: '扩展性强: 提供多种自定义能力'
    details: 通过其扩展机制，你可以轻松地扩展主题 UI 和构建能力。
    icon: 🚀
---
```

## Home 组件

Rspress 首页由这些组件组成，你可以通过 [自定义主题 - ESM 重导出](https://rspress.rs/zh/guide/basic/custom-theme.md#reexport) 定制：

- [HomeHero](https://rspress.rs/zh/ui/layout-components/home-hero.md)
- [HomeFeature](https://rspress.rs/zh/ui/layout-components/home-feature.md)
- [HomeFooter](https://rspress.rs/zh/ui/layout-components/home-footer.md)
- [HomeBackground](https://rspress.rs/zh/ui/layout-components/home-background.md)

:::tip

你也可以直接通过覆盖 [`HomeLayout`](https://rspress.rs/zh/ui/layout-components/home-layout.md) 组件来定制整个首页。如果这样做，需要注意的是首页相关配置和这些 frontmatter 的字段将均不会生效。

:::

## 配置详情

关于 Home 页面完整的 frontmatter 配置项，请参考 [Frontmatter 配置](https://rspress.rs/zh/api/config/config-frontmatter.md#hero)。
