« 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--README.md14
-rw-r--r--src/static/css/site.css4
-rw-r--r--src/static/js/client-util.js17
-rw-r--r--src/static/js/client/image-overlay.js2
-rw-r--r--src/urls-default.yaml2
5 files changed, 30 insertions, 9 deletions
diff --git a/README.md b/README.md
index 9ee1cafb..22f6eb55 100644
--- a/README.md
+++ b/README.md
@@ -128,6 +128,20 @@ If your shell is **zsh,** enter these contents:
 
 Then use `source env.sh` when starting work from the CLI to get access to all the convenient environment variables.
 
+## Notes for developers
+
+### Which platform features are OK for hsmusic-wiki!?
+
+Here's how to decide when new programming language features are ready for use in hsmusic-wiki:
+
+- **Build-code JS** (anything *not* in the browser): Whatever is supported in the latest LTS release of node.js. We hung out on 20.x for a needlessly long time; now we're calling that we can update to the latest LTS at any point.
+
+- **Client JS:** This one's mucky, but target stuff available across latest browsers since three years ago (to the month). It's generally possible for individual client modules to fail and even for graceful fallbacks where we notice, so it's not the end of the world for stuff to slip through a little early.
+
+- **Client HTML and CSS:** Firmer focus on only using what was available across browsers three years ago (to the month). Utterly ornamental CSS can use newer features, but only if it's flat-out necessary and does not impact the usability of the site at all (i.e. if the CSS fails then it's just as though that ornament weren't added).
+
+We haven't noted whether caniuse and MDN are based on different data sets or not, but *out of convenience,* we usually use MDN now that it shows this "Baseline" box for a lot of features, with month-year compat info up front. We're aware that these resources are never perfect, so pay closer attention before committing to huge new JS APIs, etc.
+
   [discord]: https://hsmusic.wiki/discord/
   [fandom]: https://homestuck-and-mspa-music.fandom.com/wiki/Homestuck_and_MSPA_Music_Wiki
   [cgit-code]: https://nebula.ed1.club/git/hsmusic-wiki
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 8bb978e0..e38b5e0d 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -3053,12 +3053,12 @@ html[data-language-code="preview-en"][data-url-key="localized.home"] #content
     max-width: 375px;
   }
 
-  html[data-url-key="localized.home"] #page-container.showing-sidebar-left .grid-listing > .grid-item:not(:nth-child(n+7)) {
+  html[data-url-key="localized.home"] #page-container.showing-sidebar-left .grid-listing > .grid-item:not(:nth-child(n+10)) {
     flex-basis: 23%;
     margin: 15px;
   }
 
-  html[data-url-key="localized.home"] #page-container.showing-sidebar-left .grid-listing > .grid-item:nth-child(n+7) {
+  html[data-url-key="localized.home"] #page-container.showing-sidebar-left .grid-listing > .grid-item:nth-child(n+10) {
     flex-basis: 18%;
     margin: 10px;
   }
diff --git a/src/static/js/client-util.js b/src/static/js/client-util.js
index f06b707a..71112313 100644
--- a/src/static/js/client-util.js
+++ b/src/static/js/client-util.js
@@ -1,12 +1,19 @@
 /* eslint-env browser */
 
 export function rebase(href, rebaseKey = 'rebaseLocalized') {
-  const relative = (document.documentElement.dataset[rebaseKey] || '.') + '/';
-  if (relative) {
-    return relative + href;
-  } else {
-    return href;
+  let result = document.documentElement.dataset[rebaseKey] || './';
+
+  if (!result.endsWith('/')) {
+    result += '/';
+  }
+
+  if (href.startsWith('/')) {
+    href = href.slice(1);
   }
+
+  result += href;
+
+  return result;
 }
 
 export function cssProp(el, ...args) {
diff --git a/src/static/js/client/image-overlay.js b/src/static/js/client/image-overlay.js
index b51d57a4..1e0ebd75 100644
--- a/src/static/js/client/image-overlay.js
+++ b/src/static/js/client/image-overlay.js
@@ -170,7 +170,7 @@ function getImageSources(details) {
     };
   } else {
     return {
-      mainSrc: originalSrc,
+      mainSrc: details.originalSrc,
       thumbSrc: null,
       mainThumb: '',
       thumbThumb: '',
diff --git a/src/urls-default.yaml b/src/urls-default.yaml
index 10bc0d23..dce871f6 100644
--- a/src/urls-default.yaml
+++ b/src/urls-default.yaml
@@ -11,7 +11,7 @@ yamlAliases:
   # part of a build. This is so that multiple builds of a wiki can coexist
   # served from the same server / file system root: older builds' HTML files
   # refer to earlier values of STATIC_VERSION, avoiding name collisions.
-  - &staticVersion 3p4
+  - &staticVersion 4p1
 
 data:
   prefix: 'data/'