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 |
|
16 | From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
|
17 |
|
18 | ```bash
|
19 | npm install assemble-contrib-sitemap --save
|
20 | ```
|
21 |
|
22 | Once that's done, just add `assemble-contrib-sitemap`, the name of this module, to the `plugins` option in the Assemble task:
|
23 |
|
24 | ```js
|
25 | module.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 |
|
41 | If 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
|
49 | See [sitemaps.org](http://www.sitemaps.org/protocol.html#xmlTagDefinitions) for detail XML tag definitions.
|
50 |
|
51 | #### dest
|
52 | Type: `String`
|
53 | Default: `assemble.pages`
|
54 |
|
55 | Sitemap destination. If not set, fallback to assemble destination.
|
56 |
|
57 | ### homepage
|
58 | Type: `String`
|
59 | Default: `homepage` (from package.json)
|
60 |
|
61 | Site URL
|
62 |
|
63 | ### changefreq
|
64 | Type: `String`
|
65 | Default: `weekly`
|
66 |
|
67 | 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:
|
68 |
|
69 | - always
|
70 | - hourly
|
71 | - daily
|
72 | - weekly
|
73 | - monthly
|
74 | - yearly
|
75 | - never
|
76 |
|
77 | ### priority
|
78 | Type: `String`
|
79 | Default: `weekly`
|
80 |
|
81 | 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.
|
82 |
|
83 | ### exclusions
|
84 | Type: `Array`
|
85 | Default: `['404']`
|
86 |
|
87 | Page to omit from the sitemap.
|
88 |
|
89 | ```js
|
90 | options: {
|
91 | sitemap: {
|
92 | exclusions: ["foo", "bar"],
|
93 | },
|
94 | files: {
|
95 | ...
|
96 | }
|
97 | }
|
98 | ```
|
99 |
|
100 | #### robot
|
101 | Type: `Boolean`
|
102 | Default: `true`
|
103 |
|
104 | Generate robots.txt from `exclusions` list.
|
105 |
|
106 |
|
107 | ## Usage Examples
|
108 | ### Simple
|
109 |
|
110 | To simplify might do something like:
|
111 |
|
112 | ```js
|
113 | assemble: {
|
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
|
136 | assemble: {
|
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
|
164 | 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-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
|
174 | Copyright (c) 2014 Hariadi Hinta, contributors.
|
175 | Released under the license
|
176 |
|
177 | ***
|
178 |
|
179 | _This file was generated on Saturday, February 22, 2014._ |
\ | No newline at end of file |