sitemap-manager

An easy way to create sitemaps!

Usage no npm install needed!

<script type="module">
  import sitemapManager from 'https://cdn.skypack.dev/sitemap-manager';
</script>

README

sitemap-manager

An easy way to create sitemaps!

Features

  • Easy to use ๐Ÿ˜ฒ
  • Work fast ๐Ÿš€
  • Xml with xsl. For search engines or for human visions? Don't choose, for both! ๐Ÿฅณ
  • Put different pages into different sitemaps. ๐Ÿงบ

Usage

Step 1. Install sitemap-manager.

// For npm users
npm install sitemap-manager --save

// For yarn users
yarn add sitemap-manager

Step2. Import sitemap-manager

const { SitemapManager } = require('sitemap-manager')
// or
import { SitemapManager } from 'sitemap-manager'

Step3. "New" a class

const MySitemap = new SitemapManager({
    /* Options here */
    siteURL: ''/*URL*/,
    pathPrefix: ''/*Site Prefix*/,
    outDir: ''/*Output dir*/,
})

Step4. Add urls

MySitemap.addUrl(/*Category name here*/, [
    { loc: ''/*URL*/, lastmod: ''||new Date()/*Last modification time*/, changefreq: ''||1-7/*Change frequence*/, priority: 0.0-1.0 /*Priority*/ },
    /*You can add more!*/
])

Step5. Finish!

MySitemap.finish().then(()=>{/*sth here*/}).catch((e)=>{/*sth here*/})

Check Wiki for more information.

LICENSE

MIT