« get me outta code hell

content, data: WikiInfo.wikiWallpaperFileExtension - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-27 12:37:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-27 12:37:57 -0300
commited627b0723d49bae62e5534e749f6905542702aa (patch)
tree05a9d1001504783cd05635a052799100417f3ccd /src
parent37122b700c27435a8d8487f0d474a5c52f685e59 (diff)
content, data: WikiInfo.wikiWallpaperFileExtension
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generatePageLayout.js4
-rw-r--r--src/data/things/wiki-info.js7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index f6158e7f..2a4f5ae2 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -28,12 +28,14 @@ export default {
     wikiColor: wikiInfo.color,
     wikiName: wikiInfo.nameShort,
     canonicalBase: wikiInfo.canonicalBase,
+    wikiWallpaperFileExtension: wikiInfo.wikiWallpaperFileExtension,
   }),
 
   data: (sprawl) => ({
     wikiColor: sprawl.wikiColor,
     wikiName: sprawl.wikiName,
     canonicalBase: sprawl.canonicalBase,
+    wikiWallpaperFileExtension: sprawl.wikiWallpaperFileExtension,
   }),
 
   relations(relation, sprawl) {
@@ -593,7 +595,7 @@ export default {
       (styleRulesCSS.match(/body::before[^}]*background-image:/)
         ? ''
         : `body::before {\n` +
-          `    background-image: url("${to('media.path', 'bg.jpg')}");\n` +
+          `    background-image: url("${to('media.path', 'bg.' + data.wikiWallpaperFileExtension)}");\n` +
           `}`);
 
     const goshFrigginDarnitStyleRule =
diff --git a/src/data/things/wiki-info.js b/src/data/things/wiki-info.js
index 590598be..0bea709f 100644
--- a/src/data/things/wiki-info.js
+++ b/src/data/things/wiki-info.js
@@ -14,7 +14,7 @@ import {
 } from '#validators';
 
 import {exitWithoutDependency} from '#composite/control-flow';
-import {contentString, flag, name, referenceList, soupyFind}
+import {contentString, fileExtension, flag, name, referenceList, soupyFind}
   from '#composite/wiki-properties';
 
 export class WikiInfo extends Thing {
@@ -68,6 +68,8 @@ export class WikiInfo extends Thing {
       },
     },
 
+    wikiWallpaperFileExtension: fileExtension('jpg'),
+
     divideTrackListsByGroups: referenceList({
       class: input.value(Group),
       find: soupyFind.input('group'),
@@ -117,7 +119,10 @@ export class WikiInfo extends Thing {
       'Footer Content': {property: 'footerContent'},
       'Default Language': {property: 'defaultLanguage'},
       'Canonical Base': {property: 'canonicalBase'},
+      'Wiki Wallpaper File Extension': {property: 'wikiWallpaperFileExtension'},
+
       'Divide Track Lists By Groups': {property: 'divideTrackListsByGroups'},
+
       'Enable Flashes & Games': {property: 'enableFlashesAndGames'},
       'Enable Listings': {property: 'enableListings'},
       'Enable News': {property: 'enableNews'},