How to write conditional jade when there are two different designs for the layout?
I am creating a site in harp.js. I have a layout.jade file that includes _header.jade which is written as
!= partial("_header")
!= yield
!= partial("_footer")
Now changes the design. I don't want all titles to look the same. If I need a different header for the website, how do I put the condition in the jade file?
+3
shumana chowdhury
source
to share
1 answer
pass some type variable layout
to your template, then you can use a simple condition in the template.
if layout === '1'
!= partial("_hedaer1")
else if layout === '2'
!= partial("_header2")
otherwise you could make the content and layout independent of each other
0
timaschew
source
to share