3

I am building a website on harp.js. I have a layout.jade file which includes _header.jade which is written like

   != partial("_header")
   != yield
   != partial("_footer")

Now, there is a change in my design. I do not want all the header look same. If I want different header for the website, how should I put condition to jade file?

shumana chowdhury
  • 1,742
  • 2
  • 14
  • 34

1 Answers1

0

pass some variable like layout into 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 render the content and the layout independent from each other

timaschew
  • 16,254
  • 6
  • 61
  • 78