K
K
Kote2016-08-22 12:52:32
HTML
Kote, 2016-08-22 12:52:32

HTML template engine for beginners: how to take the first steps?

Good afternoon, I'm interested in a step-by-step instruction for a teapot.
Yes: mac osx, installed in the Node console (for example) + nunjacks (seemed good for a start)
Task: I would like to have pieces of templates in my folders, and with the help of one or another template engine (the simplest one, I really need ikludes + variables) get the resulting compiled html file. When editing pieces - autocompilation of the resulting file.
Unfortunately, all I find on the net is stupidly inserting the js version of the template engine and building it on the fly in the browser - this does not suit me.
I'm with the console on "you" and have no idea how to use and where to start.
Can you help me write step by step with simple steps - how to make a couple of pieces of a template and accumulate them into 1 on a poppy osx?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Khokhlov, 2016-08-22
@andrhohlov

Understand Gulp
gulpjs.com
Then I recommend taking Jade as a templating engine
https://www.npmjs.com/package/gulp-jade
jade-lang.com
Or Handlebars
handlebarsjs.com
You can take something prepared
https://github.com/tars/tars
https://github.com/CSSSR/csssr-project-template
but it seems to me that it will be more difficult to figure out such a combine right away.

A
A person from Kazakhstan, 2016-08-22
@LenovoId

of all that Andrey Khokhlov suggested to Jade, I use the thing, but without it, I do it faster, but the best html preprocessor is php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question