A
A
Alexey Sklyarov2017-08-20 21:14:18
gulp.js
Alexey Sklyarov, 2017-08-20 21:14:18

How to correctly split index.html into compound files when working with gulp?

There is a long landingos. What I want to do : split the entire site into blocks (each block is in its own file, for example header.html, footer.html), include each of these files in the index file, and when any of these files change, gulp watch works correctly. When building a project, all files are combined into one main file.
How can I implement this, I'm sure that there are ready-made solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex-85, 2017-08-20
@alex-85

I do with pug.
To structure all files and names I use the BEM methodology (it doesn't matter, you can organize your files as you like)
I do this - I create a blocks folder, subfolders with the necessary blocks in it, for example, header, carousel, footer, etc.
Each folder contains the files of this block. For example header folder:
header.pug
header.scss
header.js
header.jpg
etc.
blocks can contain nested blocks. For example, the header folder may contain a menu block.
You can read about BEM about https://ru.bem.info.

@
@pythoome, 2018-09-23
_

gulp + rigger:
https://ru.stackoverflow.com/questions/652990/%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question