sails can't find layout.jade

北城以北 提交于 2019-12-06 13:42:28

I'm not a jade user, however, I think you need to put extends ../layout at the top of your index.jade file to use layout.jade.

Also, I think both the layout.jade and index.jade have tabs and spaces (I don't think you can use both). I took out the tabs and added spaces in your layout.ejs file.

I created a project from scratch, changed engine to jade in config/views.js but left layout to the default value.

Also, I used these tags in layout.jade:

 // SCRIPTS
 // SCRIPTS END

and

 // STYLES   
 // STYLE END

Grunt then puts the appropriate paths for javascript and styles in your layout file. I couldn't get index.jade into the layout.jade but I don't know enough about jade to determine what's wrong.

Here's a link to the repo I made: https://github.com/irlnathan/sails-answers-jade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!