Skip to content

Commit fb3f6a7

Browse files
committed
Merge branch 'pr/1'
2 parents 7923b55 + 24b903a commit fb3f6a7

File tree

9 files changed

+192
-4091
lines changed

9 files changed

+192
-4091
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
npm-debug.log*
2727
yarn-debug.log*
2828
yarn-error.log*
29+
yarn.lock
2930

3031
# local env files
3132
.env

components/NotionPage.tsx

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as React from 'react'
22
import dynamic from 'next/dynamic'
33
import Image from 'next/image'
4-
import Link from 'next/link'
4+
//import Link from 'next/link'
55
import { useRouter } from 'next/router'
66

77
import cs from 'classnames'
88
import { PageBlock } from 'notion-types'
9-
import { formatDate, getBlockTitle, getPageProperty } from 'notion-utils'
9+
//import { formatDate, getBlockTitle, getPageProperty } from 'notion-utils'
1010
import BodyClassName from 'react-body-classname'
1111
import { NotionRenderer } from 'react-notion-x'
1212
import TweetEmbed from 'react-tweet-embed'
@@ -19,13 +19,15 @@ import { getCanonicalPageUrl, mapPageUrl } from '@/lib/map-page-url'
1919
import { searchNotion } from '@/lib/search-notion'
2020
import { useDarkMode } from '@/lib/use-dark-mode'
2121

22-
import { Footer } from './Footer'
23-
import { GitHubShareButton } from './GitHubShareButton'
22+
// components
2423
import { Loading } from './Loading'
25-
import { NotionPageHeader } from './NotionPageHeader'
2624
import { Page404 } from './Page404'
27-
import { PageAside } from './PageAside'
2825
import { PageHead } from './PageHead'
26+
// import { PageAside } from './PageAside'
27+
import { Footer } from './Footer'
28+
import { NotionPageHeader } from './NotionPageHeader'
29+
// import { GitHubShareButton } from './GitHubShareButton'
30+
2931
import styles from './styles.module.css'
3032

3133
// -----------------------------------------------------------------------------
@@ -151,6 +153,21 @@ export const NotionPage: React.FC<types.PageProps> = ({
151153
const router = useRouter()
152154
const lite = useSearchParam('lite')
153155

156+
React.useEffect(() => {
157+
const intro = document.getElementsByClassName(
158+
'notion-block-e2937a32ee344038bc1fb55c74a22d8f'
159+
)
160+
if (intro && intro.length > 0) intro[0].id = 'link-intro'
161+
const careers = document.getElementsByClassName(
162+
'notion-block-85f68c0cbfd44be5a0d85a3137a673de'
163+
)
164+
if (careers && careers.length > 0) careers[0].id = 'link-careers'
165+
const projects = document.getElementsByClassName(
166+
'notion-block-781d9405d3494e808dcdfc106dc8e46d'
167+
)
168+
if (projects && projects.length > 0) projects[0].id = 'link-projects'
169+
}, [])
170+
154171
const components = React.useMemo(
155172
() => ({
156173
nextImage: Image,
@@ -193,12 +210,12 @@ export const NotionPage: React.FC<types.PageProps> = ({
193210
const showTableOfContents = !!isBlogPost
194211
const minTableOfContentsItems = 3
195212

196-
const pageAside = React.useMemo(
197-
() => (
198-
<PageAside block={block} recordMap={recordMap} isBlogPost={isBlogPost} />
199-
),
200-
[block, recordMap, isBlogPost]
201-
)
213+
// const pageAside = React.useMemo(
214+
// () => (
215+
// <PageAside block={block} recordMap={recordMap} isBlogPost={isBlogPost} />
216+
// ),
217+
// [block, recordMap, isBlogPost]
218+
// )
202219

203220
const footer = React.useMemo(() => <Footer />, [])
204221

@@ -277,11 +294,11 @@ export const NotionPage: React.FC<types.PageProps> = ({
277294
mapPageUrl={siteMapPageUrl}
278295
mapImageUrl={mapImageUrl}
279296
searchNotion={config.isSearchEnabled ? searchNotion : null}
280-
pageAside={pageAside}
297+
// pageAside={pageAside}
281298
footer={footer}
282299
/>
283300

284-
<GitHubShareButton />
301+
{/* <GitHubShareButton /> */}
285302
</>
286303
)
287304
}

components/NotionPageHeader.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { isSearchEnabled, navigationLinks, navigationStyle } from '@/lib/config'
1010
import { useDarkMode } from '@/lib/use-dark-mode'
1111

1212
import styles from './styles.module.css'
13+
import Link from 'next/link'
1314

1415
const ToggleThemeButton = () => {
1516
const [hasMounted, setHasMounted] = React.useState(false)
@@ -50,7 +51,7 @@ export const NotionPageHeader: React.FC<{
5051
<div className='notion-nav-header-rhs breadcrumbs'>
5152
{navigationLinks
5253
?.map((link, index) => {
53-
if (!link.pageId && !link.url) {
54+
if (!link.pageId && !link.url && !link.id) {
5455
return null
5556
}
5657

@@ -64,7 +65,7 @@ export const NotionPageHeader: React.FC<{
6465
{link.title}
6566
</components.PageLink>
6667
)
67-
} else {
68+
} else if (link.url) {
6869
return (
6970
<components.Link
7071
href={link.url}
@@ -74,6 +75,17 @@ export const NotionPageHeader: React.FC<{
7475
{link.title}
7576
</components.Link>
7677
)
78+
} else {
79+
return (
80+
<span
81+
style={{ padding: 8 }}
82+
className={cs(styles.navLink, 'breadcrumb', 'button')}
83+
>
84+
<Link href={link.id} key={index} scroll={true}>
85+
{link.title}
86+
</Link>
87+
</span>
88+
)
7789
}
7890
})
7991
.filter(Boolean)}

components/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
.footer {
4747
width: 100%;
48+
height: 200px;
4849
max-width: 1100px;
4950
margin: auto auto 0;
5051
padding: 8px;

lib/site-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface NavigationLink {
3939
title: string
4040
pageId?: string
4141
url?: string
42+
id?: string
4243
}
4344

4445
export const siteConfig = (config: SiteConfig): SiteConfig => {

pages/_document.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class MyDocument extends Document {
77
render() {
88
return (
99
<IconContext.Provider value={{ style: { verticalAlign: 'middle' } }}>
10-
<Html lang='en'>
10+
<Html lang='ko' style={{ scrollBehavior: 'smooth' }}>
1111
<Head>
1212
<link rel='shortcut icon' href='/favicon.ico' />
1313
<link

site.config.ts

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@ import { siteConfig } from './lib/site-config'
22

33
export default siteConfig({
44
// the site's root Notion page (required)
5-
rootNotionPageId: '7875426197cf461698809def95960ebf',
5+
rootNotionPageId: '23932f24c7ea4071af83cd62f587b305',
66

77
// if you want to restrict pages to a single notion workspace (optional)
88
// (this should be a Notion ID; see the docs for how to extract this)
99
rootNotionSpaceId: null,
1010

1111
// basic site info (required)
12-
name: 'Next.js Notion Starter Kit',
13-
domain: 'nextjs-notion-starter-kit.transitivebullsh.it',
14-
author: 'Travis Fischer',
12+
name: '소프트웨어 엔지니어, 한창완',
13+
domain: 'about.1c1.dev',
14+
author: '1chang1',
1515

1616
// open graph metadata (optional)
17-
description: 'Example Next.js Notion Starter Kit Site',
17+
description: 'Software Engineer, 한창완의 이력서',
1818

1919
// social usernames (optional)
20+
2021
twitter: 'transitive_bs',
2122
github: 'transitive-bullshit',
2223
linkedin: 'fisch2',
2324
// mastodon: '#', // optional mastodon profile URL, provides link verification
25+
2426
// newsletter: '#', // optional newsletter URL
2527
// youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
2628

@@ -46,20 +48,38 @@ export default siteConfig({
4648
// '/foo': '067dd719a912471ea9a3ac10710e7fdf',
4749
// '/bar': '0be6efce9daf42688f65c76b89f8eb27'
4850
// }
49-
pageUrlOverrides: null,
51+
pageUrlOverrides: {
52+
'/careers-p2achai': '7a39a94e4e104d04ab14385f244e5613',
53+
'/careers-teamluckly': 'SW-12-6c60cc7c9b064bab9963598a1da21805',
54+
'/careers-teamrare': 'SW-12-93c0e513e98048209b20b117210959e4',
55+
'/careers-rokaf': '15-8cfb950730264881a2e90576617db4a6',
56+
'/careers-ajou': '0ddbb2fb30814fbdb1d6156f64839ca9',
57+
'/projects-teft': 'Teft-3796aad2db414f82a85569be93247268',
58+
'/projects-ojjam': 'f0f7beabb162475583cfe432179ae4a1',
59+
'/projects-mytypetest': 'd4dbb5d3300140e9a947598d11a4c07e',
60+
'/projects-stady': 'STADY-84595d1b794745baaa8fd2c79ad49ecf',
61+
'/projects-routelog': 'RouteLog-10d1892dc4c848dc998cc989a68bc2d9',
62+
'/projects-traffin': 'TRAFFIN-24971d0c6a8e470e8d05ac7ed12327d4',
63+
'/projects-hyowonlife': '750da52c857648978e315f5d11c00daf',
64+
'/projects-tothesky': 'toTheSky-1b33457e15fa4ba3851eb685f2edbfac'
65+
},
5066

5167
// whether to use the default notion navigation style or a custom one with links to
5268
// important pages
53-
navigationStyle: 'default'
54-
// navigationStyle: 'custom',
55-
// navigationLinks: [
56-
// {
57-
// title: 'About',
58-
// pageId: 'f1199d37579b41cbabfc0b5174f4256a'
59-
// },
60-
// {
61-
// title: 'Contact',
62-
// pageId: '6a29ebcb935a4f0689fe661ab5f3b8d1'
63-
// }
64-
// ]
69+
// navigationStyle: 'default',
70+
navigationStyle: 'custom',
71+
navigationLinks: [
72+
{
73+
title: 'Intro',
74+
id: '#link-intro'
75+
},
76+
{
77+
title: 'Careers',
78+
id: '#link-careers'
79+
},
80+
{
81+
title: 'Projects',
82+
id: '#link-projects'
83+
}
84+
]
6585
})

0 commit comments

Comments
 (0)