Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improved coffeekup templating by adding helpers

  • Loading branch information...
commit 204d9b1b4d927b35144ede83c6da4ada3d3626bf 1 parent b048519
@kadirpekel authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/coffeemate.coffee
View
9 lib/coffeemate.coffee
@@ -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.
#
Please sign in to comment.
Something went wrong with that request. Please try again.