帆找不到layout.jade [英] sails can't find layout.jade

查看:43
本文介绍了帆找不到layout.jade的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习 Sails(0.9.7,节点 0.10.16)并浏览了 Sailscasts 剧集.我也在尝试使用玉.我现在卡住的地方是帆没有找到 views/layout.jade.我退出了所有的玉石东西,并用 ejs 重新编写,sails 没有找到 views/layout.ejs.

I am starting to learn Sails (0.9.7, node 0.10.16) and running through the sailscasts episodes. I am also trying to use jade as I do so. Where I am stuck now is that sails is not finding views/layout.jade. I backed out all the jade stuff and redid with ejs and sails is not finding views/layout.ejs.

作为最后的手段,我克隆了 activtyoverlord(sailscasts 应用程序),当我航行时,activityoverlord 找不到它的 views/layout.ejs.

As a last resort, I cloned activtyoverlord (the sailscasts app) and when I sails lift activityoverlord does not find its views/layout.ejs.

任何关于我可能做错了什么的建议?

Any suggests as to what I might be doing wrong?

推荐答案

我不是 jade 用户,但是,我认为您需要将 extends ../layout 放在您的顶部index.jade 文件使用layout.jade.

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.

另外,我认为 layout.jadeindex.jade 都有制表符和空格(我认为你不能同时使用两者).我取出了标签并在您的 layout.ejs 文件中添加了空格.

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.

我从头开始创建了一个项目,在 config/views.js 中将引擎更改为 jade,但将 layout 保留为默认值.

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

另外,我在 layout.jade 中使用了这些标签:

Also, I used these tags in layout.jade:

 // SCRIPTS
 // SCRIPTS END

 // STYLES   
 // STYLE END

Grunt 然后将 javascript 和样式的适当路径放在您的布局文件中.我无法将 index.jade 放入 layout.jade,但我对 jade 的了解不够,无法确定问题所在.

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.

这是我制作的 repo 的链接:https://github.com/irlnathan/sails-answers-jade

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

这篇关于帆找不到layout.jade的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆