Skip to content

Commit 916d36d

Browse files
authored
Merge pull request #838 from IABTechLab/ibg-CORPWEB-3437-404-page
ibg-CORPWEB-3437-404-page
2 parents 06cc451 + 545d5de commit 916d36d

File tree

3 files changed

+107
-3
lines changed

3 files changed

+107
-3
lines changed

i18n/ja/code.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,29 @@
3636
"description": "The title of the fallback page when the page crashed"
3737
},
3838
"theme.NotFound.title": {
39-
"message": "ページが見つかりません",
39+
"message": "ページが見つかりませんでした",
4040
"description": "The title of the 404 page"
4141
},
4242
"theme.NotFound.p1": {
43-
"message": "お探しのページが見つかりませんでした",
43+
"message": "お探しのページが見つかりませんでした。ページが移動したか、リンクにエラーがある可能性があります。",
4444
"description": "The first paragraph of the 404 page"
4545
},
4646
"theme.NotFound.p2": {
47-
"message": "このページにリンクしているサイトの所有者にリンクが壊れていることを伝えてください",
47+
"message": "以下の方法をお試しください:",
4848
"description": "The 2nd paragraph of the 404 page"
4949
},
50+
"theme.NotFound.ListItem1": {
51+
"message": "リンクを再度クリックしてください。",
52+
"description": "The first list item of the 404 page"
53+
},
54+
"theme.NotFound.ListItem2": {
55+
"message": "UID2 のページからタイトルやキーワードで検索してください。",
56+
"description": "The second list item of the 404 page"
57+
},
58+
"theme.NotFound.ListItem3": {
59+
"message": "UID2 ドキュメントホームページにアクセスしてください。",
60+
"description": "The third list item of the 404 page"
61+
},
5062
"theme.admonition.note": {
5163
"message": "注記",
5264
"description": "The default label used for the Note admonition (:::note)"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from "react";
2+
import clsx from "clsx";
3+
import Translate from "@docusaurus/Translate";
4+
import type { Props } from "@theme/NotFound/Content";
5+
import Heading from "@theme/Heading";
6+
import Link from "@docusaurus/Link";
7+
8+
export default function NotFoundContent({ className }: Props): JSX.Element {
9+
return (
10+
<main className={clsx("container margin-vert--xl", className)}>
11+
<div className="row">
12+
<div className="col col--6 col--offset-3">
13+
<Heading as="h1" className="hero__title">
14+
<Translate
15+
id="theme.NotFound.title"
16+
description="The title of the 404 page"
17+
>
18+
Page Not Found
19+
</Translate>
20+
</Heading>
21+
<p>
22+
<Translate
23+
id="theme.NotFound.p1"
24+
description="The first paragraph of the 404 page"
25+
>
26+
We couldn't find the page you were looking for. The page might
27+
have been moved, or there was an error in the link.
28+
</Translate>
29+
</p>
30+
<p>
31+
<Translate
32+
id="theme.NotFound.p2"
33+
description="The 2nd paragraph of the 404 page"
34+
>
35+
Here are some things you can do:
36+
</Translate>
37+
</p>
38+
<ul>
39+
<li>
40+
<Translate
41+
id="theme.NotFound.ListItem1"
42+
description="The first list item of the 404 page"
43+
>
44+
Go back and retry the link.
45+
</Translate>
46+
</li>
47+
<li>
48+
<Translate
49+
id="theme.NotFound.ListItem2"
50+
description="The second list item of the 404 page"
51+
>
52+
Search for the document by its title or keywords from any UID2
53+
page.
54+
</Translate>
55+
</li>
56+
<li>
57+
<Link to="/docs/intro">
58+
<Translate
59+
id="theme.NotFound.ListItem3"
60+
description="The third list item of the 404 page"
61+
>
62+
Visit the UID2 documentation home page.
63+
</Translate>
64+
</Link>
65+
</li>
66+
</ul>
67+
</div>
68+
</div>
69+
</main>
70+
);
71+
}

src/theme/NotFound/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from "react";
2+
import { translate } from "@docusaurus/Translate";
3+
import { PageMetadata } from "@docusaurus/theme-common";
4+
import Layout from "@theme/Layout";
5+
import NotFoundContent from "@theme/NotFound/Content";
6+
7+
export default function Index(): JSX.Element {
8+
const title = translate({
9+
id: "theme.NotFound.title",
10+
message: "Page Not Found",
11+
});
12+
13+
return (
14+
<>
15+
<PageMetadata title={title} />
16+
<Layout>
17+
<NotFoundContent />
18+
</Layout>
19+
</>
20+
);
21+
}

0 commit comments

Comments
 (0)