Skip to content

Commit

Permalink
README.html -> index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Apr 9, 2024
1 parent 2d98843 commit 9c2b3d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const fs = require("fs");

const VOCAB = require("../package.json").name;

function file(dir, source, target) {
console.log(`${dir}/${source}`);
function file(dir, filename) {
console.log(`${dir}/${filename}`);
pandoc(
{
stdin: fs.createReadStream(`${__dirname}/../${dir}/${source}`),
stdout: fs.createWriteStream(`${__dirname}/../_site/${dir}/${target}`),
stdin: fs.createReadStream(`${__dirname}/../${dir}/${filename}`),
stdout: fs.createWriteStream(
`${__dirname}/../_site/${dir}/${filename === "README.md" ? "index.html" : filename.replace(/\.md$/, ".html")}`,
),
},
{
"-c": `/${VOCAB}/styles/style.css`,
Expand All @@ -26,7 +28,7 @@ function directory(dir) {
fs.readdirSync(`${__dirname}/../${dir}`)
.filter((fn) => fn.endsWith(".md"))
.forEach(function (filename) {
file(dir, filename, filename.replace(/\.md$/, ".html"));
file(dir, filename);
});
}
}
Expand Down

0 comments on commit 9c2b3d1

Please sign in to comment.