bminer / node-blade

Blade - HTML Template Compiler, inspired by Jade & Haml
Other
320 stars 28 forks source link

Can't dynamically include() object values #158

Closed braco closed 11 years ago

braco commented 11 years ago
block something
  p something
  include locals.foo

yields:

500 SyntaxError: Parser error: Expected child node or newline but "." found. at 

This would also be nice to have:

include "../" + locals.foo
bminer commented 11 years ago

The problem here is that it would be difficult for the parser to detect the exposing keyword that follows the filename. Therefore, allowing things like include "../" + locals.foo would be a little too loose.

There are obvious workarounds like defining a variable just before the file include:

- var filename = //whatever you want
include filename

Closing this issue for now.

bminer commented 11 years ago

Decided to allow Object properties separated by the period . Commit coming soon...