Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing Undefined url path in sitemaps #259

Open
nirajtrt opened this issue Aug 30, 2023 · 0 comments
Open

Showing Undefined url path in sitemaps #259

nirajtrt opened this issue Aug 30, 2023 · 0 comments

Comments

@nirajtrt
Copy link

nirajtrt commented Aug 30, 2023

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:

  • Gatsby Version: 5.11.0
  • Node Version: 18.0.0
  • OS: ubuntu
  • gatsby-config.js:

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,
      }
    },`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant