0.5.0 • Published 5 months ago

kerouac-sitemap v0.5.0

Weekly downloads
9
License
MIT
Repository
github
Last release
5 months ago

kerouac-sitemap

Kerouac middleware that generates sitemaps, informing search engines about pages that are available for crawling.

Install

$ npm install kerouac-sitemap

Usage

Declare a sitemap.xml route, using this middleware.

var sitemap = require('kerouac-sitemap');

site.page('/sitemap.xml', sitemap());

And map a sitemap.xml file when generating the site.

site.generate([
  sitemap.createMapper()
]);

Indexes

For a site that consists of multiple sections, each section can have its own sitemap with each sitemap listed in a sitemap index.

var sitemap = require('kerouac-sitemap');

var site = kerouac();

var docs = kerouac();
docs.page('/sitemap.xml', sitemap());

site.use('/docs', docs);
site.page('/sitemap.xml', sitemap());
site.page('/sitemap_index.xml', sitemap.index());

site.generate({
  '/docs': [
    sitemap.createMapper(),
  ],
  '/': [
    sitemap.createMapper({ index: true }),
  ],
});

License

The MIT License

Copyright (c) 2012-2022 Jared Hanson [https://www.jaredhanson.me/](https://www.jaredhanson.me/)

0.5.0

5 months ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

11 years ago

0.1.0

11 years ago