koajs / koa-hbs

Handlebars templates for Koa.js
MIT License
160 stars 43 forks source link

support use of index.hbs for views #83

Open dwhieb opened 5 years ago

dwhieb commented 5 years ago

Assuming the following folder structure:

/views
  /home
    - index.hbs
    - home.css
  /contact
    - index.hbs
    - contact.css

It should be possible to render a view by calling context.render('home'). koa-hbs should look for an index.hbs file in the /home folder, and use that template if found.

Currently, it is only possible to render a view with the above folder structure by using context.render('home/index').