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.
This plugin runs with no special priority.
| Property | Description |
|---|---|
| siteUrl | The site URL. Used as the prefix for loc entries in the sitemap as these must start with a protocol |
| exclude | Optional array of glob patterns to omit from the sitemap. Matching records remain available to other plugins. Defaults to []. |
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.
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.