← back to 1970swallpaper
rails: tag-aware via shared rail-match helper + editorial LABELS (rescue flat grid)
0955fdc905be37d92d4d2a460e88acec785cb633 · 2026-05-26 10:41:01 -0700 · SteveStudio2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files touched
M package-lock.jsonM public/index.htmlM server.jsM site.config.json
Diff
commit 0955fdc905be37d92d4d2a460e88acec785cb633
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Tue May 26 10:41:01 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>
---
package-lock.json | 13 +++++++++++++
public/index.html | 2 +-
server.js | 11 +++--------
site.config.json | 10 +++++-----
4 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 78d8151..781a4e9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,7 @@
"name": "the-1970s-wallpaper",
"version": "0.1.0",
"dependencies": {
+ "dotenv": "^17.4.2",
"express": "^4.21.0",
"helmet": "^8.1.0"
}
@@ -172,6 +173,18 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/dotenv": {
+ "version": "17.4.2",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
+ "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
diff --git a/public/index.html b/public/index.html
index f582ea8..6a5e7da 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","geometric":"Geometric & Op-Art"};
+const LABELS = {"all":"All","geometric":"Geometric & Op-Art","burnt orange":"Burnt Orange & Harvest Tones","retro":"Retro Classics","mid-century modern":"Mid-Century Modern","botanical":"Botanical & Organic","avocado":"Avocado Green"};
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 de9a210..81fb289 100644
--- a/server.js
+++ b/server.js
@@ -21,6 +21,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 : [];
@@ -185,19 +186,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 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 2ddaafa..b7e4571 100644
--- a/site.config.json
+++ b/site.config.json
@@ -10,11 +10,11 @@
"accent": "#d4a047"
},
"rails": [
- "earth-tone",
- "disco",
- "flower-power",
"geometric",
- "organic",
- "novelty"
+ "burnt orange",
+ "retro",
+ "mid-century modern",
+ "botanical",
+ "avocado"
]
}
← 82a22ac rails: editorial labels for firing aesthetic buckets
·
back to 1970swallpaper
·
Revert "rails: tag-aware via shared rail-match helper + edit 0d007e4 →