Skip to content

Commit

Permalink
Merge pull request #71 from caillou/fix-for-missing-jade-basedir
Browse files Browse the repository at this point in the history
Fix for missing jade basedir
  • Loading branch information
sintaxi committed Jan 7, 2015
2 parents fcc0d30 + 865b771 commit 8540c7a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var scope = module.exports = function(projectPath, partentLocals){
* note - layouts get the same scope as the partial
*
*/
var tmpl = processors[ext](fileContents, { filename: filePath })
var tmpl = processors[ext](fileContents, { filename: filePath, basedir: projectPath })

try{
var render = tmpl.compile()
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/templates/extend.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extend /index.jade
12 changes: 12 additions & 0 deletions test/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ describe("templates", function(){
})
})

it("should extend from a file with absolute path", function(done){
poly.render("extend.jade", function(error, body){
should.not.exist(error)
should.exist(body)
body.should.include("<h1>Sintaxi</h1>")
body.should.include("<h2>Hello World</h2>")
body.should.include("<h3>Brock Whitten</h3>")
body.should.include("<h4>Vancouver</h4>")
done()
})
})

})

})

0 comments on commit 8540c7a

Please sign in to comment.