-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
189 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules/ | |
.cache/ | ||
public | ||
src/gatsby-types.d.ts | ||
.env | ||
.env | ||
.DS_Store |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,11 @@ const Layout = ({ children }: Props) => { | |
return ( | ||
<div style={pageStyles}> | ||
<GlobalStyles /> | ||
<div> | ||
<div | ||
css={css` | ||
scroll-padding-top: 10rem; | ||
`} | ||
> | ||
<header | ||
css={css` | ||
position: fixed; | ||
|
@@ -40,6 +44,7 @@ const Layout = ({ children }: Props) => { | |
padding: 2rem; | ||
box-shadow: rgba(17, 17, 26, 0.1) 0px 1px 0px; | ||
background-color: white; | ||
z-index: 10; | ||
`} | ||
> | ||
<div | ||
|
@@ -90,7 +95,15 @@ const Layout = ({ children }: Props) => { | |
</nav> | ||
</header> | ||
</div> | ||
<main>{children}</main> | ||
<main | ||
css={css` | ||
margin: 10rem 4rem; | ||
scroll-padding-top: 10rem; | ||
scroll-margin-top: 10rem; | ||
`} | ||
> | ||
{children} | ||
</main> | ||
<footer>{/* Add your footer content here */}</footer> | ||
</div> | ||
); | ||
|
@@ -101,11 +114,5 @@ export default Layout; | |
export const Head: HeadFC = () => ( | ||
<> | ||
<title>dev-wish.com</title> | ||
<link | ||
rel="stylesheet" | ||
as="style" | ||
crossOrigin="" | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.min.css" | ||
/> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as React from "react"; | ||
import { Global, css } from "@emotion/react"; | ||
import { Link, useStaticQuery, graphql, HeadFC } from "gatsby"; | ||
|
||
interface toc { | ||
title: string; | ||
url: string; | ||
items?: toc[]; | ||
} | ||
|
||
interface Props { | ||
tableOfContents: { | ||
items: toc[]; | ||
}; | ||
} | ||
|
||
const getSubItems = (items: toc[], depth: number) => { | ||
return items.map((item) => { | ||
return ( | ||
<div key={item.title}> | ||
<a href={item.url} key={item.title} css={css``}> | ||
<h3 | ||
css={css` | ||
font-size: 1.4rem; | ||
font-weight: 500; | ||
color: gray; | ||
padding-left: ${depth * 2}rem; | ||
`} | ||
> | ||
{item.title} | ||
</h3> | ||
</a> | ||
{item?.items && getSubItems(item?.items, depth + 1)} | ||
</div> | ||
); | ||
}); | ||
}; | ||
|
||
const Toc = ({ tableOfContents }: Props) => { | ||
return ( | ||
<aside | ||
css={css` | ||
font-size: 1.4rem; | ||
font-weight: 500; | ||
position: sticky; | ||
top: 10rem; | ||
align-self: flex-start; | ||
`} | ||
> | ||
{getSubItems(tableOfContents?.items, 0)} | ||
</aside> | ||
); | ||
}; | ||
|
||
export default Toc; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.