Skip to content

Instantly share code, notes, and snippets.

@ikikko
Created October 14, 2013 07:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ikikko/6972229 to your computer and use it in GitHub Desktop.
Save ikikko/6972229 to your computer and use it in GitHub Desktop.
Markdown + LiveReload on Grunt
module.exports = function(grunt) {
grunt.initConfig({
markdown: {
all: {
files: [
{
expand: true,
src: ['**/*.md', '!node_modules/**/*.md'],
ext: '.html'
}
],
options: {
postCompile: function(src, context) {
return src + "<script src='http://localhost:35729/livereload.js'></script>\n";
},
}
}
},
watch:{
md: {
files: '**/*.md',
tasks: ['markdown'],
},
html: {
files: '**/*.html',
tasks: [],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask("default", ["markdown", "watch"]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment