Gatsby插件Sitemap未为我的网站生成网站地图

3
以下代码未生成我的 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,
            }
          })
      }
    }
1个回答

0

您需要在选项中添加您的主域名,如host: "https://www.yourwebsite.com",


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接