Skip to content

Commit 7c201f1

Browse files
committed
feat(404-page): add ejected swizzle template
1 parent a06a30b commit 7c201f1

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import Translate from '@docusaurus/Translate';
4+
import Heading from '@theme/Heading';
5+
export default function NotFoundContent({className}) {
6+
return (
7+
<main className={clsx('container margin-vert--xl', className)}>
8+
<div className="row">
9+
<div className="col col--6 col--offset-3">
10+
<Heading as="h1" className="hero__title">
11+
<Translate
12+
id="theme.NotFound.title"
13+
description="The title of the 404 page">
14+
Page Not Found
15+
</Translate>
16+
</Heading>
17+
<p>
18+
<Translate
19+
id="theme.NotFound.p1"
20+
description="The first paragraph of the 404 page">
21+
We could not find what you were looking for.
22+
</Translate>
23+
</p>
24+
<p>
25+
<Translate
26+
id="theme.NotFound.p2"
27+
description="The 2nd paragraph of the 404 page">
28+
Please contact the owner of the site that linked you to the
29+
original URL and let them know their link is broken.
30+
</Translate>
31+
</p>
32+
</div>
33+
</div>
34+
</main>
35+
);
36+
}

src/theme/NotFound/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
export default function Index() {
7+
const title = translate({
8+
id: 'theme.NotFound.title',
9+
message: 'Page Not Found',
10+
});
11+
return (
12+
<>
13+
<PageMetadata title={title} />
14+
<Layout>
15+
<NotFoundContent />
16+
</Layout>
17+
</>
18+
);
19+
}

0 commit comments

Comments
 (0)