« get me outta code hell

launch of hsmusic.wiki - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2020-12-11 12:59:35 -0400
committer(quasar) nebula <towerofnix@gmail.com>2020-12-11 12:59:35 -0400
commit326fd3b8798a0af13d34baf87ab746d91fe40de9 (patch)
tree37783e4fe068c248ef00bad875271fc01c76e552
parent57ed5af37ed3cd8be8b38bf9666bc5fa739ebec1 (diff)
launch of hsmusic.wiki
-rw-r--r--upd8.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/upd8.js b/upd8.js
index 8c3afe41..7a9d95f1 100644
--- a/upd8.js
+++ b/upd8.js
@@ -105,10 +105,11 @@ const {
 
 const C = require('./common/common');
 
+const SITE_CANONICAL_BASE = 'https://hsmusic.wiki/';
 const SITE_TITLE = 'Homestuck Music Wiki';
 const SITE_SHORT_TITLE = 'HSMusic';
-const SITE_VERSION = 'autumnal polish haul';
-const SITE_RELEASE = '10 October 2020';
+const SITE_VERSION = 'launch of hsmusic.wiki';
+const SITE_RELEASE = '12 December 2020';
 
 const SITE_DONATE_LINK = 'https://liberapay.com/nebula';
 
@@ -1010,6 +1011,12 @@ async function writePage(directoryParts, {
     const file = path.join(directory, 'index.html');
     const href = path.join(...directoryParts, 'index.html');
 
+    let targetPath = directoryParts.join('/');
+    if (directoryParts.length) {
+        targetPath += '/';
+    }
+    const canonical = SITE_CANONICAL_BASE + targetPath;
+
     const mainHTML = main.content && fixWS`
         <main id="content" ${classes(...main.classes || [])}>
             ${main.content}
@@ -1093,6 +1100,7 @@ async function writePage(directoryParts, {
                 <meta charset="utf-8">
                 <meta name="viewport" content="width=device-width, initial-scale=1">
                 ${Object.entries(meta).map(([ key, value ]) => `<meta ${key}="${escapeAttributeValue(value)}">`).join('\n')}
+                <link rel="canonical" href="${canonical}">
                 <link rel="stylesheet" href="${C.STATIC_DIRECTORY}/site.css">
                 <script src="${C.STATIC_DIRECTORY}/lazy-loading.js"></script>
             </head>