Finish styling index
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user