SiteMapPlugin

The SiteMapPlugin generates a sitemap using the pages in the Mosaic filesystem that adheres to the sitemaps XML schema.

The output of the plugin is a file is named /sitemap.xml.

Priority

This plugin runs with no special priority.

Options

PropertyDescription
siteUrlThe site URL. Used as the prefix for loc entries in the sitemap as these must start with a protocol
excludeOptional array of glob patterns to omit from the sitemap. Matching records remain available to other plugins. Defaults to [].

Adding to Mosaic

Add the following to the plugins collection:

plugins: [
  {
    modulePath: '@jpmorganchase/mosaic-plugins/SiteMapPlugin',
    previewDisabled: true,
    options: { siteUrl: process.env.SITE_URL || 'http://localhost:3000' }
  }
  // other plugins
];

For a site that combines documentation with internal release data, exclude the data source's prefix without removing it from the Mosaic filesystem:

options: {
  siteUrl: 'https://www.saltdesignsystem.com',
  exclude: ['**/salt-github/**']
}

These patterns apply to source filesystem paths. The plugin also respects the site's existing ignorePages rules.

Visualiser

To visualise your sitemap you can combine this plugin with the Sitemap component provided by @jpmorganchase/mosaic-sitemap-component.

Rendering the Sitemap component will render a tree view of your sitemap.

<Sitemap />

Have a look at this site's pages, here.

Mosaic BETA

Coming soon