Skip to content

Instantly share code, notes, and snippets.

@tbusser
Created November 4, 2014 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbusser/8bf18dc0ccc46110304b to your computer and use it in GitHub Desktop.
Save tbusser/8bf18dc0ccc46110304b to your computer and use it in GitHub Desktop.
DocPad config for faster regeneration and Grunt integration for static builds
# 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