Created
November 4, 2014 10:52
-
-
Save tbusser/8bf18dc0ccc46110304b to your computer and use it in GitHub Desktop.
DocPad config for faster regeneration and Grunt integration for static builds
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
# DocPad Configuration File | |
# http://docpad.org/docs/config | |
# Define the DocPad Configuration | |
docpadConfig = { | |
events: | |
generateAfter: (opts, next) -> | |
if 'static' in @docpad.getEnvironments() | |
@docpad.log('info', 'generateAfter: starting grunt task generateAfter') | |
safeps = require('safeps') | |
rootPath = @docpad.getConfig().rootPath | |
command = ['grunt', 'generateAfter'] | |
safeps.spawn(command, {cwd: rootPath, output: true}, next) | |
else | |
return next() | |
generateBefore: (opts, next) -> | |
if 'static' in @docpad.getEnvironments() | |
@docpad.log('info', 'generateBefore: starting grunt task generateBefore') | |
safeps = require('safeps') | |
rootPath = @docpad.getConfig().rootPath | |
command = ['grunt', 'generateBefore'] | |
safeps.spawn(command, {cwd: rootPath, output: true}, next) | |
else | |
return next() | |
templateData: | |
baseUrl: '' | |
staticTarget: 0 | |
environments: | |
static: | |
outPath: 'dist' | |
templateData: | |
baseUrl: '' | |
staticTarget: 1 | |
port: 1339 | |
regenerateDelay: 0 | |
watchOptions: | |
catchupDelay: 0 | |
} | |
# Export the DocPad Configuration | |
module.exports = docpadConfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment