node.js - how to use pug-bootstrap module in nodejs? -
i installed pug-bootstrap module in nodejs project. trying create menu navbar.
i have done files:
layout.pug:
include /node_modules/pug-bootstrap/_bootstrap.pug
index.pug:
extends layout block head +navbar("menu") +nav_item("#", undefined, true) string test block body h1= title p welcome #{title}
the _bootstrap.pug contains bootstrap css file : https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css. not loaded on webpage.
someone know why? , how fix that?
any appreciate.
when extend part of template block
, you're replacing code in block, before. in case, assume head
included reference css file, you're overwriting.
generally speaking, use append
instead of block
head
section (see this page docs). way, previous content of parent templates not overwritten.
in usecase, doubtful whether should placing @ in head
block, since reserved meta-tags, not actual visible content. in other words: you'll need move code have there body
anyway, since visible document objects belong in body
, not in head
.
Comments
Post a Comment