metalsmith-i18next-sitemap
v1.0.0
Published
Builds an appropriate sitemap for sites localized with i18next
Downloads
3
Readme
Metalsmith i18next Sitemap
A very simple Metalsmith plugin that will produce a sitemap that supports i18next localization.
Installation
npm install --save-dev metalsmith-i18next-sitemap
Usage
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
filename
is the output filename, default: sitemap.xmllastmod
lets you override the lastmod time in ISO formatpattern
is the glob pattern for matching files to process, default: **/*.htmlpriority
allows overriding the default priority, default: 0.5changefreq
sets the change frequency, default: weeklyremove_index
removes index.html from urls, default: truelocales
an array of your supported locales, eg: [ 'en', 'es' ]
License
The MIT License (MIT)
Thanks
This plugin was developed at Oportun, Inc.