Skip to content

Commit 8dcda09

Browse files
authored
docs: update document.title to improve SEO (#210)
1 parent 610bdf0 commit 8dcda09

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.dumi/pages/404/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const NotFoundPage: React.FC<NotFoundProps> = ({ router }) => {
4848
extra={
4949
<Link to={utils.getLocalizedPathname('/', isZhCN)}>
5050
<Button type="primary" icon={<HomeOutlined />}>
51-
{isZhCN ? '返回 Ant Design 首页' : 'Back to home page'}
51+
{isZhCN ? '返回 Ant Design X 首页' : 'Back to home page'}
5252
</Button>
5353
</Link>
5454
}

.dumi/pages/theme-editor/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ const CustomTheme: React.FC = () => {
6767
return (
6868
<div className={styles.editor}>
6969
<Helmet>
70-
<title>{`${locale.title} - Ant Design`}</title>
71-
<meta property="og:title" content={`${locale.title} - Ant Design`} />
70+
<title>{`${locale.title} - Ant Design X`}</title>
71+
<meta property="og:title" content={`${locale.title} - Ant Design X`} />
7272
</Helmet>
7373
<Suspense fallback={<Skeleton style={{ margin: 24 }} />}>
7474
<ThemeEditor

.dumi/theme/common/CommonHelmet.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React from 'react';
21
import { Helmet, useRouteMeta } from 'dumi';
2+
import React from 'react';
33

44
const CommonHelmet: React.FC = () => {
55
const meta = useRouteMeta();
66

77
const [title, description] = React.useMemo<[string, string]>(() => {
88
let helmetTitle: string;
99
if (!meta.frontmatter.subtitle && !meta.frontmatter.title) {
10-
helmetTitle = '404 Not Found - Ant Design';
10+
helmetTitle = '404 Not Found - Ant Design X';
1111
} else {
1212
helmetTitle = `${meta.frontmatter.subtitle || ''} ${
1313
meta.frontmatter?.title || ''
14-
} - Ant Design`;
14+
} - Ant Design X`;
1515
}
1616
const helmetDescription = meta.frontmatter.description || '';
1717
return [helmetTitle, helmetDescription];

.dumi/theme/layouts/IndexLayout/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const IndexLayout: React.FC<PropsWithChildren<IndexLayoutProps>> = (props) => {
1414
return (
1515
<>
1616
<Helmet>
17-
<title>{title}</title>
17+
<title>
18+
{title} - {desc}
19+
</title>
1820
<meta property="og:title" content={title} />
1921
{desc && <meta name="description" content={desc} />}
2022
</Helmet>

0 commit comments

Comments
 (0)