node.js - Jade block not rendering -
i'm sure i'm missing small thing. i'm playing around jade templates in express. i'm trying experiment blocks , extensions. reason block isn't working. here jade templates:
layout.jade
doctype html html head title= title link(rel='stylesheet', href='/stylesheets/bootstrap.min.css') link(rel='stylesheet', href='/stylesheets/style.css') script(src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js') script(src='/javascripts/bootstrap.min.js') body block content
index.jade
extends layout
block content header section h1 hello p. first jade template how incredibly exciting! main div(class="row") div(class="col-md-6") block colone div(class="col-md-6") block coltwo
colone.jade
extends index block colone section p. col 1
coltwo.jade
extends index block coltwo section p. second col.
index.jade extending layout.jade. colone , coltwo not being rendered.
i've tried setting view options {layout: false}, hasn't changed anything.
the router pointing toward index.jade file:
router.get('/', function(req, res, next) { res.render('index', { title: 'express mon'}); });
i saw i'm supposed render lowest in chain. that's why render index , not layout. mean have res.render('colone')? tried that, , got index , layout pages, still no colone. plus, how reference coltwo?
**last side note, bootstrap columns not working either.. ha. edit:**columns working, had chrome inspector open wide... front end dev...
where screwing up?
first suggest adding jquery before bootstrap js file. second
i understand want render colone , coltwo col-md-6 divs of index. don't have extend index in colone , coltwo..that way adding index colone not other way round.
correct way be: index.jade
main div(class="row") div(class="col-md-6") include colone //include ../folder/filename.jade div(class="col-md-6") include coltwo
colone , coltwo.jade remove
extends index.jade
hope helps
Comments
Post a Comment