« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write/build-modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/write/build-modes')
-rw-r--r--src/write/build-modes/live-dev-server.js2
-rw-r--r--src/write/build-modes/static-build.js13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index 1f74df1e..6734c065 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -365,7 +365,7 @@ export async function go({
           args: page.contentFunction.args ?? [],
         });
 
-      const pageHTML = topLevelResult.toString();
+      const {pageHTML} = topLevelResult.content;
 
       if (!quietResponses) console.log(`${requestHead} [200] ${pathname}`);
       response.writeHead(200, contentTypeHTML);
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index 2a5e1437..8bc1b242 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -309,10 +309,11 @@ export async function go({
             args: page.contentFunction.args ?? [],
           });
 
-        const pageHTML = topLevelResult.toString();
+        const {pageHTML, oEmbedJSON} = topLevelResult.content;
 
         return writePage({
-          html: pageHTML,
+          pageHTML,
+          oEmbedJSON,
           outputDirectory: path.join(outputPath, getPagePathname({
             baseDirectory,
             device: true,
@@ -333,10 +334,10 @@ export async function go({
         });
 
         const target = to('localized.' + toPath[0], ...toPath.slice(1));
-        const html = generateRedirectHTML(title, target, {language});
+        const pageHTML = generateRedirectHTML(title, target, {language});
 
         return writePage({
-          html,
+          pageHTML,
           outputDirectory: path.join(outputPath, getPagePathname({
             baseDirectory,
             device: true,
@@ -387,14 +388,14 @@ import {
 } from 'fs/promises';
 
 async function writePage({
-  html,
+  pageHTML,
   oEmbedJSON = '',
   outputDirectory,
 }) {
   await mkdir(outputDirectory, {recursive: true});
 
   await Promise.all([
-    writeFile(path.join(outputDirectory, 'index.html'), html),
+    writeFile(path.join(outputDirectory, 'index.html'), pageHTML),
 
     oEmbedJSON &&
       writeFile(path.join(outputDirectory, 'oembed.json'), oEmbedJSON),