Question coder

Hi %username%, today I need your advice!

Working on a multi-page website (>30 unique pages) are faced with the problem of making changes to the layout affecting a large part of the pages. It was creepy and in the next project came up to collect pages using PHP includes.

Now I am using php to build the html, SCSS for CSS, and GRUNT for javascripts.

Curious to know how you collect your projects, maybe there are some collectors of type GRUNT, but for HTML + CSS + javascript?
It would also be interesting to know how you organize your workflow.
October 3rd 19 at 04:06
5 answers
October 3rd 19 at 04:08
Solution
Now prepare a project template for the layout using grunt. Page assembled from blocks using grunt-swig (swig template engine) for the final build using a couple grunt tasks: imgo (image optimization), uglifyjs, concat, cssmin, usemin.
October 3rd 19 at 04:10
SSI?
October 3rd 19 at 04:12
Even though You already accepted the answer, but still I recommend to look at yeoman — already there are ready grunt config with many useful tasks.
October 3rd 19 at 04:14
And if there cycles? and how to save the result?
Using PHP I can in the console write:

php index.php > index.html

and get ready to send the pages
You decide you need a full-fledged templating engine, or the ability to includethe pieces of the markup is the same on all pages.

And if there cycles?

No.

Using PHP I can in the console write:... and get ready to send the pages

Surely there are ready scripts. If not, then for half an hour to write in any language. The only question is why? I as the customer would prefer that the code responsible for particular elements were in different files. Why force a customer to sit and then carving the html into pieces?
But if you write about what these pages more than 30, then it is a downright mockery of the customer. I would be sent to hell. - Delta_Ritchie79 commented on October 3rd 19 at 04:17
October 3rd 19 at 04:16
You can try grunt-include-replace

Find more questions by tags AutomationHTML