Answer the question
In order to leave comments, you need to log in
How to use Jade in my case?
Hello!
I want to understand how to use jade in my case.
I'm building a website on the bootstrap, there are two navigations (top and right).
There are many pages (there are typical ones, but the content on each page is different).
The contents of the menus are also different depending on the pages.
Please tell me what exactly to use, extends, block, include and in what cases. Thanks
Answer the question
In order to leave comments, you need to log in
I would write the menu in a json file and display it according to the condition.
layout.jade
include ../helpers/mixins
html
body
block menu
if menuID === 1
+menu(1)
block content
extends ../layouts/layout
block menu
- var menuID = 1;
block content
p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
//- тут создаете миксин, который принимает аргумент и выводит по нему часть json.
+menu(menuID)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question