Skip to content

Instantly share code, notes, and snippets.

@nafeu
Created February 10, 2021 14:46
Show Gist options
  • Save nafeu/277e3d5a7eda954549d64be0a0b1bed9 to your computer and use it in GitHub Desktop.
Save nafeu/277e3d5a7eda954549d64be0a0b1bed9 to your computer and use it in GitHub Desktop.
/* Step 4: Build pages into .html files with appropriate paths */
for (const page of pages) {
const { path } = page;
let outputPath: string;
if (path === HOME_PATH) {
outputPath = `${buildPath}/index.html`;
} else {
outputPath = `${buildPath}${path}/index.html`;
}
ensureFileSync(outputPath);
Deno.writeTextFileSync(outputPath, getHtmlByPage(page));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment