Skip to content

Commit

Permalink
Scan templates directory for .eco files as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeni Kunev committed Feb 20, 2013
1 parent db03931 commit c0cf6ab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions eco-plus.coffee
Expand Up @@ -164,10 +164,14 @@ module.exports =
templates: (path) ->
templates = {}
findit.sync path, (f) ->
if f.endsWith('.html')
name = f.remove(path + '/').remove('.html')
src = fs.readFileSync(f, 'utf-8')
templates[name] = src
get_templates = (extension) ->
if f.endsWith(".#{extension}")
name = f.remove(path + '/').remove(".#{extension}")
src = fs.readFileSync(f, 'utf-8')
templates[name] = src

get_templates 'html'
get_templates 'eco'
templates

render_js: (templates, context) ->
Expand Down

0 comments on commit c0cf6ab

Please sign in to comment.