문제

Converting a project from django into a flask API backend + backbone.js frontend

It was nice to be able to do {% include %} options in the HTML in order to make it more modular, i.e. I was able to separate out a discrete navbar.html, base.html, etc.

Is there an easy way to recreate this same structure in the absence of a web framework and if I am just building a frontend in HTML / JS?

도움이 되었습니까?

해결책

There are a lot of options, try searching. I usually go with Mustache or Handlebars

다른 팁

If you were looking for something pretty lightweight, you could try this https://github.com/psychobunny/dcp.templates

It was modelled after PHP templating engines like Smarty / phpBB's, but without much complexity... great for abstracting template files.

Otherwise like Joseph said, Handlebars is the way to go!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top