Layering Jade Layout

If you do not know what jade .
I have a problem with the template inheritance system. My file structure is similar to

/views/
   |-- layout.jade
   /products/
      |-- index.jade
      |-- product.jade
/static/
   /stylesheets/
      |-- style.css

The problem is that when loading a product page that receives the identifier as a parameter (localhost: 3000 / product /: id, if not for / id, it will load just fine), although the layout still spreads correctly, it doesn’t load style sheet is correct (path is broken). I do half this right, although the stylesheet loads just fine on the product index page.

Layout.jade

  head
    link(rel='stylesheet', href='stylesheets/style.css')
+5
source share
1 answer

, href. -, , , ( ):

link(rel='stylesheet','/stylesheets/style.css')

(/about,/about/me ..). , , . , : http://yourserver/yourapps/yourapp, . , , , , : -)

, , - github: blog. https://github.com/visionmedia/express/tree/master/examples/blog

URL- , . HTML:

!!! 5
html
  head
    title Blog
    link(rel='stylesheet', href=base + '/style.css')
  body
    #container!= body

, , , middleware/locals.js, app.js, , layout.jade, href.

!

+9

All Articles