Permalink
Browse files

Fixed includes example

  • Loading branch information...
tj committed Sep 26, 2011
1 parent 421594f commit f6924d199882c6e86451262535ca8c179069a63e
Showing with 7 additions and 5 deletions.
  1. +5 −5 examples/includes.js
  2. +2 −0 examples/includes/head.jade
View
@@ -3,9 +3,9 @@
* Module dependencies.
*/
-var jade = require('./../lib/jade');
+var jade = require('./../')
+ , path = __dirname + '/includes.jade'
+ , str = require('fs').readFileSync(path, 'utf8')
+ , fn = jade.compile(str, { filename: path, pretty: true });
-jade.renderFile(__dirname + '/includes.jade', function(err, html){
- if (err) throw err;
- console.log(html);
-});
+console.log(fn());
@@ -1,4 +1,6 @@
head
title My Site
+ // including other jade works
include scripts
+ // including .html, .css, etc works
include style.css

0 comments on commit f6924d1

Please sign in to comment.