Spells!
This commit is contained in:
11
lib/build.js
11
lib/build.js
@@ -1,8 +1,11 @@
|
||||
const { exists } = require("fs-extra/lib/fs");
|
||||
|
||||
module.exports = async (config) => {
|
||||
const { promises: fs } = require("fs"),
|
||||
const
|
||||
{ promises: fs } = require("fs"),
|
||||
fse = require("fs-extra"),
|
||||
{ version } = require("../package.json"),
|
||||
packageInfo = fse.statSync("./package.json", "utf-8"),
|
||||
path = require("path"),
|
||||
ejs = require("ejs"),
|
||||
frontMatter = require("front-matter"),
|
||||
@@ -135,10 +138,12 @@ module.exports = async (config) => {
|
||||
site: {
|
||||
...site,
|
||||
pages: isSupport ? siteData : [],
|
||||
version,
|
||||
lastUpdated: packageInfo.mtime,
|
||||
},
|
||||
};
|
||||
},
|
||||
parseContent = (page, siteData) => {
|
||||
parseContent = (page, siteData) => {site
|
||||
const {
|
||||
body,
|
||||
content_type: contentType,
|
||||
@@ -159,7 +164,7 @@ module.exports = async (config) => {
|
||||
} else if (ext === ".ejs") {
|
||||
content = ejs.render(
|
||||
body,
|
||||
{ page, site: { ...site, pages, tags } },
|
||||
{ page, site: { ...site, pages, tags, version, lastUpdated: packageInfo.mtime, } },
|
||||
{ filename: filePath }
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user