代码拉取完成,页面将自动刷新
module.exports = {
//
// helper to create front matter from a JS object.
//
createFrontMatter : function(options) {
var f = "---\n";
for (var k in options)
f += (k + ": " + options[k] + "\n");
f += "---\n";
return f;
},
//
// helper to create a timestamp for inclusion in yaml front matter.
//
timestamp : function() {
var d = new Date();
return d.getFullYear() + "-" + d.getMonth() + "-" + d.getDate() + " 12:00:00";
},
processMarkdownFile : function(grunt, inputDir, filename, template, base, outputDir) {
/*var s = grunt.file.read(inputDir + "/" + filename),
o = this.createFrontMatter({
layout:template,
date:this.timestamp(),
base:base
});
grunt.file.write(outputDir + "/" + filename, o + s);*/
this.createMarkdownFile(grunt, inputDir, filename, {
layout:template,
date:this.timestamp(),
base:base
}, outputDir);
},
createMarkdownFile:function(grunt, inputDir, filename, options, outputDir) {
var s = grunt.file.read(inputDir + "/" + filename),
o = this.createFrontMatter(options);
grunt.file.write(outputDir + "/" + filename, o + s);
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。