Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit d6e6a79

Browse files
author
Greg Rickaby
authored
Merge pull request #15 from WebDevStudios/feature/14-isg
Enable ISR and revalidate every 60 seconds
2 parents 78792d5 + c7125a0 commit d6e6a79

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# next.js
1212
/.next/
1313
/out/
14+
.vercel
1415

1516
# production
1617
/build
@@ -34,4 +35,3 @@ yarn-error.log*
3435
.env.development.local
3536
.env.test.local
3637
.env.production.local
37-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Next.js WordPress Starter <!-- omit in toc -->
22

3-
WebdevStudios fork of the [official Next.js WordPress Example](https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress). Used as a starter for headless WordPress projects.
3+
WebDevStudios fork of the [official Next.js WordPress Example](https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress). Used as a starter for headless WordPress projects.
44

55
👉 https://nextjs-wordpress-starter.vercel.app
66

pages/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Index.propTypes = {
4545
export async function getStaticProps({preview = false}) {
4646
const allPosts = await getAllPostsForHome(preview)
4747
return {
48-
props: {allPosts, preview}
48+
props: {allPosts, preview},
49+
revalidate: 60
4950
}
5051
}

pages/posts/[slug].js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export async function getStaticProps({params, preview = false, previewData}) {
7676
preview,
7777
post: data.post,
7878
posts: data.posts
79-
}
79+
},
80+
revalidate: 60
8081
}
8182
}
8283

vercel.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 2,
3+
"builds": [
4+
{
5+
"use": "@vercel/next@canary",
6+
"src": "package.json"
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)