Skip to content

atatos/node-handlebars-twig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-handlebars-twig

WIP

Transpile Handlebars templates to Twig templates

Rationale

In optimising initial rendering of SPAs we saw the need to duplicate small hbs templates into PHP Twig templates on the server. But since Handlebars core is made up of such a small feature set we figured we could be rigorous in writing simple hbs templates and then transpile those to twig templates.

Look at fixtures/$fixture/in.hbs vs out.twig to see what is run through the tests. Get started with contributing by cloning and running:

npm install
npm install -g mocha
mocha

WORK IN PROGRESS

This is very much WIP and most of the code looks like, and is, a hack. Use at your own risk.

TODO

  • helpers
  • if-else
  • each-else
  • if
  • unless
  • each
    • @index
    • @key
    • basic scoping
  • variables
  • content

About

Transpile Handlebars templates to Twig templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published