我正在尝试将一个 Express 应用程序与 Docpad 集成。我最想要的是在我的静态页面和我的 Express 视图之间共享布局。
在此过程中,我遵循问题 16332833的说明,其中:
var docpadInstanceConfiguration = {
action: 'generate',
env: 'static'
};
require('docpad').createInstance(docpadInstanceConfiguration, function(err,docpadInstance){
if (err) return console.log(err.stack);
// ...
});
我收到以下错误:
info: Generating...
notice: DocPad is currently running without any plugins installed. You probably want to install some: http://docpad.org/plugins
TypeError: path must be a string
at fs.exists (fs.js:166:11)
at Task.method (/Users/../node_modules/docpad/node_modules/safefs/out/lib/safefs.js:183:14)
at ambi (/Users/../node_modules/docpad/node_modules/ambi/out/lib/ambi.js:22:16)
at /Users/../node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:117:19
at b (domain.js:183:18)
at Domain.run (domain.js:123:23)
at Task.fire (/Users/../node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:116:21)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:901:3
没有选项,var docpadInstanceConfiguration = {};
也没有错误:
info: Welcome to DocPad v6.52.1
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, downloader, eco, less, livereload, marked, partials, related, stylus, text
info: Environment: development
在 docpad 和 express 视图之间获取共享布局并获得 csrf 保护的任何想法?(我使用 ectjs 作为我的观点,是生态兼容的)
谢谢