-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
176 lines (168 loc) · 4.67 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import React, { useEffect } from "react";
import { useRouter } from "next/router";
import { DocsThemeConfig } from "nextra-theme-docs";
const GiscusComments = () => {
const router = useRouter();
useEffect(() => {
const scriptId = "giscus-script";
const existingScript = document.getElementById(scriptId);
if (existingScript) {
existingScript.remove();
}
const script = document.createElement("script");
script.id = scriptId;
script.src = "https://giscus.app/client.js";
script.async = true;
script.setAttribute("data-repo", "mainmethod0126/mainmethod0126.github.io");
script.setAttribute("data-repo-id", "R_kgDOKL-MAw");
script.setAttribute("data-category", "comments");
script.setAttribute("data-category-id", "DIC_kwDOKL-MA84CejFl");
script.setAttribute("data-mapping", "pathname");
script.setAttribute("data-strict", "0");
script.setAttribute("data-reactions-enabled", "1");
script.setAttribute("data-emit-metadata", "0");
script.setAttribute("data-input-position", "bottom");
script.setAttribute("data-theme", "preferred_color_scheme");
script.setAttribute("data-lang", "ko");
script.crossOrigin = "anonymous";
document.body.appendChild(script);
}, [router.asPath]); // 페이지 경로가 변경될 때마다 스크립트 재로드
return null;
};
const config: DocsThemeConfig = {
main({ children }) {
return (
<div className="content-wrapper">
{children}
<div className="giscus">
<GiscusComments />
</div>
</div>
);
},
logo: <span>😸신우섭의 도서관 v2</span>,
project: {
link: "https://github.com/mainmethod0126",
},
chat: {
link: "https://discord.com",
},
docsRepositoryBase:
"https://github.com/mainmethod0126/mainmethod0126.github.io",
footer: {
text: "📧 mainmethod0126@gmail.com",
},
sidebar: {
defaultMenuCollapseLevel: 1,
titleComponent({ title, type }) {
if (type === "separator") {
return (
<div style={{ background: "cyan", textAlign: "center" }}>{title}</div>
);
}
if (title === "Introduction") {
return <>👋 {title}</>;
}
if (title === "My Profile") {
return <>🧑🏻💻 {title}</>;
}
if (title === "projects") {
return <>🗄 {title}</>;
}
if (title === "search condition metadata") {
return <>🗃 {title}</>;
}
if (title === "hiworks auto attendance") {
return <>🗃 {title}</>;
}
if (title === "simple semantic version") {
return <>🗃 {title}</>;
}
if (title === "sneaky chat games") {
return <>🗃 {title}</>;
}
if (title === "annotation scanner") {
return <>🗃 {title}</>;
}
if (title === "elasticsearch") {
return <>📒 {title}</>;
}
if (title === "c++") {
return <>📒 {title}</>;
}
if (title === "common") {
return <>📒 {title}</>;
}
if (title === "network") {
return <>📒 {title}</>;
}
if (title === "linux") {
return <>📒 {title}</>;
}
if (title === "command") {
return <>📒 {title}</>;
}
if (title === "java") {
return <>📒 {title}</>;
}
if (title === "spring") {
return <>📒 {title}</>;
}
if (title === "webflux") {
return <>📒 {title}</>;
}
if (title === "r2dbc") {
return <>📒 {title}</>;
}
if (title === "jpa") {
return <>📒 {title}</>;
}
if (title === "rdb") {
return <>📒 {title}</>;
}
if (title === "nginx") {
return <>📒 {title}</>;
}
if (title === "security") {
return <>📒 {title}</>;
}
if (title === "vue") {
return <>📒 {title}</>;
}
if (title === "msa") {
return <>📒 {title}</>;
}
if (title === "k8s") {
return <>📒 {title}</>;
}
if (title === "docker") {
return <>📒 {title}</>;
}
if (title === "kafka") {
return <>📒 {title}</>;
}
if (title === "serialized data structure") {
return <>📒 {title}</>;
}
if (title === "webRTC") {
return <>📒 {title}</>;
}
if (title === "electron") {
return <>📒 {title}</>;
}
if (title === "etc") {
return <>📒 {title}</>;
}
if (type === "page") {
return <>↗️ {title}</>;
}
return <>📃 {title}</>;
},
},
useNextSeoProps() {
return {
titleTemplate: "%s - 신우섭의 도서관 v2",
};
},
};
export default config;