Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question