我刚建好一座房子文本.js&内容网站(amp;C)。有几个路线,需要生成时,人们点击网站,但它似乎没有生成所有的路线或不承认一些网页,除非我刷新。示例-我将一篇博客文章上传到contentful,它不会出现在博客文章列表中,但是当我更改一篇没有问题的博客的文本时,我将我的配置文件附在下面
generate: {
routes () {
return Promise.all([
client.getEntries({
'content_type': 'product'
}),
client.getEntries({
'content_type': 'kebaProduct'
}),
client.getEntries({
'content_type': 'blogPost'
}),
])
.then(([productEntries, kebaEntries, blogEntries]) => {
return [
...blogEntries.items.map(entry => `/blog/${entry.fields.slug}`),
...productEntries.items.map(entry => `/products/${entry.fields.slug}`),
...kebaEntries.items.map(entry => `/products/ev-charging/${entry.fields.slug}`),
]
})
}
当我在localhost上并且所有的产品路由都被生成和更新时,它工作得很好,当我运行时,只有一些“kebaProduct”路由被创建
npm run generate
. 不知道我错过了什么
注意,当我生成时,虽然我有5个“contentful上的kebaProducts”,但它只生成一个.html文件,不确定预期的行为是什么。