« get me outta code hell

tweaks to transformMultiline - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-01 22:06:11 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-01 22:06:11 -0400
commit35c569ae4adbe2854762019f4b2f530a0f662c48 (patch)
treeeb055e31d9bd5c0f86ee3ef39e6314a5558dd5cc
parent6ba58403ea491e7176f793e964f14142e73aa14b (diff)
tweaks to transformMultiline
-rw-r--r--src/page/homepage.js10
-rw-r--r--src/strings-default.json1
-rwxr-xr-xsrc/upd8.js12
-rw-r--r--src/util/find.js2
4 files changed, 19 insertions, 6 deletions
diff --git a/src/page/homepage.js b/src/page/homepage.js
index 882daf7..0ae2b9b 100644
--- a/src/page/homepage.js
+++ b/src/page/homepage.js
@@ -154,8 +154,10 @@ export function writeTargetless({wikiData}) {
         content:
           transformMultiline(
             homepageLayout.sidebarContent
-              .replace('[[news]]', '__GENERATE_NEWS__')
-          )
+              .replace('[[news]]', '__GENERATE_NEWS__'),
+            {
+              thumb: 'medium',
+            })
             .replace('<p>__GENERATE_NEWS__</p>',
               wikiInfo.enableNews
                 ? [
@@ -179,7 +181,9 @@ export function writeTargetless({wikiData}) {
                               link.newsEntry(entry),
                             ]),
 
-                            transformMultiline(entry.contentShort),
+                            transformMultiline(entry.contentShort, {
+                              thumb: 'medium',
+                            }),
 
                             entry.contentShort !== entry.content &&
                               link.newsEntry(entry, {
diff --git a/src/strings-default.json b/src/strings-default.json
index e8245d6..f9c1db8 100644
--- a/src/strings-default.json
+++ b/src/strings-default.json
@@ -157,6 +157,7 @@
   "misc.external.patreon": "Patreon",
   "misc.external.poetryFoundation": "Poetry Foundation",
   "misc.external.soundcloud": "SoundCloud",
+  "misc.external.spotify": "Spotify",
   "misc.external.tumblr": "Tumblr",
   "misc.external.twitter": "Twitter",
   "misc.external.wikipedia": "Wikipedia",
diff --git a/src/upd8.js b/src/upd8.js
index a30b9b7..fad3c7d 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -212,6 +212,10 @@ const replacerSpec = {
     find: 'album',
     link: 'albumCommentary',
   },
+  'album-gallery': {
+    find: 'album',
+    link: 'albumGallery',
+  },
   artist: {
     find: 'artist',
     link: 'artist',
@@ -392,7 +396,11 @@ function joinLineBreaks(sourceLines) {
   return outLines;
 }
 
-function transformMultiline(text, {parseAttributes, transformInline}) {
+function transformMultiline(text, {
+  parseAttributes,
+  transformInline,
+  thumb = null,
+}) {
   // Heck yes, HTML magics.
 
   text = transformInline(text.trim());
@@ -442,7 +450,7 @@ function transformMultiline(text, {parseAttributes, transformInline}) {
       img({
         lazy: true,
         link: true,
-        thumb: 'medium',
+        thumb,
         ...parseAttributes(attributes),
       })
     );
diff --git a/src/util/find.js b/src/util/find.js
index ed0a680..dcb15b3 100644
--- a/src/util/find.js
+++ b/src/util/find.js
@@ -114,7 +114,7 @@ function matchTagName(ref, data, quiet) {
 }
 
 const find = {
-  album: findHelper(['album', 'album-commentary']),
+  album: findHelper(['album', 'album-commentary', 'album-gallery']),
   artist: findHelper(['artist', 'artist-gallery']),
   artTag: findHelper(['tag'], {byName: matchTagName}),
   flash: findHelper(['flash']),