Skip to content

Commit

Permalink
move to next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
pducolin committed Jan 24, 2021
1 parent b81107b commit d62e2d8
Show file tree
Hide file tree
Showing 33 changed files with 1,972 additions and 12,129 deletions.
87 changes: 26 additions & 61 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm
# dependencies
/node_modules
/.pnp
.pnp.js

# Optional eslint cache
.eslintcache
# testing
/coverage

# Optional REPL history
.node_repl_history
# next.js
/.next/
/out/

# Output of 'npm pack'
*.tgz
# production
/build

# dotenv environment variable files
.env*
# misc
.DS_Store
*.pem

# gatsby files
.cache/
public
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Mac files
.DS_Store
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
# vercel
.vercel
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

22 changes: 0 additions & 22 deletions LICENSE

This file was deleted.

99 changes: 0 additions & 99 deletions README.md

This file was deleted.

18 changes: 18 additions & 0 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Link from "next/link";

export default function Header() {
return (
<>
<header className="header">
<nav className="nav">
<Link href="/">
<a>My Blog</a>
</Link>
<Link href="/about">
<a>About</a>
</Link>
</nav>
</header>
</>
);
}
18 changes: 18 additions & 0 deletions components/Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Head from "next/head";
import Header from "@components/Header";

export default function Layout({ children, pageTitle, ...props }) {
return (
<>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{pageTitle}</title>
</Head>
<section className="layout">
<Header />
<div className="content">{children}</div>
</section>
<footer>Built by me!</footer>
</>
);
}
23 changes: 23 additions & 0 deletions components/PostList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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}>
<Link href={{ pathname: `/post/${post.slug}` }}>
<a>{post.frontmatter.title}</a>
</Link>
</li>
);
})}
</ul>
</div>
);
}
7 changes: 0 additions & 7 deletions gatsby-browser.js

This file was deleted.

34 changes: 0 additions & 34 deletions gatsby-config.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-node.js

This file was deleted.

7 changes: 0 additions & 7 deletions gatsby-ssr.js

This file was deleted.

8 changes: 8 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@components/*": ["components/*"]
}
}
}
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
command = "yarn run build && yarn 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 d62e2d8

Please sign in to comment.