wip
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
4
src/assets/base.css
Normal file
4
src/assets/base.css
Normal file
@@ -0,0 +1,4 @@
|
||||
:root {
|
||||
--color-background: #1c1b28;
|
||||
--color-accent: #00FFFF;
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
],
|
||||
}),
|
||||
|
||||
13
src/playground/dropdown.html
Normal file
13
src/playground/dropdown.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<meta>
|
||||
<link href="base.css" rel="stylesheet" />
|
||||
<style contenteditable>
|
||||
body {
|
||||
background-color: var(--color-background);
|
||||
}
|
||||
</style>
|
||||
</meta>
|
||||
|
||||
<body>arst</body>
|
||||
|
||||
</html>
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link href="base.css" rel="stylesheet" />
|
||||
<style>
|
||||
html {
|
||||
font-size: 18px;
|
||||
@@ -23,7 +24,7 @@
|
||||
body {
|
||||
max-width: 800px;
|
||||
color: #fbfbfe;
|
||||
background-color: #1c1b28;
|
||||
background-color: var(--color-background);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user