This repository has been archived by the owner on Dec 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
60 lines (56 loc) · 1.63 KB
/
theme.config.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React from "react";
import { DocsThemeConfig } from "nextra-theme-docs";
import { useRouter } from "next/router";
import useLocalesMap from "./components/useLocalesMap";
import { EDIT_LINK, FEEDBACK_LINK, LAST_UPDATED, SEARCH_PLACEHOLDER, TOC_TITLE } from "./translations";
const config: DocsThemeConfig = {
logo: (
<span>
📁 <strong>CabinetJS</strong>
</span>
),
docsRepositoryBase: "https://github.com/cabinetjs/docs/blob/main",
project: {
link: "https://github.com/cabinetjs",
},
footer: {
component: () => null,
},
search: {
placeholder: () => useLocalesMap(SEARCH_PLACEHOLDER),
},
editLink: {
text: () => <>{useLocalesMap(EDIT_LINK)}</>,
},
feedback: {
content: () => <>{useLocalesMap(FEEDBACK_LINK)}</>,
},
toc: {
float: true,
title: () => <>{useLocalesMap(TOC_TITLE)}</>,
},
useNextSeoProps: () => ({
titleTemplate: "%s - CabinetJS",
}),
gitTimestamp({ timestamp }) {
const { locale } = useRouter();
const lastUpdatedOn = useLocalesMap(LAST_UPDATED);
return (
<>
{lastUpdatedOn}{" "}
<time dateTime={timestamp.toISOString()}>
{timestamp.toLocaleDateString(locale, {
day: "numeric",
month: "long",
year: "numeric",
})}
</time>
</>
);
},
i18n: [
{ locale: "en", text: "English" },
{ locale: "ko", text: "한국어" },
],
};
export default config;