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

后端 未结 4 1702
隐瞒了意图╮
隐瞒了意图╮ 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条回答
  •  -上瘾入骨i
    2021-02-20 19:15

    As of August 2012 (possibly earlier) Partials have been removed from Express.

    A lot of tutorials are now out of date. It seems that you can replicate much of the partial functionality with include.

    Eg.

    movies.jade

    div(id='movies')
      - each movie in movies
        include movie
    

    movie.jade

    h2= movie.title
    .description= movie.description
    

    HTH

提交回复
热议问题