L
L
Leha2013-11-18 23:49:24
Node.js
Leha, 2013-11-18 23:49:24

Question about migrating from Jade template engine to Handlebars (Derby.js)

With the increasing complexity and features of the project, I decided to switch to Derby.js. To do this, you need to rewrite the templates from Jade (conveniently, IMHO) to the Handlebars dialect. The first difficulties:

There is a common template for all pages (view.jade):

head
  title MySiteName
  block head
body
  h1 SiteLogo
  block content
  block footer

For different pages, I extend it via "export" like (index.jade):

extends view

block head
  style(src='/css/common.css')
block content
  h1 IndexPage!!!
block footer
  h1 Author noname


As a result, the content of the blocks (block) in index.jade is inserted instead of the block descriptions in view.jade. Question: how to implement such a "layered" structure in Handlebars (Derby.js)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2014-08-30
@kleinmaximus

Also interesting!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question