-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.config.js
64 lines (61 loc) · 1.76 KB
/
theme.config.js
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
61
62
63
64
import {useRouter} from "next/router";
import useLocalesMap from "./components/use-locales-map";
import {
editTextMap,
feedbackLinkMap,
gitTimestampMap,
languageMap,
searchPlaceholderMap,
tableOfContentsTitleMap,
} from "./translations/text";
/** @type {import('nextra-theme-docs').DocsThemeConfig} */
const themeConfig = {
project: {
link: "https://github.com/MeterAppLLC/meter-help-center",
},
docsRepositoryBase: "https://github.com/MeterAppLLC/meter-help-center/blob/main",
useNextSeoProps() {
return {
titleTemplate: "%s – Meter App Help Center",
description: "Search, browse, and learn how to use the Meter App",
};
},
toc: {
float: true,
title: () => useLocalesMap(tableOfContentsTitleMap),
},
search: {
placeholder: () => useLocalesMap(searchPlaceholderMap),
},
editLink: {
text: () => useLocalesMap(editTextMap),
},
feedback: {
content: () => useLocalesMap(feedbackLinkMap),
},
logo: <span>Meter App</span>,
footer: {
text: 'Meter App LLC',
},
gitTimestamp({timestamp}) {
const {locale} = useRouter();
const lastUpdatedOn = useLocalesMap(gitTimestampMap);
return (
<>
{lastUpdatedOn}{" "}
<time dateTime={timestamp.toISOString()}>
{timestamp.toLocaleDateString(locale, {
day: "numeric",
month: "long",
year: "numeric",
})}
</time>
</>
);
},
i18n: Object.entries(languageMap).map(([locale, text]) => ({
locale,
text,
})),
};
export default themeConfig;