UNPKG

2.8 kBJavaScriptView Raw
1/*
2 * Assemble Plugin: Sitemap
3 * https://github.com/hariadi/assemble-sitemap
4 *
5 * Copyright (c) 2014 Hariadi Hinta, contributors
6 * Licensed under the MIT license.
7 */
8
9'use strict';
10
11module.exports = function(grunt) {
12
13 // Project configuration.
14 grunt.initConfig({
15
16 pkg: grunt.file.readJSON('package.json'),
17
18 jshint: {
19 options: {
20 curly: true,
21 eqeqeq: true,
22 immed: true,
23 latedef: true,
24 newcap: true,
25 noarg: true,
26 sub: true,
27 undef: true,
28 boss: true,
29 eqnull: true,
30 node: true
31 },
32 all: ['Gruntfile.js', 'sitemap.js']
33 },
34
35 assemble: {
36 options: {
37 plugins: ['./sitemap.js']
38 },
39 sitemap: {
40 files: [
41 {
42 expand: true,
43 cwd: 'test/fixtures/pages',
44 src: ['**/*.hbs'],
45 dest: 'test/actual/sitemap'
46 }
47 ]
48 },
49 sitemap_option: {
50 options: {
51 sitemap: {
52 homepage: 'http://assemble.io',
53 changefreq: 'daily',
54 priority: '0.8',
55 exclude: ['50x', 'foo'],
56 robot: false
57 }
58 },
59 files: [
60 {
61 expand: true,
62 cwd: 'test/fixtures/pages',
63 src: ['**/*.hbs'],
64 dest: 'test/actual/sitemap_option'
65 }
66 ]
67 },
68 sitemap_relative: {
69 options: {
70 sitemap: {
71 homepage: 'http://assemble.io',
72 changefreq: 'daily',
73 priority: '0.8',
74 exclude: ['50x', 'foo'],
75 robot: false,
76 relativedest: true
77 }
78 },
79 files: [
80 {
81 expand: true,
82 cwd: 'test/fixtures/pages',
83 src: ['**/*.hbs'],
84 dest: 'test/actual/sitemap_relative'
85 }
86 ]
87 },
88 sitemap_dest: {
89 options: {
90 sitemap: {
91 homepage: 'http://assemble.io',
92 exclude: ['**/articles/**'],
93 relativedest: true,
94 dest: 'test/actual/sitemap_dest'
95 }
96 },
97 files: [
98 {
99 expand: true,
100 cwd: 'test/fixtures/pages',
101 src: ['**/*.hbs'],
102 dest: 'test/actual/sitemap_dest'
103 }
104 ]
105 }
106 },
107
108 // Before generating new files, remove any files from previous build.
109 clean: {
110 actual: ['test/actual/**'],
111 }
112 });
113
114 // These plugins provide necessary tasks.
115 grunt.loadNpmTasks('grunt-contrib-clean');
116 grunt.loadNpmTasks('grunt-contrib-jshint');
117 grunt.loadNpmTasks('grunt-readme');
118 grunt.loadNpmTasks('assemble');
119
120 // By default, lint and run all tests.
121 grunt.registerTask('default', ['jshint', 'clean', 'assemble']);
122};