Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Last active August 29, 2015 14:01
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 ELLIOTTCABLE/27d822c6cc632a2f2226 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/27d822c6cc632a2f2226 to your computer and use it in GitHub Desktop.
{{#outer}}
123 456
{{/outer}}
abc def
{{yield}}
ghi jkl
nest_template = (template)-> -> (content, outer_render)->
view = Object.create this
view.yield = -> outer_render content
mustache.render template, view, templates
app = connect()
# ...
.use (i, o, next)->
# ...
view =
outer: nest_template templates.outer
o.setHeader 'Content-Type', 'text/html'
o.end mustache.render templates.landing, view, templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment