[object Object]

← back to 1920swallpaper

rails: tag-aware via shared rail-match helper + editorial LABELS (rescue flat grid)

73c49ec1e0e728a503b506df106eb1111991df11 · 2026-05-26 10:40:08 -0700 · SteveStudio2

Files touched

Diff

commit 73c49ec1e0e728a503b506df106eb1111991df11
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Tue May 26 10:40:08 2026 -0700

    rails: tag-aware via shared rail-match helper + editorial LABELS (rescue flat grid)
---
 public/index.html |  2 +-
 server.js         | 12 ++++--------
 site.config.json  | 12 ++++++------
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/public/index.html b/public/index.html
index 2dfab3d..9c2e6f2 100644
--- a/public/index.html
+++ b/public/index.html
@@ -509,7 +509,7 @@ const TOUCH = window.matchMedia('(hover: none)').matches;
     document.documentElement.dataset.view = state.view;
   } catch(e){}
 })();
-const LABELS = {"all":"All","art-deco":"Art Deco"};
+const LABELS = {"all":"All","art-deco":"Art Deco","sophisticated":"Sophisticated","abstract":"Abstract","gold":"Gold & Gilded","glamorous":"Glamorous","fretwork":"Fretwork","gray":"Gray Tones"};
 
 function escAttr(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;' }[c])); }
 // Image-URL allowlist: only DW Shopify CDN + designerwallcoverings.com (defends against XSS via crafted products.json)
diff --git a/server.js b/server.js
index a46ced9..5b2ed94 100644
--- a/server.js
+++ b/server.js
@@ -20,6 +20,7 @@ if (ADMIN_ENABLED) {
   try { catalog = require('../_shared/admin-catalog'); }
   catch (e) { console.error(`[${__SITE}] admin-catalog unavailable (${e.message}) — falling back to static JSON`); }
 }
+const { buildRails, railFacets } = require('../_shared/rail-match');
 const siteCfg = JSON.parse(fs.readFileSync(path.join(__dirname, 'site.config.json'), 'utf8'));
 const SITE_SLUG = siteCfg.slug || __SITE;
 const SITE_RAILS = Array.isArray(siteCfg.rails) ? siteCfg.rails : [];
@@ -180,18 +181,13 @@ app.get('/api/products', (req, res) => {
 });
 
 app.get('/api/sliders', (req, res) => {
-  const out = [];
-  for (const a of SITE_RAILS) {
-    const items = PRODUCTS_NICHE.filter(p => p.aesthetic === a).slice(0, 12);
-    if (items.length >= 4) out.push({ aesthetic: a, items });
-  }
-  res.json({ rails: out });
+  res.json({ rails: buildRails(PRODUCTS_NICHE, SITE_RAILS) });
 });
 
 app.get('/api/facets', (req, res) => {
-  const aesthetics = {}; const vendors = {};
+  const aesthetics = railFacets(PRODUCTS_NICHE, SITE_RAILS);
+  const vendors = {};
   for (const p of PRODUCTS_NICHE) {
-    aesthetics[p.aesthetic] = (aesthetics[p.aesthetic] || 0) + 1;
     vendors[p.vendor] = (vendors[p.vendor] || 0) + 1;
   }
   res.json({ aesthetics, vendors, total: PRODUCTS_NICHE.length });
diff --git a/site.config.json b/site.config.json
index 8f25c29..a307c93 100644
--- a/site.config.json
+++ b/site.config.json
@@ -10,11 +10,11 @@
     "accent": "#d4a847"
   },
   "rails": [
-    "art-deco",
-    "geometric",
-    "metallic",
-    "jazz",
-    "egyptian-revival",
-    "flapper"
+    "sophisticated",
+    "abstract",
+    "gold",
+    "glamorous",
+    "fretwork",
+    "gray"
   ]
 }

← 4b5511f rails: editorial labels for firing aesthetic buckets  ·  back to 1920swallpaper  ·  Revert "rails: tag-aware via shared rail-match helper + edit 9a65133 →