« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generatePageLayout.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index 706340cc..490468c9 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -210,6 +210,7 @@ export default {
     to,
   }) {
     const colors = getColors(slots.color ?? data.wikiColor);
+    const hasSocialEmbed = !html.isBlank(slots.socialEmbed);
 
     let titleHTML = null;
 
@@ -522,7 +523,7 @@ export default {
       footerHTML,
     ].filter(Boolean).join('\n');
 
-    return html.tags([
+    const pageHTML = html.tags([
       `<!DOCTYPE html>`,
       html.tag('html',
         {
@@ -601,7 +602,10 @@ export default {
 
             */
 
-            // slots.socialEmbed,
+            hasSocialEmbed &&
+              slots.socialEmbed
+                .clone()
+                .slot('mode', 'html'),
 
             html.tag('link', {
               rel: 'stylesheet',
@@ -636,6 +640,16 @@ export default {
               }),
             ]),
         ])
-    ]);
+    ]).toString();
+
+    const oEmbedJSON =
+      (hasSocialEmbed
+        ? slots.socialEmbed
+            .clone()
+            .slot('mode', 'json')
+            .content
+        : null);
+
+    return {pageHTML, oEmbedJSON};
   },
 };