1.0.0 • Published 8 years ago
metalsmith-i18next-sitemap v1.0.0
Metalsmith i18next Sitemap
A very simple Metalsmith plugin that will produce a sitemap that supports i18next localization.
Installation
npm install --save-dev metalsmith-i18next-sitemapUsage
JavaScript
const sitemap = require( 'metalsmith-i18next-sitemap' );
Metalsmith( __dirname )
.use( sitemap( {
pattern: '**/*.html', // default file pattern to process for include directives
locales: [ 'en', 'es' ] // an array of locales you are supporting
} ) )
.build( error => {
if ( error ) {
console.error( error )
}
} );metalsmith.json
{
"plugins": {
"metalsmith-i18next-sitemap": {
"pattern": "**/*.html",
"locales": [ "en", "es" ]
}
}
}Options
filenameis the output filename, default: sitemap.xmllastmodlets you override the lastmod time in ISO formatpatternis the glob pattern for matching files to process, default: */.htmlpriorityallows overriding the default priority, default: 0.5changefreqsets the change frequency, default: weeklyremove_indexremoves index.html from urls, default: truelocalesan array of your supported locales, eg: 'en', 'es'
License
The MIT License (MIT)
Thanks
This plugin was developed at Oportun, Inc.
1.0.0
8 years ago