Skip to content

Conversation

@t-jindai
Copy link
Contributor

@t-jindai t-jindai commented Mar 2, 2019

Description

Now gatsby-plugin-sitemap can not create sitemap index.
This PR allow us to create it by passing additional option to that plugin.

Also this plugin did not have any tests so I added them.

Related Issues

#12100

Details

// In your gatsby-config.js
siteMetadata: {
  siteUrl: `https://www.example.com`,
},
plugins: [
  {
    resolve: `gatsby-plugin-sitemap`,
    options: {
      sitemapSize: 5000
    }
  }
]

Above is the minimal configuration to split large sitemap.
When number of URL in sitemap is more than 5000 plugin will create sitemap (e.g. sitemap-0.xml, sitemap-1.xml) and index (e.g. sitemap.xml) files.

@t-jindai t-jindai self-assigned this Mar 3, 2019
@t-jindai t-jindai requested a review from pieh March 4, 2019 00:56
@t-jindai
Copy link
Contributor Author

t-jindai commented Mar 4, 2019

@pieh I assigned you as reviewer 🙇 because github suggested that you reviewed these file recently... I did not know what to do after making PR ( assigned someone as reviewer by myself or just wait).

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments. This looks pretty great. Big projects will benefit from this!

@wardpeet
Copy link
Contributor

wardpeet commented Mar 4, 2019

I also tested the plugin and works!

@wardpeet wardpeet added the status: awaiting author response Additional information has been requested from the author label Mar 4, 2019
@t-jindai
Copy link
Contributor Author

t-jindai commented Mar 5, 2019

@wardpeet Thanks for your review 👍 I have one question !

#12239 (comment)

@t-jindai t-jindai added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response and removed status: awaiting author response Additional information has been requested from the author labels Mar 5, 2019
@wardpeet wardpeet added status: awaiting author response Additional information has been requested from the author and removed status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response labels Mar 7, 2019
@t-jindai t-jindai added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response and removed status: awaiting author response Additional information has been requested from the author labels Mar 8, 2019
@wardpeet
Copy link
Contributor

Works like a charm, thank you!

@wardpeet wardpeet merged commit 55baf48 into gatsbyjs:master Mar 11, 2019
@t-jindai t-jindai deleted the topics/gatsby-plugin-sitemap-options branch March 11, 2019 22:34
@sidharthachatterjee
Copy link
Contributor

Published in [email protected]

},
} = queryRecords
return new Promise(resolve => {
// sitemapv-index.xml is default file name. (https://git.io/fhNgG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// sitemapv-index.xml is default file name. (https://git.io/fhNgG)
// sitemap-index.xml is default file name. (https://git.io/fhNgG)

sitemapv-index -> sitemap-index?

Copy link
Contributor

@wardpeet wardpeet Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muescha it's already merged, could you add a new pr? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done -> #12512

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muescha @wardpeet Thanks for that 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants