UNPKG

4.09 kBMarkdownView Raw
1# assemble-contrib-sitemap [![NPM version](https://badge.fury.io/js/assemble-contrib-sitemap.png)](http://badge.fury.io/js/assemble-contrib-sitemap) [![Build Status](https://travis-ci.org/assemble/assemble-contrib-sitemap.png)](https://travis-ci.org/assemble/assemble-contrib-sitemap)
2
3> Sitemap generator plugin for Assemble
4
5## Table of Contents
6* [Quickstart](#quickstart)
7* [Options](#options)
8* [Usage Examples](#usage-examples)
9* [Contributing](#contributing)
10* [Author](#author)
11* [License](#license)
12
13
14## Quickstart
15
16From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
17
18```bash
19npm install assemble-contrib-sitemap --save
20```
21
22Once that's done, just add `assemble-contrib-sitemap`, the name of this module, to the `plugins` option in the Assemble task:
23
24```js
25module.exports = function(grunt) {
26
27 // Project configuration.
28 grunt.initConfig({
29 assemble: {
30 options: {
31 plugins: ['assemble-contrib-sitemap']
32 },
33 ...
34 }
35 });
36 grunt.loadNpmTasks('assemble');
37 grunt.registerTask('default', ['assemble']);
38};
39```
40
41If everything was installed and configured correctly, you should be ready to go!
42
43[grunt]: http://gruntjs.com/
44[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
45[package.json]: https://npmjs.org/doc/json.html
46
47
48## Options
49See [sitemaps.org](http://www.sitemaps.org/protocol.html#xmlTagDefinitions) for detail XML tag definitions.
50
51#### dest
52Type: `String`
53Default: `assemble.pages`
54
55Sitemap destination. If not set, fallback to assemble destination.
56
57### homepage
58Type: `String`
59Default: `homepage` (from package.json)
60
61Site URL
62
63### changefreq
64Type: `String`
65Default: `weekly`
66
67How 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:
68
69 - always
70 - hourly
71 - daily
72 - weekly
73 - monthly
74 - yearly
75 - never
76
77### priority
78Type: `String`
79Default: `weekly`
80
81The 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.
82
83### exclusions
84Type: `Array`
85Default: `['404']`
86
87Page to omit from the sitemap.
88
89```js
90options: {
91 sitemap: {
92 exclusions: ["foo", "bar"],
93 },
94 files: {
95 ...
96 }
97}
98```
99
100#### robot
101Type: `Boolean`
102Default: `true`
103
104Generate robots.txt from `exclusions` list.
105
106
107## Usage Examples
108### Simple
109
110To simplify might do something like:
111
112```js
113assemble: {
114 blog: {
115 options: {
116 plugins: ['assemble-contrib-sitemap'],
117 },
118 files: {
119 './blog/': ['./templates/blog/*.hbs']
120 }
121 }
122}
123
124```
125
126### Result
127
128```js
129./blog/sitemap.xml
130./blog/robots.txt
131```
132
133### Advanced
134
135```js
136assemble: {
137 blog: {
138 options: {
139 plugins: ['assemble-contrib-sitemap'],
140 sitemap: {
141 homepage: 'http://assemble.io',
142 changefreq: 'daily',
143 priority: '0.8',
144 exclude: ['50x', 'foo'],
145 robot: false
146 }
147 },
148 files: {
149 './blog/': ['./templates/blog/*.hbs']
150 }
151 }
152}
153```
154
155### Result
156
157```js
158./blog/sitemap.xml
159```
160
161
162
163## Contributing
164We 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-contrib-sitemap](http://assemble.io/contributing/) guide for information on contributing to this project.
165
166## Author
167
168**Hariadi Hinta**
169
170+ [github.com/hariadi](https://github.com/hariadi)
171+ [twitter.com/hariadi](http://twitter.com/hariadi)
172
173## License
174Copyright (c) 2014 Hariadi Hinta, contributors.
175Released under the license
176
177***
178
179_This file was generated on Saturday, February 22, 2014._
\No newline at end of file