-
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
0 parents
commit f451968
Showing
23 changed files
with
13,804 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
.next | ||
.env | ||
.env.build | ||
node_modules/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,11 @@ | ||
# Notes | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
Posts are markdown files in the `posts` directory. |
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,42 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Header() { | ||
return ( | ||
<> | ||
<header className="header"> | ||
<nav className="nav" role="navigation" aria-label="main navigation"> | ||
<Link href="/"> | ||
<a>Demo Blog</a> | ||
</Link> | ||
<Link href="/about"> | ||
<a>About</a> | ||
</Link> | ||
</nav> | ||
</header> | ||
<style jsx>{` | ||
header { | ||
width: 100%; | ||
height: 100px; | ||
border-bottom: 1px solid #eaeaea; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
nav { | ||
width: calc(100% - 40px); | ||
max-width: 1200px; | ||
font-weight: bold; | ||
font-size: 1.3rem; | ||
} | ||
nav a { | ||
margin-right: 20px; | ||
color: #00a395; | ||
text-decoration: none; | ||
} | ||
nav a:hover { | ||
text-decoration: underline; | ||
} | ||
`}</style> | ||
</> | ||
) | ||
} |
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,72 @@ | ||
import Head from 'next/head' | ||
|
||
import Header from './Header' | ||
|
||
export default function Layout({ children, pageTitle, description, ...props }) { | ||
return ( | ||
<> | ||
<Head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta charSet="utf-8" /> | ||
<meta name="Description" content={description}></meta> | ||
<title>{pageTitle}</title> | ||
</Head> | ||
<style jsx global>{` | ||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;800;900&display=swap'); | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', | ||
Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', | ||
sans-serif; | ||
color: #445566; | ||
} | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-weight: bold; | ||
} | ||
a { | ||
color: #00a395; | ||
} | ||
.content { | ||
padding: 2rem 20px; | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
footer { | ||
width: 100%; | ||
height: 100px; | ||
border-top: 1px solid #eaeaea; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
footer img { | ||
padding: 0 5px; | ||
height: 1rem; | ||
} | ||
`}</style> | ||
<section className="layout"> | ||
<Header /> | ||
<div className="content">{children}</div> | ||
</section> | ||
<footer> | ||
Built with <img src="/netliheart.svg" alt="Netlify Heart" /> for you | ||
</footer> | ||
</> | ||
) | ||
} |
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,24 @@ | ||
import Link from 'next/link' | ||
|
||
export default function PostList({ posts }) { | ||
if (posts === 'undefined') return null | ||
|
||
return ( | ||
<div> | ||
{!posts && <div>No posts!</div>} | ||
<ul> | ||
{posts && | ||
posts.map((post) => { | ||
return ( | ||
<li key={post.slug}> | ||
{post.frontmatter.date}: {` `} | ||
<Link href={{ pathname: `/post/${post.slug}` }}> | ||
<a>{post?.frontmatter?.title}</a> | ||
</Link> | ||
</li> | ||
) | ||
})} | ||
</ul> | ||
</div> | ||
) | ||
} |
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,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"paths": { | ||
"@components/*": ["components/*"], | ||
"@utils/*": ["utils/*"] | ||
} | ||
} | ||
} |
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,3 @@ | ||
[build] | ||
command = "npm run build && npm run export" | ||
publish = "out" |
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,10 @@ | ||
module.exports = { | ||
target: 'serverless', | ||
webpack: function (config) { | ||
config.module.rules.push({ | ||
test: /\.md$/, | ||
use: 'raw-loader', | ||
}) | ||
return config | ||
}, | ||
} |
Oops, something went wrong.