Skip to content

Commit

Permalink
docs: set title for SPA (#4169)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 10, 2024
1 parent 696899f commit 2b6134c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions website/docs/en/guide/basic/html-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export default {
};
```

:::tip
For single-page applications (SPA), Rsbuild will include an initial title in the HTML page, but you usually need to dynamically update the page title on route switching, for example using some routing libraries or libraries like [React Helmet](https://github.com/nfl/react-helmet).
:::

## Set Page Icon

Rsbuild supports setting [favicon](https://developer.mozilla.org/en-US/docs/Glossary/Favicon) icon and [apple-touch-icon](https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/) icon.
Expand Down
6 changes: 5 additions & 1 deletion website/docs/zh/guide/basic/html-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
};
```

当你的项目中有多个页面时,可以基于入口名称来为不同的页面设置对应的标题
当你的项目中有多个页面时,可以基于入口名称,来为不同的页面设置对应的标题

```ts
export default {
Expand All @@ -58,6 +58,10 @@ export default {
};
```

:::tip
对于单页应用(SPA),Rsbuild 会在 HTML 页面中包含一个初始的 title,但你通常需要在路由切换时动态更新页面标题,例如使用一些路由库,或是 [React Helmet](https://github.com/nfl/react-helmet) 这类库。
:::

## 设置页面图标

Rsbuild 支持设置 [favicon](https://developer.mozilla.org/en-US/docs/Glossary/Favicon) 图标 和 iOS 系统下的 [apple-touch-icon](https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/) 图标。
Expand Down

0 comments on commit 2b6134c

Please sign in to comment.