← back to 1950swallpaper
rails: tag-aware via shared rail-match helper + editorial LABELS (rescue flat grid)
074230b3ed8f4f082cb5af4fb676ff9e83fd4af8 · 2026-05-26 10:40:55 -0700 · SteveStudio2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files touched
M public/index.htmlM server.jsM site.config.json
Diff
commit 074230b3ed8f4f082cb5af4fb676ff9e83fd4af8
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Tue May 26 10:40:55 2026 -0700
rails: tag-aware via shared rail-match helper + editorial LABELS (rescue flat grid)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
public/index.html | 2 +-
server.js | 12 ++++--------
site.config.json | 10 ++++------
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/public/index.html b/public/index.html
index 4e4753c..0e30178 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","mid-century":"Mid-Century Atomic"};
+const LABELS = {"all":"All","mid-century":"Mid-Century Atomic","mid-century modern":"Mid-Century Modern","geometric":"Geometric","abstract":"Abstract","contemporary":"Contemporary"};
function escAttr(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&':'&','<':'<','>':'>','"':'"',"'":''' }[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 8981d5f..0b806e0 100644
--- a/server.js
+++ b/server.js
@@ -19,6 +19,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 : [];
@@ -199,18 +200,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 739022c..ff7e709 100644
--- a/site.config.json
+++ b/site.config.json
@@ -10,12 +10,10 @@
"accent": "#d8a878"
},
"rails": [
- "atomic",
- "boomerang",
- "starburst",
- "pastel",
- "mid-century",
- "geometric"
+ "mid-century modern",
+ "geometric",
+ "abstract",
+ "contemporary"
],
"port": 9908
}
← 86ff78a rails: editorial labels for firing aesthetic buckets
·
back to 1950swallpaper
·
Revert "rails: tag-aware via shared rail-match helper + edit 32e412e →