Finish styling index

This commit is contained in:
2025-09-19 20:28:21 +02:00
parent 4e68f393bd
commit 3e3c209ac9
2 changed files with 33 additions and 24 deletions

View File

@@ -14,13 +14,13 @@ export class StartPagePlugin implements IPluginBuilder {
return (builderContext) => {
let htmlTemplate = readFileAsText(this.options.indexTemplatePath);
const links = builderContext.menuManifest
.map((m) => `<a href='${m.link}'>${m.name}</a>`)
.map((m) => {
const name = m.name.slice(m.name.indexOf("-") + 1).replaceAll("-", " ");
return `<div class="entry"><h2>${name}</h2><a href='${m.link}'>Read here!</a></div>`
})
.reverse();
const unorderedListItems = links.map((l) => `<li>${l}</li>`).join("\r\n");
const html = `
<ul>
${unorderedListItems}
<ul>
${links.join("")}
`;
htmlTemplate = htmlTemplate.replace("{{content}}", html);
writeTextAsFile(