var pathFn = require('path'); var fs = require('hexo-fs'); var fm = require('front-matter') module.exports = function(ctx) { return function includeTag({pageType, parentPage, currentPage, parentPageExtension = "md"}) { const parentFile = `${pageType}/${parentPage}.${parentPageExtension}`; var path = pathFn.join(ctx.source_dir, parentFile); // exit if path is not defined if (!path) { console.warn("Include file path undefined."); return; } const data = fs.readFileSync(path); const frontmatter = fm(data) return ` ` }; };