How do I render partials with jade without express.js?

后端 未结 4 1665
隐瞒了意图╮
隐瞒了意图╮ 2021-02-20 18:35

Only info I found was this:

http://forrst.com/posts/Node_js_Jade_Import_Jade_File-CZW

I replicated the suggested folder structure (views/partials) But it didn\'t

4条回答
  •  孤独总比滥情好
    2021-02-20 19:14

    With the latest node/express I get the following movies.jade template to call partials:

    div(id='movies')
      - each movie in movies
        !=partial('movie', movie)
    

    where I have movie.jade in the views directory alongside movies.jade.

    movies.jade is called from app.js with:

    res.render('movies', { movies: [{ title: 'Jaws' }, { title: 'Un Chien Andalou' }] });

提交回复
热议问题