diff --git a/docpad.coffee b/docpad.coffee index 71a9597..7a1a56a 100755 --- a/docpad.coffee +++ b/docpad.coffee @@ -151,4 +151,34 @@ docpadConfig = { } # Export our DocPad Configuration +docpadConfig = { + # Template Data + templateData: + site: + title: "Docport InlineGUI" + url: "http://docport.io" + author: "Neil Taylor, Benjamin Lupton" + + # Collections + collections: + pages: -> + @getCollection('html').findAllLive({layout: $exists: true}) + + # Events + events: + serverExtend: (opts) -> + {server} = opts + docpad = @docpad + + # Create new page route + server.get '/create-page', (req, res) -> + layouts = docpad.getCollection('layouts').toJSON() + if layouts.length > 1 + res.send '
' + else + res.send 'Only one layout available, cannot select layout.' + return +} + +module.exports = docpadConfig module.exports = docpadConfig