Skip to content
Discussion options

You must be logged in to vote

My experience is return nothing :D

export async function getStaticPaths() {
  return {
    paths: [    ],
    fallback: true,
  };
}

Just that, this save tons of build time :D fallback: true, will do the rest
if you still want? Use array then map it.
You will need query list of post ID in database something like this

export async function getStaticPaths() {

const listID=queryDatabaseFunc.findIDs() // return [1,4,5,6,7,9]
const myListParam= listID.map(id=>{

return {params:{id}}
})

return {
paths: myListParam;
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Vince-vegas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants