简体   繁体   中英

Reference vendor folder css and js in linemanjs

I am creating a web app using linemanjs but when I am referencing vendor css and js files explicitly it wont reference to that location. Let me know what I am doing wrong with linemanjs.

Simple things that I tried in my files is -

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

AND

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

AND

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

-> myvendor.css is surely residing in the css folder under vendor.

Because not use this elementary tag of basic HTML :

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

The path that have to include the tag if must be of the server or client.

If the folder vendor contain all file html and folder that contain file that you using for site, the path that I include in the tag before is correct.

If still not include this file css , the problem is the file not exist or declared wrong file name or structure css's wrong (Is better that you publish file css) but I think that you find the problem with Inspect Element or Firebug (add-on for firefox and [perhaps] Chrome)

UPDATE: Ahhh if you using Jade ,adds 'type='text/css' inside the you tag because is better that you define the type of file.

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

Reading the documentation of JADE and on

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.

With Jade you can generate the tag including file css with:

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

Or there is a other solution posted in other question on StavkoverFlow

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM