« get me outta code hell

cachebust - 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>2021-01-12 12:38:33 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-01-12 12:38:33 -0400
commit97f532acaf49e314081ebd91d466da281147c8c7 (patch)
tree09f805274cdc7d5eb8deb017168d6d7464343d1b
parent0b20efeb113fd51291dee3e4cfa76e044c22ce2e (diff)
cachebust
-rw-r--r--upd8.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/upd8.js b/upd8.js
index 94c054d8..4adc5469 100644
--- a/upd8.js
+++ b/upd8.js
@@ -116,6 +116,8 @@ const {
 
 const C = require('./common/common');
 
+const CACHEBUST = 1;
+
 const SITE_CANONICAL_BASE = 'https://hsmusic.wiki/';
 const SITE_TITLE = 'Homestuck Music Wiki';
 const SITE_SHORT_TITLE = 'HSMusic';
@@ -1283,8 +1285,8 @@ async function writePage(directoryParts, {
                 <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>
+                <link rel="stylesheet" href="${C.STATIC_DIRECTORY}/site.css?${CACHEBUST}">
+                <script src="${C.STATIC_DIRECTORY}/lazy-loading.js?${CACHEBUST}"></script>
             </head>
             <body ${attributes({style: body.style || ''})}>
                 <div id="page-container">
@@ -1296,8 +1298,8 @@ async function writePage(directoryParts, {
                     `}
                     ${layoutHTML}
                 </div>
-                <script src="${C.COMMON_DIRECTORY}/common.js"></script>
-                <script src="${C.STATIC_DIRECTORY}/client.js"></script>
+                <script src="${C.COMMON_DIRECTORY}/common.js?${CACHEBUST}"></script>
+                <script src="${C.STATIC_DIRECTORY}/client.js?${CACHEBUST}"></script>
             </body>
         </html>
     `));