« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateSocialEmbed.js20
-rw-r--r--src/data/things/album.js14
-rw-r--r--src/data/things/track.js8
-rw-r--r--src/replacer.js20
-rw-r--r--src/static/css/site.css4
-rw-r--r--src/static/js/client/image-overlay.js2
6 files changed, 47 insertions, 21 deletions
diff --git a/src/content/dependencies/generateSocialEmbed.js b/src/content/dependencies/generateSocialEmbed.js
index 115dc262..513ea518 100644
--- a/src/content/dependencies/generateSocialEmbed.js
+++ b/src/content/dependencies/generateSocialEmbed.js
@@ -1,7 +1,5 @@
-import {getOrigin} from '#urls';
-
 export default {
-  extraDependencies: ['html', 'language', 'urls', 'wikiData'],
+  extraDependencies: ['absoluteTo', 'html', 'language', 'wikiData'],
 
   sprawl({wikiInfo}) {
     return {
@@ -28,7 +26,7 @@ export default {
     imagePath: {validate: v => v.strictArrayOf(v.isString)},
   },
 
-  generate(data, slots, {html, language, urls}) {
+  generate(data, slots, {absoluteTo, html, language}) {
     switch (slots.mode) {
       case 'html':
         return html.tags([
@@ -44,19 +42,7 @@ export default {
           slots.imagePath &&
             html.tag('meta', {
               property: 'og:image',
-              content:
-                (() => {
-                  const toResult =
-                    urls
-                      .from('shared.root')
-                      .to(...slots.imagePath);
-
-                  if (getOrigin(toResult)) {
-                    return toResult;
-                  } else {
-                    return '/' + toResult;
-                  }
-                })(),
+              content: absoluteTo(...slots.imagePath),
             }),
         ]);
 
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 5f1788f8..6bf683c5 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -348,7 +348,12 @@ export class Album extends Thing {
 
   static [Thing.findSpecs] = {
     album: {
-      referenceTypes: ['album', 'album-commentary', 'album-gallery'],
+      referenceTypes: [
+        'album',
+        'album-commentary',
+        'album-gallery',
+      ],
+
       bindTo: 'albumData',
 
       getMatchableNames: album =>
@@ -358,7 +363,12 @@ export class Album extends Thing {
     },
 
     albumWithArtwork: {
-      referenceTypes: ['album'],
+      referenceTypes: [
+        'album',
+        'album-referencing-artworks',
+        'album-referenced-artworks',
+      ],
+
       bindTo: 'albumData',
 
       include: album =>
diff --git a/src/data/things/track.js b/src/data/things/track.js
index ff4750db..af2206f0 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -600,6 +600,7 @@ export class Track extends Thing {
   static [Thing.findSpecs] = {
     track: {
       referenceTypes: ['track'],
+
       bindTo: 'trackData',
 
       getMatchableNames: track =>
@@ -626,7 +627,12 @@ export class Track extends Thing {
     },
 
     trackWithArtwork: {
-      referenceTypes: ['track'],
+      referenceTypes: [
+        'track',
+        'track-referencing-artworks',
+        'track-referenced-artworks',
+      ],
+
       bindTo: 'trackData',
 
       include: track =>
diff --git a/src/replacer.js b/src/replacer.js
index e3f5623e..68361488 100644
--- a/src/replacer.js
+++ b/src/replacer.js
@@ -26,6 +26,16 @@ export const replacerSpec = {
     link: 'linkAlbumGallery',
   },
 
+  'album-referenced-artworks': {
+    find: 'albumWithArtwork',
+    link: 'linkAlbumReferencedArtworks',
+  },
+
+  'album-referencing-artworks': {
+    find: 'albumWithArtwork',
+    link: 'linkAlbumReferencingArtworks',
+  },
+
   'artist': {
     find: 'artist',
     link: 'linkArtist',
@@ -144,6 +154,16 @@ export const replacerSpec = {
     find: 'track',
     link: 'linkTrackDynamically',
   },
+
+  'track-referenced-artworks': {
+    find: 'trackWithArtwork',
+    link: 'linkTrackReferencedArtworks',
+  },
+
+  'track-referencing-artworks': {
+    find: 'trackWithArtwork',
+    link: 'linkTrackReferencingArtworks',
+  },
 };
 
 // Syntax literals.
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 514154a5..8bb978e0 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -3097,6 +3097,10 @@ html[data-language-code="preview-en"][data-url-key="localized.home"] #content
   .grid-listing > .grid-item {
     flex-basis: 40%;
   }
+
+  .wiki-search-sidebar-box {
+    max-height: max(245px, 60vh, calc(100vh - 205px));
+  }
 }
 
 /* Layout - Thin (phones) */
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: '',