D
D
Dmitry2018-10-20 17:13:38
Node.js
Dmitry, 2018-10-20 17:13:38

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

1 answer(s)
K
Konstantin Velichko, 2018-11-02
@Zoxon

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 question

Ask a Question

731 491 924 answers to any question