Permalink
Browse files

improved coffeekup templating by adding helpers

  • Loading branch information...
1 parent b048519 commit 204d9b1b4d927b35144ede83c6da4ada3d3626bf @kadirpekel committed Jun 20, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/coffeemate.coffee
View
@@ -100,9 +100,14 @@ class Coffeemate extends connect.HTTPServer
# sugarize coffeekup!
#
# @api public
- coffeekup: ->
+ coffeekup: (locals) ->
renderFunc = require('coffeekup').render
- @options.renderFunc = (tmpl, ctx) -> renderFunc tmpl, context: ctx
+
+ locals ?= {}
+ locals.include ?= (partialName) ->
+ text ck_options.context.include partialName
+
+ @options.renderFunc = (tmpl, ctx) -> renderFunc tmpl, context: ctx, locals: locals
# Build connect router middleware from internal route stack and automatically use it.
#

0 comments on commit 204d9b1

Please sign in to comment.