add inter-work navigation
This commit is contained in:
parent
23d7810ab6
commit
dbc1fd7c17
11 changed files with 104 additions and 7 deletions
|
@ -95,8 +95,6 @@ export const convertMeshes = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
console.log({ propertyList });
|
||||
|
||||
const vertexCount = Number(
|
||||
headerLines
|
||||
.find((header) => header.startsWith("element vertex"))
|
||||
|
|
|
@ -11,7 +11,18 @@ export const generate = async (works: string[]) => {
|
|||
.reverse();
|
||||
|
||||
for (const work of allWorks) {
|
||||
const html = `${workTemplate}`.replace(/##name##/g, work);
|
||||
const workIndex = allWorks.findIndex((w) => w === work);
|
||||
const previous = allWorks[(workIndex as any) + 1] ?? null;
|
||||
const next = allWorks[(workIndex as any) - 1] ?? null;
|
||||
|
||||
let nav = ``;
|
||||
if (previous)
|
||||
nav += `<a class="nav-left" href="/${previous}">⇠ ${previous}</a>`;
|
||||
if (next) nav += `<a class="nav-right" href="/${next}">${next} ⇢</a>`;
|
||||
|
||||
const html = `${workTemplate}`
|
||||
.replace(/##name##/g, work)
|
||||
.replace(/##nav##/g, nav);
|
||||
|
||||
mkdirSync(`html/${work}`, { recursive: true });
|
||||
await Bun.write(`html/${work}/index.html`, html);
|
||||
|
|
|
@ -21,5 +21,8 @@
|
|||
<main>
|
||||
<canvas id="canvas" width="1280" height="720"></canvas>
|
||||
<div id="telemetry">XX.X FPS (XX.X ms)</div>
|
||||
<nav>
|
||||
##nav##
|
||||
</nav>
|
||||
</main>
|
||||
<script src="/##name##/main.js" type="module"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue