mathlearner
mathlearner

Reputation: 7659

Jade is not working as expected not showing index.jade content

i am trying to use jade .i am trying to render a template in get request my code is

app.get('/promocode/generate-promocode',mw.authenticate,function(req,res)
    {  res.render('index1', {}); 
  });

my layout.jade file code is

doctype 5
html
  head
    block head
    title= title

    include layout/css
    include layout/headerjs

    body
      include header/main

      include layout/topbar

      .middle-content
        .container
          .wrapper
            block content

      include footer/main

      include layout/footerjs

and my index.jade file code is

extends layout

h1 Welcome to Marketplace 
h1 Welcome to Marketplace 
h1 Welcome to Marketplace 

h1 Welcome to Marketplace 

h1 Welcome to Marketplace 

h1 Welcome to Marketplace 

when i goto page it is showing only layout.jade syntax no h1 heading with content "Welcome to Marketplace " . any suggestion how to show this heading tag in html page ??

Upvotes: 0

Views: 977

Answers (1)

user568109
user568109

Reputation: 48013

You have to define the same block in your index.jade which has to be inherited.

extends layout
block content
  h1 Welcome to Marketplace 

Considering mismatch in filename in res.render('index1', {}); and index.jade you gave as typo, this should solve your problem.

Upvotes: 1

Related Questions