forked from qunitjs/qunitjs.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
30 lines (25 loc) · 804 Bytes
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-jquery-content" );
grunt.initConfig({
"build-posts": {
page: "pages/**"
},
"build-resources": {
all: "resources/**"
},
wordpress: (function() {
var config = require( "./config" );
config.dir = "dist/wordpress";
return config;
})()
});
// Inserts markup to put ToC in sidebar
grunt.registerTask( "generate-columns", function() {
var upgradeGuide = "dist/wordpress/posts/page/upgrade-guide-2.x.html",
content = grunt.file.read( upgradeGuide )
.replace( /(<\/script>)/, "$1\n<div class=\"four columns\">" )
.replace( /(<h2)/, "</div>\n<div class=\"eight columns\">\n$1" );
grunt.file.write( upgradeGuide, content );
});
grunt.registerTask( "build", [ "build-posts", "generate-columns", "build-resources" ] );
};