Skip to content

Commit

Permalink
Add Netlify support
Browse files Browse the repository at this point in the history
  • Loading branch information
matjack1 committed Jul 30, 2020
1 parent 5234052 commit d39aa3d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
.now
.next
node_modules/
node_modules/
out/
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
publish = "out"
command = "yarn export"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
"start": "next start",
"export": "next build && next export"
},
"dependencies": {
"classnames": "2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion pages/posts/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ export async function getStaticPaths() {
const allPosts = await getAllPostsWithSlug()
return {
paths: allPosts?.map(post => `/posts/${post.slug}`) || [],
fallback: true,
fallback: false,
}
}

0 comments on commit d39aa3d

Please sign in to comment.