在node.js代码中使用jade mixins

时间:2014-05-05 07:59:53

标签: node.js pug

我尝试在node.js代码中使用jade

 var jade = require ('jade');
 var jadeString =  "include '../views/mixins/mixinFile.jade'\n"+ "mixin mixinName(arg)";
 var html = jade.compile (jadeString);

但得到了错误:

Error: Jade:1
  > 1| include '../views/mixins/mixinFile.jade'
    2| mixin mixinName(arg)

the "filename" option is required to use "include" with "relative" paths

我尝试了不同的相对路径。一直都有这个错误。如何知道我目前正确包含相对玉石路径的路径是什么?

0 个答案:

没有答案