This commit is contained in:
parent
1efaf2f0b1
commit
f75305ebfe
5 changed files with 64 additions and 7 deletions
9
index.ts
9
index.ts
|
|
@ -2,10 +2,12 @@ import SSSG from "sssg";
|
|||
import Variables from "sssg/src/plugins/variables";
|
||||
import Dev from "sssg/src/plugins/dev";
|
||||
import TSCompiler from "sssg/src/plugins/ts-compiler";
|
||||
import MarkdownMetadata from "sssg/src/plugins/markdown-metadata";
|
||||
import MarkdownMetadata, {parseMetadata} from "sssg/src/plugins/markdown-metadata";
|
||||
import MarkdownCompiler from "sssg/src/plugins/markdown-compiler";
|
||||
import CompileTimeJS from "sssg/src/plugins/compile-time-js";
|
||||
|
||||
import {$} from "bun"
|
||||
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
|
||||
|
|
@ -14,6 +16,10 @@ 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));
|
||||
|
||||
await sssg.run({
|
||||
plugins: [
|
||||
new CompileTimeJS(),
|
||||
|
|
@ -22,6 +28,7 @@ await sssg.run({
|
|||
__BLOG_POSTS__: JSON.stringify(
|
||||
fs.readdirSync("./website/blogs").map((z) => z.replace(".md", ""))
|
||||
),
|
||||
__GIT_LOG_OUTPUT__: gitLog
|
||||
};
|
||||
|
||||
if (fs.existsSync("./website/templates")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue