Answer the question
In order to leave comments, you need to log in
How to override class on every jade page?
there is a template that I extend on every page. I need to change the class of the body so that one page has "body.index" and the other has "body.secondary" and so on. Naturally, do not create your own template for each page. I tried through everything, interpolation, mixins, nothing helps. Nobody knows how to do it?
Answer the question
In order to leave comments, you need to log in
On each page:
extends /core/core.pug // подключаем шаблон
// создаём блок переменных, где объявляем наши переменные для страницы
block variables
- var pageClass = 'mainPage'; //- <body class="HERE">
block variables // подключение блока переменных со страницы в самом начале
// код вашего шаблона
doctype html
html.no-js(lang= pageLang)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question