I would say there is not a very important difference, but let's take a look behind the scenes:
First example:
link(rel="stylesheet", href="#{locals.url}/assets/css/main.css")
with data
{ url: 'www.example.com' }
produces this code
function template(locals) {
var buf = [];
var jade_mixins = {};
buf.push('<link rel="stylesheet"' + jade.attr("href", "" + locals.url + "/assets/css/main.css", true, false) + "/>");
return buf.join("");
}
and this HTML
<link rel="stylesheet" href="www.example.com/assets/css/main.css"/>
Secondly:
link(rel="stylesheet", href=locals.url + "/assets/css/main.css")
will (with the same data as above) produce
function template(locals) {
var buf = [];
var jade_mixins = {};
buf.push('<link rel="stylesheet"' + jade.attr("href", locals.url + "/assets/css/main.css", true, false) + "/>");
return buf.join("");
}
and result in HTML (surprise!):
<link rel="stylesheet" href="www.example.com/assets/css/main.css"/>
Lesson learned:
You see the difference in both "methods" is marginal (see the "" +
in the frist example). Ergo use whatever pleases you best.