This commit is contained in:
parent
5f9b68977d
commit
c222b3153b
6 changed files with 53 additions and 23 deletions
12
index.ts
12
index.ts
|
|
@ -19,15 +19,17 @@ const sssg = new SSSG({
|
|||
inputFolder: path.join(__dirname, "website"),
|
||||
});
|
||||
|
||||
const gitLogShell =
|
||||
await $`git log --pretty=format:'commit=%H%nauthor=%aN <%aE>%ndate=%ad%nmessage=%s%n=========' -1`.quiet();
|
||||
const gitLogOutput = gitLogShell.text("utf8");
|
||||
const gitLog = JSON.stringify(parseMetadata(gitLogOutput));
|
||||
const plugins: Plugin[] = [];
|
||||
let gitLog = "{}";
|
||||
|
||||
if (process.argv.includes("--dev")) {
|
||||
plugins.push(new Dev(sssg));
|
||||
} else {
|
||||
const gitLogShell =
|
||||
await $`git log --pretty=format:'commit=%H%nauthor=%aN <%aE>%ndate=%ad%nmessage=%s%n=========' -1`.quiet();
|
||||
const gitLogOutput = gitLogShell.text("utf8");
|
||||
gitLog = JSON.stringify(parseMetadata(gitLogOutput));
|
||||
|
||||
plugins.push(new ImageOptimization());
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +39,7 @@ await sssg.run({
|
|||
new Variables(() => {
|
||||
const variables: Record<string, string> = {
|
||||
__BLOG_POSTS__: JSON.stringify(
|
||||
fs.readdirSync("./website/blogs").map((z) => z.replace(".md", ""))
|
||||
fs.readdirSync("./website/blogs").map((z) => z.replace(".md", "")),
|
||||
),
|
||||
__GIT_LOG_OUTPUT__: gitLog,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue