Broke out all functionality into plugins
This commit is contained in:
45
src/index.ts
45
src/index.ts
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user