diff --git a/packages/@zblog/toolchain/src/file-loader.ts b/packages/@zblog/toolchain/src/file-loader.ts index 640b273..9b3f019 100644 --- a/packages/@zblog/toolchain/src/file-loader.ts +++ b/packages/@zblog/toolchain/src/file-loader.ts @@ -19,23 +19,24 @@ export class FileLoader implements IPluginBuilder { const { menuManifest } = builderContext; const { files } = this.options; files.forEach((file) => { - const fileName = - file.nameOverride ?? file.path.split("/").pop() ?? file.path; + const filePath = file.path.split("/").pop() ?? file.path; + const fileName = file.nameOverride ?? filePath; const isImage = fileName.match(/\.(png|jpe?g|gif|webp)$/); if (isImage) { console.log("Processing image", file.path); ffmpeg(file.path) - .output(`${builderContext.outputDirectory}/${fileName}`) + .output(`${builderContext.outputDirectory}/${filePath}`) .size(`${this.options.imageWidth ?? 200}x?`) .run(); } else { - console.log("Copying file", file.path); - copyFile(file.path, `${builderContext.outputDirectory}/${fileName}`); + const destination = `${builderContext.outputDirectory}/${filePath}`; + console.log("Copying file", file.path, "to", destination); + copyFile(file.path, destination); } if (file.menuEntry) { menuManifest.push({ name: fileName, - link: file.path, + link: filePath, }); } }); diff --git a/src/assets/base.css b/src/assets/base.css new file mode 100644 index 0000000..821a3af --- /dev/null +++ b/src/assets/base.css @@ -0,0 +1,4 @@ +:root { + --color-background: #1c1b28; + --color-accent: #00FFFF; +} diff --git a/src/index.ts b/src/index.ts index 8f10ac9..3f13bf3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,7 +24,6 @@ new ToolchainBuilder(paths) files: [ { path: "src/templates/404.html", - nameOverride: "Not Found Page", menuEntry: false, }, { @@ -32,6 +31,14 @@ new ToolchainBuilder(paths) }, { path: "src/assets/favicon.ico", + }, + { + path: "src/assets/base.css" + }, + { + path: "src/playground/dropdown.html", + menuEntry: true, + nameOverride: "Dropdown playground" } ], }), diff --git a/src/playground/dropdown.html b/src/playground/dropdown.html new file mode 100644 index 0000000..02dfe00 --- /dev/null +++ b/src/playground/dropdown.html @@ -0,0 +1,13 @@ + + + + + + +arst + + diff --git a/src/templates/index.html b/src/templates/index.html index 23ecd71..47ae13b 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -5,6 +5,7 @@ Document +