Hi there I'm trying using Jade's blocks and extends for a node.js project, and the ideia is to have something like this:
layout.jade:
head
script
$(document).ready(function() {
block js_doc_ready
//here goes the doc ready
});
index.jade:
block js_doc_ready
alert('hello!');
alert('one more js line code');
alert('end my js doc ready for this view');
This would give me a index.html like this:
...
<head>
<script type="text/javascript">
$(document).ready(function() {
alert('hello!');
alert('one more js line code');
alert('end my js doc ready for this view');
});
</script>
</head>
...
But when I see the result, the 'block js_doc_ready' is not considered a Jade block. Also, even if it was considered a block, the "alert('hello!);' wouldn't be considered a, but a Jade tag.
This is something that I used to do in django template, but in jade with all this tags, and no liberty to do pure html I still find it a little too strange to make this things.