Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-parag committed Jun 18, 2020
0 parents commit f451968
Show file tree
Hide file tree
Showing 23 changed files with 13,804 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
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*
11 changes: 11 additions & 0 deletions README.md
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.
42 changes: 42 additions & 0 deletions components/Header.js
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>
</>
)
}
72 changes: 72 additions & 0 deletions components/Layout.js
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>
</>
)
}
24 changes: 24 additions & 0 deletions components/PostList.js
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>
)
}
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@components/*": ["components/*"],
"@utils/*": ["utils/*"]
}
}
}
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
command = "npm run build && npm run export"
publish = "out"
10 changes: 10 additions & 0 deletions next.config.js
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
},
}
Loading

0 comments on commit f451968

Please sign in to comment.