gatsby - Gatsby 插件站点地图不会为我的网站生成站点地图
问题描述
下面的代码不会生成我的 Gatsby 网站的站点地图。我使用 wordpress 作为我的 CMS。有什么建议我做错了吗?
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-sitemap`,
options: {
output: `./expatsitemap.xml/`,
exclude: [`/category/*`],
query: `
{
site {
siteMetadata {
siteUrl
}
}
allSitePage {
edges {
node {
path
}
}
}
}`,
serialize: ({ site, allSitePage }) =>
allSitePage.edges.map(edge => {
return {
url: site.siteMetadata.siteUrl + edge.node.path,
changefreq: `daily`,
priority: 0.7,
}
})
}
}
解决方案
您需要添加您的主域,host: "https://www.yourwebsite.com",
如options
推荐阅读
- c# - 如何使用 UDP C# 接收连续图像
- bluetooth - google home ble 规范在哪里?
- ios - NSInternalInconsistencyException 无法设置已完成任务的结果
- azure - APIM : 通过传递的订阅密钥查找组名
- java - 我有两个空指针尝试调用虚拟方法'void android.support.v7.widget.RecyclerView.setHasFixedSize(boolean)
- javascript - 这是使用 jQuery 显示/隐藏 div 和某个“id”的稳定方法还是我可以使用更好的方法?
- python - 在haskell中创建实现数组的函数
- javascript - 我可以通过图像标签从 S3 加载图像,但不能加载请求?
- javascript - vue.js cli 命令“npm run serve”如何工作
- c# - 从 Win32_QuickFixEngineering 获取 InstallDate