lgraubner / sitemap-generator

Easily create XML sitemaps for your website.
MIT License
413 stars 130 forks source link

Great tool! One small addition. #84

Closed mgifford closed 4 years ago

mgifford commented 4 years ago

I'd just add to the documentation that you need to create a file (say with the filename example_instructions) with:

const SitemapGenerator = require('sitemap-generator');

// create generator
const generator = SitemapGenerator('http://example.com', {
  stripQuerystring: false
});

// register event listeners
generator.on('done', () => {
  // sitemaps created
});

// start the crawler
generator.start();

Edit it to remove the http://example.com

Then execute it with: node example_instructions

Pretty simple addition, but speeds things up.

It's not as simple as some of those that allow you to specify all this from the command line without creating an example file, but your script seems to crawl more effectively than others I've tried.

lgraubner commented 4 years ago

I think the example is sufficient. If you just want to run it from the command line you could also use the CLI Version.

Having an example file could result in more support question as some people might not understand they have to replace example.com.