« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/write/build-modes/static-build.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index eb2f6fe3..d2802f4e 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -301,9 +301,9 @@ export async function go({
           wikiData,
         });
 
-        let topLevelResult;
+        let pageHTML, oEmbedJSON;
         try {
-          topLevelResult =
+          const topLevelResult =
             quickEvaluate({
               contentDependencies,
               extraDependencies: {...bound, appendIndexHTML},
@@ -311,6 +311,8 @@ export async function go({
               name: page.contentFunction.name,
               args: page.contentFunction.args ?? [],
             });
+
+          ({pageHTML, oEmbedJSON} = html.resolve(topLevelResult));
         } catch (error) {
           logError`\rError generating page: ${pathname}`;
           niceShowAggregate(error);
@@ -318,8 +320,6 @@ export async function go({
           return;
         }
 
-        const {pageHTML, oEmbedJSON} = html.resolve(topLevelResult);
-
         return writePage({
           pageHTML,
           oEmbedJSON,