@dino-ovum/theme 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app/components/ErrorPageContent.jsx +36 -0
- package/src/app/components/NotFoundContent.jsx +24 -0
- package/src/app/components/StatusPage.jsx +54 -0
- package/src/app/styles/components/StatusPage.module.scss +55 -0
- package/src/theme/ErrorPageContent.jsx +1 -0
- package/src/theme/NotFound/Content/index.jsx +1 -0
- package/src/translations/ja.json +15 -0
- package/src/translations/ko.json +15 -0
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Translate from '@docusaurus/Translate';
|
|
2
|
+
import styles from '../styles/components/StatusPage.module.scss';
|
|
3
|
+
import StatusPage from './StatusPage.jsx';
|
|
4
|
+
|
|
5
|
+
export default function ErrorPageContent({error, tryAgain}) {
|
|
6
|
+
return (
|
|
7
|
+
<StatusPage
|
|
8
|
+
title={<Translate id="docnest.error.title">Page Error</Translate>}
|
|
9
|
+
description={
|
|
10
|
+
<p>
|
|
11
|
+
<Translate id="docnest.error.description">
|
|
12
|
+
We couldn't display this page. Try again, or head back home.
|
|
13
|
+
</Translate>
|
|
14
|
+
</p>
|
|
15
|
+
}
|
|
16
|
+
actions={
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
className="button button--primary"
|
|
20
|
+
onClick={tryAgain}
|
|
21
|
+
>
|
|
22
|
+
<Translate id="docnest.error.retry">Try again</Translate>
|
|
23
|
+
</button>
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
{error && (
|
|
27
|
+
<details className={styles.details}>
|
|
28
|
+
<summary>
|
|
29
|
+
<Translate id="docnest.error.details">Error details</Translate>
|
|
30
|
+
</summary>
|
|
31
|
+
<pre>{error.message}</pre>
|
|
32
|
+
</details>
|
|
33
|
+
)}
|
|
34
|
+
</StatusPage>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Translate from '@docusaurus/Translate';
|
|
2
|
+
import StatusPage from './StatusPage.jsx';
|
|
3
|
+
|
|
4
|
+
export default function NotFoundContent({className}) {
|
|
5
|
+
return (
|
|
6
|
+
<StatusPage
|
|
7
|
+
className={className}
|
|
8
|
+
title={<Translate id="theme.NotFound.title">Page Not Found</Translate>}
|
|
9
|
+
description={
|
|
10
|
+
<>
|
|
11
|
+
<p>
|
|
12
|
+
<Translate id="theme.NotFound.p1">We could not find what you were looking for.</Translate>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
<Translate id="theme.NotFound.p2">
|
|
16
|
+
Please contact the owner of the site that linked you to the original URL and let them
|
|
17
|
+
know their link is broken.
|
|
18
|
+
</Translate>
|
|
19
|
+
</p>
|
|
20
|
+
</>
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import Translate from '@docusaurus/Translate';
|
|
3
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
4
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
5
|
+
import Heading from '@theme/Heading';
|
|
6
|
+
import ThemedImage from '@theme/ThemedImage';
|
|
7
|
+
import {SITE_ROUTES} from '../routes.js';
|
|
8
|
+
import styles from '../styles/components/StatusPage.module.scss';
|
|
9
|
+
|
|
10
|
+
// Shared frame for the error and not-found pages: site logo, title, and the home action.
|
|
11
|
+
export default function StatusPage({className, title, description, actions, children}) {
|
|
12
|
+
const {
|
|
13
|
+
navbar: {logo},
|
|
14
|
+
} = useThemeConfig();
|
|
15
|
+
const light = useBaseUrl(logo?.src ?? '');
|
|
16
|
+
const dark = useBaseUrl(logo?.srcDark ?? logo?.src ?? '');
|
|
17
|
+
const home = useBaseUrl(SITE_ROUTES.home);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<main className={clsx('container margin-vert--xl', className)}>
|
|
21
|
+
<div className={styles.content}>
|
|
22
|
+
<div className={styles.heading}>
|
|
23
|
+
{logo?.src && (
|
|
24
|
+
<ThemedImage
|
|
25
|
+
className={styles.logo}
|
|
26
|
+
alt=""
|
|
27
|
+
width={96}
|
|
28
|
+
height={96}
|
|
29
|
+
sources={{light, dark}}
|
|
30
|
+
/>
|
|
31
|
+
)}
|
|
32
|
+
<Heading
|
|
33
|
+
as="h1"
|
|
34
|
+
className={styles.title}
|
|
35
|
+
>
|
|
36
|
+
{title}
|
|
37
|
+
</Heading>
|
|
38
|
+
</div>
|
|
39
|
+
{description}
|
|
40
|
+
<div className={styles.actions}>
|
|
41
|
+
{actions}
|
|
42
|
+
{/* A full page load leaves a broken client state behind. */}
|
|
43
|
+
<a
|
|
44
|
+
className="button button--secondary button--outline"
|
|
45
|
+
href={home}
|
|
46
|
+
>
|
|
47
|
+
<Translate id="docnest.error.home">Back home</Translate>
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
{children}
|
|
51
|
+
</div>
|
|
52
|
+
</main>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.content {
|
|
2
|
+
max-width: 48rem;
|
|
3
|
+
margin-inline: auto;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.heading {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: clamp(1rem, 3vw, 1.5rem);
|
|
10
|
+
margin-bottom: 1.5rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.logo {
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
width: clamp(4rem, 12vw, 6rem);
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.title {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
margin: 0;
|
|
22
|
+
font-size: clamp(1.75rem, 5vw, 3rem);
|
|
23
|
+
line-height: 1.2;
|
|
24
|
+
overflow-wrap: anywhere;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.actions {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
gap: 0.75rem;
|
|
31
|
+
margin-top: 1.5rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Links do not center their label like buttons, so center both explicitly.
|
|
35
|
+
.actions > * {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
min-height: 44px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.details {
|
|
43
|
+
margin-top: 2rem;
|
|
44
|
+
color: var(--ifm-color-emphasis-700);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.details summary {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.details pre {
|
|
52
|
+
margin-top: 0.75rem;
|
|
53
|
+
white-space: pre-wrap;
|
|
54
|
+
overflow-wrap: anywhere;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from '../app/components/ErrorPageContent.jsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from '../../../app/components/NotFoundContent.jsx';
|
package/src/translations/ja.json
CHANGED
|
@@ -88,5 +88,20 @@
|
|
|
88
88
|
},
|
|
89
89
|
"docnest.updates.empty": {
|
|
90
90
|
"message": "条件に一致する文書がありません。"
|
|
91
|
+
},
|
|
92
|
+
"docnest.error.title": {
|
|
93
|
+
"message": "エラーが発生しました"
|
|
94
|
+
},
|
|
95
|
+
"docnest.error.description": {
|
|
96
|
+
"message": "ページを表示できませんでした。もう一度試すか、ホームに戻ってください。"
|
|
97
|
+
},
|
|
98
|
+
"docnest.error.retry": {
|
|
99
|
+
"message": "もう一度試す"
|
|
100
|
+
},
|
|
101
|
+
"docnest.error.home": {
|
|
102
|
+
"message": "ホームに戻る"
|
|
103
|
+
},
|
|
104
|
+
"docnest.error.details": {
|
|
105
|
+
"message": "エラーの詳細"
|
|
91
106
|
}
|
|
92
107
|
}
|
package/src/translations/ko.json
CHANGED
|
@@ -88,5 +88,20 @@
|
|
|
88
88
|
},
|
|
89
89
|
"docnest.updates.empty": {
|
|
90
90
|
"message": "조건에 맞는 문서가 없습니다."
|
|
91
|
+
},
|
|
92
|
+
"docnest.error.title": {
|
|
93
|
+
"message": "오류가 발생했습니다"
|
|
94
|
+
},
|
|
95
|
+
"docnest.error.description": {
|
|
96
|
+
"message": "페이지를 표시하지 못했습니다. 다시 시도하거나 홈으로 돌아가 주세요."
|
|
97
|
+
},
|
|
98
|
+
"docnest.error.retry": {
|
|
99
|
+
"message": "다시 시도"
|
|
100
|
+
},
|
|
101
|
+
"docnest.error.home": {
|
|
102
|
+
"message": "홈으로"
|
|
103
|
+
},
|
|
104
|
+
"docnest.error.details": {
|
|
105
|
+
"message": "오류 상세 정보"
|
|
91
106
|
}
|
|
92
107
|
}
|