diff --git a/.gitignore b/.gitignore index 2d635fe1..289bd7b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .env .now .next -node_modules/ \ No newline at end of file +node_modules/ +out/ \ No newline at end of file diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..d2f8b4fa --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] + publish = "out" + command = "yarn export" diff --git a/package.json b/package.json index 1debdb5d..10f80c66 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pages/posts/[slug].js b/pages/posts/[slug].js index bcfa6683..7565a17e 100644 --- a/pages/posts/[slug].js +++ b/pages/posts/[slug].js @@ -70,6 +70,6 @@ export async function getStaticPaths() { const allPosts = await getAllPostsWithSlug() return { paths: allPosts?.map(post => `/posts/${post.slug}`) || [], - fallback: true, + fallback: false, } }