
Sitemap generator plugin for Assemble
From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:
npm install assemble-sitemap --save
Once that's done, just add sitemap, the name of this module, to the plugins option in the Assemble task:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
assemble: {
options: {
plugins: ['sitemap']
},
...
}
});
grunt.loadNpmTasks('assemble');
grunt.registerTask('default', ['assemble']);
};
If everything was installed and configured correctly, you should be ready to go!
See sitemaps.orghttp://www.sitemaps.org/protocol.html#xmlTagDefinitions) for detail XML tag definitions.
Type: String
Default: homepage (from package.json)
Site URL
Type: String
Default: weekly
How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Valid values are:
Type: String
Default: weekly
The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. This value does not affect how your pages are compared to pages on other sites—it only lets the search engines know which pages you deem most important for the crawlers.
Type: Array
Default: ['404']
Page to omit from the sitemap.
options: {
permalinks: {
exclusions: ["foo", "bar"],
},
files: {
...
}
}
To simplify might do something like:
assemble: {
blog: {
options: {
plugins: ['sitemap'],
},
files: {
'./blog/': ['./templates/blog/*.hbs']
}
}
}
assemble: {
blog: {
options: {
plugins: ['sitemap'],
sitemap: {
homepage: 'http://assemble.io',
changefreq: 'daily',
priority: '0.8'
}
},
files: {
'./blog/': ['./templates/blog/*.hbs']
}
}
}
### Result
```js
./blog/sitemap.xml
We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involed please see the Contributing to assemble-sitemap guide for information on contributing to this project.
Hariadi Hinta
Copyright (c) 2013 Hariadi Hinta, contributors. Released under the MIT license
This file was generated on Wednesday, October 16, 2013.