Repository navigation
Expand file tree
/
Copy paththeme.config.tsx
More file actions
126 lines (120 loc) · 3.61 KB
/
Copy paththeme.config.tsx
File metadata and controls
126 lines (120 loc) · 3.61 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import React from 'react';
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import { useRouter } from 'next/router';
import { Thumbnail, Author, Comments } from './components';
const config: DocsThemeConfig = {
toc: {
title: '목차',
},
editLink: { text: 'GitHub에서 수정하기' },
feedback: {
content: <span>문서에 대한 피드백을 남겨주세요.</span>,
},
sidebar: {
defaultMenuCollapseLevel: 1,
titleComponent({ title, type }) {
if (type === 'separator') {
return (
<div className='flex items-center gap-2 text-neutral-400 dark:text-neutral-500 font-normal'>
{title}
<div className='h-0 flex-1 border-t-[0.5px] border-neutral-500' />
</div>
);
}
return <>{title}</>;
},
},
search: {
placeholder: '검색...',
},
logo: (
<div className='flex items-center gap-2'>
<img
src='/icons/logo_black.png'
alt='프로필 이미지'
className='h-5 object-cover dark:hidden'
/>
<img
src='/icons/logo_white.png'
alt='프로필 이미지'
className='hidden h-5 object-cover dark:block'
/>
<h2 className='font-bold text-xl'>스터디 그룹</h2>
</div>
),
project: {
link: 'https://github.com/refactor-study',
},
docsRepositoryBase:
'https://github.com/Refactor-Study/refactor-javascript-deep-dive/tree/main',
footer: {
text: '2024 © 이호연 All rights reserved.',
},
main: ({ children }) => {
const { frontMatter } = useConfig();
return (
<>
{frontMatter?.title && (
<h1 className='nx-mt-2 nx-text-4xl nx-font-bold nx-tracking-tight nx-text-slate-900 dark:nx-text-slate-100'>
{frontMatter.title}
</h1>
)}
{frontMatter?.date && (
<Author date={frontMatter.date} author={frontMatter.author} />
)}
{frontMatter?.image && <Thumbnail src={frontMatter.image} />}
{children}
<Comments />
</>
);
},
useNextSeoProps() {
return {
titleTemplate: '%s - Refactor; 스터디 그룹',
};
},
head: () => {
const { route } = useRouter();
const { frontMatter, title } = useConfig();
const imageUrl = new URL('https://ho991217.vercel.app');
if (!/\/index\.+/.test(route)) {
imageUrl.searchParams.set('title', title || frontMatter.title);
}
const ogTitle = title
? `${title} – Refactor; 스터디 그룹`
: `Refactor; 스터디 그룹`;
const ogDescription =
frontMatter.description || 'Refactor; 스터디 그룹입니다.';
const ogImage = frontMatter.image || '/images/og.png';
return (
<>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta name='description' content={ogDescription} />
<meta name='og:type' content='website' />
<meta name='twitter:image' content={ogImage} />
<meta property='og:title' content={ogTitle} />
<meta property='og:description' content={ogDescription} />
<meta property='og:image' content={ogImage} />
<link
rel='apple-touch-icon'
sizes='180x180'
href='/favicon/apple-touch-icon.png'
/>
<link
rel='icon'
type='image/png'
sizes='32x32'
href='/favicon/favicon-32x32.png'
/>
<link
rel='icon'
type='image/png'
sizes='16x16'
href='/favicon/favicon-16x16.png'
/>
<link rel='manifest' href='/favicon/site.webmanifest' />
</>
);
},
};
export default config;