Created
May 30, 2014 11:42
-
-
Save samdbeckham/deb5e95040a91f44891b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Hello World!</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tmp/ | |
dev/ | |
- index.html | |
includes/ | |
- content.html | |
Gruntfile.js | |
package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.loadNpmTasks('grunt-processhtml'); | |
grunt.initConfig({ | |
connect: { | |
dev: { | |
options: { | |
port: 9000, | |
base: '.tmp', | |
keepalive: true | |
} | |
} | |
}, | |
processhtml: { | |
dev: { | |
options: { | |
includeBase: 'includes' | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'dev', | |
src: ['{,*/}*.html'], | |
dest: '.tmp' | |
}] | |
} | |
} | |
}); | |
grunt.registerTask('default', function() { | |
grunt.task.run([ | |
'processhtml:dev', | |
'connect:dev', | |
]) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Grunt Includes Test</title> | |
</head> | |
<body> | |
<!-- build:include content.html --> | |
This content will be replaced by the include | |
<!-- /build --> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "grunt-includes-example", | |
"version": "0.1.0", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-contrib-connect": "^0.7.1", | |
"grunt-processhtml": "^0.3.3", | |
"load-grunt-tasks": "^0.4.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment