summary refs log tree commit diff
path: root/develop/website_files
diff options
context:
space:
mode:
authoranoadragon453 <anoadragon453@users.noreply.github.com>2022-04-13 15:28:26 +0000
committeranoadragon453 <anoadragon453@users.noreply.github.com>2022-04-13 15:28:26 +0000
commit7a48127fbe1a8865a67083064ec28263e7eb0318 (patch)
tree5858ee4b9855da19203e4c1296df1059b750bd7e /develop/website_files
parentdeploy: a468768104887bd3c0d117096bec7f307dfd348c (diff)
downloadsynapse-7a48127fbe1a8865a67083064ec28263e7eb0318.tar.xz
deploy: 0922462fc7df951e88c8ec0fb35e53e3cd801b76
Diffstat (limited to 'develop/website_files')
-rw-r--r--develop/website_files/table-of-contents.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/develop/website_files/table-of-contents.js b/develop/website_files/table-of-contents.js
index 0de5960b22..772da97fb9 100644
--- a/develop/website_files/table-of-contents.js
+++ b/develop/website_files/table-of-contents.js
@@ -75,6 +75,20 @@ function setTocEntry() {
  * Populate sidebar on load
  */
 window.addEventListener('load', () => {
+    // Prevent rendering the table of contents of the "print book" page, as it
+    // will end up being rendered into the output (in a broken-looking way)
+
+    // Get the name of the current page (i.e. 'print.html')
+    const pageNameExtension = window.location.pathname.split('/').pop();
+
+    // Split off the extension (as '.../print' is also a valid page name), which
+    // should result in 'print'
+    const pageName = pageNameExtension.split('.')[0];
+    if (pageName === "print") {
+        // Don't render the table of contents on this page
+        return;
+    }
+
     // Only create table of contents if there is more than one header on the page
     if (headers.length <= 1) {
         return;