Broke out all functionality into plugins

This commit is contained in:
2024-01-29 21:39:31 +01:00
parent 31c253c99b
commit fb79c2d10e
10 changed files with 171 additions and 128 deletions

View File

@@ -1,19 +1,36 @@
import { Paths, ToolchainBuilder } from "@zblog/toolchain";
import {
ToolchainBuilder,
Paths,
FileLoader,
MarkdownLoader,
StartPagePlugin,
} from "@zblog/toolchain";
const paths: Paths = {
outputDirectory: "dist",
notes: {
rootPath: "src/notes",
assetsDirectoryName: "assets",
noteFileName: "note.md",
markdownHtmlVariableReplacementTag: "{{markdown}}",
},
templates: {
rootPath: "src/templates",
noteTemplateName: "note.html",
indexTemplateName: "index.html",
notFoundName: "404.html",
},
};
new ToolchainBuilder(paths).build();
new ToolchainBuilder(paths)
.addPlugins([
new MarkdownLoader({
rootPath: "src/notes",
assetsDirectoryName: "assets",
markdownHtmlReplacementTag: "{{markdown}}",
noteFileName: "note.md",
noteHtmlTemplatePath: `src/templates/note.html`,
}),
new FileLoader({
files: [
{
path: "src/templates/404.html",
nameOverride: "Not Found Page",
menuEntry: true,
},
],
}),
new StartPagePlugin({
indexTemplatePath: "src/templates/index.html",
contentTemplateTag: "{{content}}",
}),
])
.build();