Skip to content

Commit 1f95235

Browse files
committed
Add per_page parameter to the fetch function to get more than 30 posts
1 parent 7260e16 commit 1f95235

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/blog/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export default function Blog({ posts }) {
4848
}
4949

5050
export async function getStaticProps() {
51-
const res = await fetch('https://dev.to/api/articles?username=wdp');
51+
const PER_PAGE = 1000
52+
const res = await fetch(`https://dev.to/api/articles?username=wdp&per_page=${PER_PAGE}`);
5253
const posts = await res.json();
5354

5455
return {

0 commit comments

Comments
 (0)