A
A
Andrey Zernov2017-09-09 10:18:14
HTML
Andrey Zernov, 2017-09-09 10:18:14

How to customize repeating blocks in Pug?

Hello!
How to add "active" class to header.pug on different pages to required menu items? What to write in the page files?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Talalaev, 2017-09-09
@AndreyZernov

Add a variable with the page ID, and set the class depending on the value of the variable, and then check, like this:
li(class=(page === "woohoo" ? "active" : ""))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question