在linemanjs中引用供应商文件夹css和js

我正在使用linemanjs创build一个web应用程序,但是当我明确引用供应商的cssjs文件时,将不会引用该位置。 让我知道我在做什么linemanjs错了。

我在我的文件中试过的简单的事情是 –

link(rel="stylesheet",href="/vendor/css/myvendor.css")

link(rel="stylesheet",href="/css/myvendor.css")

link(rel="stylesheet",href="css/myvendor.css")

– > myvendor.css肯定位于供应商下的css文件夹中。

因为不使用基本HTML的这个基本标签:

 <link rel="stylesheet" type="text/css" href="css/myvendor.css"> 

必须包含标签的path必须是服务器或客户端的path。

如果文件夹供应商包含所有包含文件的文件html和文件夹,那么您在标签中包含的path是正确的。

如果仍然不包括这个文件的CSS ,问题是文件不存在或声明错误的文件名或结构CSS的错误(最好是你发布文件的CSS),但我认为你发现检查元素Firebug的问题(加载项为Firefox和[也许]铬)

更新:如果你使用Jade,那么在你的标签中join'type='text/css' ,因为你定义文件的types更好。

 link(rel='stylesheet', href='css/myvendor.css', type='text/css' ) 

阅读JADE的文档

 Template inheritance If you have multiple views with a similar structure, you will end up with the same set of includes in all your views. This approach can quickly become complicated and untidy, if the number of views and includes increases. 

使用Jade,您可以生成包含文件css的标签:

 !!! 5 html head title Learning Inheritance link(rel='stylesheet', href='/css/myvendor.css') body !!! 

或者在StavkoverFlow的其他问题上发布了其他解决scheme

 head title test include | <style type='text/css'> include css/myvendor.css | </style>