TryGhost / gatsby-plugin-advanced-sitemap

Advanced XML Sitemaps for Gatsby.js
MIT License
150 stars 0 forks source link

Showing Undefined url path in sitemaps #259

Open nirajtrt opened 1 year ago

nirajtrt commented 1 year ago

We are using this plugin from last 2 years, from last month it showing undefined URL path in sitemap. We are facing same issue.

Issue Summary

A summary of the issue and the browser/OS environment in which it occurs.

To Reproduce

  1. visit : https://gatsby.ghost.org/sitemap-posts.xml

Technical details:

mapping: { // Each data type can be mapped to a predefined sitemap // Routes can be grouped in one of: posts, tags, authors, pages, or a custom name // The default sitemap - if none is passed - will be pages posts: { sitemap:posts, }, pages: { sitemap:pages, }, tags: { sitemap:tags`, serializer: (edges) => { // console.info('edges => ',edges);

          return edges.map(({ node }) => {
            // console.info('tags node =>', node);
            return {
              node: {
                id: node.id,
                slug: _.kebabCase(node.name),
                path: `/tag/${_.kebabCase(node.name)}`,
              }
            }
          }).filter(edge => edge);
        },
      },
      author: {
        sitemap: `author`,
        serializer: (edges) => {
          // console.info('author edges => ',edges);

          const data =  edges.map(({ node }) => {
            return {
              node: {
                id: node.id,
                slug: _.kebabCase(node.name),
                path: `/author/${_.kebabCase(node.name)}/`,
              }
            }
          }).filter(edge => edge);
          console.info('***********author*********** => ',data);

          return data;
        },
      },
      career: {
        sitemap: `career`,
      },
      ebooks: {
        sitemap: `ebooks`,
        serializer: () => BOOKS,
      }
    },`