forked from jumpservice/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.config.tsx
More file actions
105 lines (100 loc) · 2.81 KB
/
Copy paththeme.config.tsx
File metadata and controls
105 lines (100 loc) · 2.81 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import { DocsThemeConfig } from "nextra-theme-docs";
import { useRouter } from "next/router";
import { Logo, Footer, NavbarExtra, TOC } from "@/components/theme";
import {
Icon, Steps, Alert, Cards, Card, WaitForCompletion, Nav, Tabs,
Tab, DataTable, ApplyTrialLicense, EnterpriseFeatureCta, ResourceAttributeTable
} from "@/components/docs";
interface LinkTitleProps {
title: string;
url: string;
}
export const LinkTitle: React.FC<LinkTitleProps> = ({ title, url }) => {
const handleClick = () => {
window.open(url, "_blank");
};
return (
<div
className="flex w-full items-center gap-2 cursor-pointer"
onClick={handleClick}
>
<span>{title}</span>
<span className="ml-auto">
<Icon name="link-square" />
</span>
</div>
);
};
const config: DocsThemeConfig = {
components: {
Icon, Alert, Cards, Card,
Steps, Nav, WaitForCompletion,
Tabs, Tab, DataTable, ApplyTrialLicense, EnterpriseFeatureCta, ResourceAttributeTable
},
head: (
<>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
></meta>
<meta property="og:title" content="JumpServer" />
<meta
property="og:description"
content="An open-source PAM platform (Bastion Host)"
/>
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
</>
),
logo: Logo,
logoLink: "https://www.jumpserver.com/",
feedback: {
useLink: () =>
"https://github.com/jumpserver/jumpserver/issues/new?labels=%F0%9F%A4%94+Question&projects=&template=3_question.yml&title=%5BQuestion%5D+",
},
docsRepositoryBase: "https://github.com/jumpservice/documentation/tree/dev",
search: {
placeholder: "Search",
},
navbar: {
extraContent: NavbarExtra,
},
sidebar: {
// toggleButton: true,
defaultMenuCollapseLevel: 1,
titleComponent({ title, type }) {
let titleComponent = <>{title}</>;
if (type === "separator") {
titleComponent = (
<div className="w-full border-b pb-3 dark:border-[#262626]">
<span className="nx-cursor-default font-semibold">{title}</span>
</div>
)
}
if (title === "DeepWiki") {
const URL = "https://deepwiki.com/jumpserver/jumpserver/"
titleComponent = <LinkTitle title={title} url={URL} />
}
return titleComponent;
},
},
toc: {
component: TOC,
},
primaryHue: 150,
primarySaturation: 50,
darkMode: false,
useNextSeoProps() {
const { asPath } = useRouter();
let titleTemplate = "%s - JumpServer";
if (asPath == "/") {
titleTemplate = "An open-source PAM platform - JumpServer";
}
return {
titleTemplate: titleTemplate,
};
},
footer: {
text: Footer,
},
};
export default config;