Created
October 14, 2013 07:47
-
-
Save ikikko/6972229 to your computer and use it in GitHub Desktop.
Markdown + LiveReload on Grunt
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
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