Answer the question
In order to leave comments, you need to log in
How to add a class to the main page when inserting a header via posthtml-include?
Good evening. Essence of the question: there is a site layout in which I want to put the header and footer into separate blocks and connect them through the tag
, but on the main page the header has an additional class. How to insert a header on a page, but add an additional class for index.html? <include src="***"></include>
Answer the question
In order to leave comments, you need to log in
Look in the direction of posthtml-mixins
Or use templating, I started using pug
in due time
Example and my tool for layout gulp-front
<mixin name="header" class>
<header class="header {{ class }}">Header</header>
</mixin>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question