Posts links now show on index
This commit is contained in:
9
build.js
9
build.js
@@ -60,7 +60,14 @@ let htmlTemplate = fs.readFileSync(
|
||||
const links = manifest.map(
|
||||
(m) => `<a href='/${m.directoryName}.html'>${m.name}</a>`
|
||||
);
|
||||
htmlTemplate = htmlTemplate.replace("{{content}}", links);
|
||||
|
||||
const unorderedListItems = links.map((l) => `<li>${l}</li>`).join("\r\n");
|
||||
const html = `
|
||||
<ul>
|
||||
${unorderedListItems}
|
||||
<ul>
|
||||
`;
|
||||
htmlTemplate = htmlTemplate.replace("{{content}}", html);
|
||||
fs.writeFileSync(`${paths.output}/index.html`, htmlTemplate, {
|
||||
encoding: "utf-8",
|
||||
flag: "ax",
|
||||
|
||||
Reference in New Issue
Block a user