← back to Dw Discovery
keep images[1] as image2 (room-setting) for the discovery viewer
221b6993d23cff2828c12bd71823da2712a86e09 · 2026-06-30 17:32:32 -0700 · Steve Abrams
Files touched
Diff
commit 221b6993d23cff2828c12bd71823da2712a86e09
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Jun 30 17:32:32 2026 -0700
keep images[1] as image2 (room-setting) for the discovery viewer
---
build-staged.cjs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/build-staged.cjs b/build-staged.cjs
index 4e27709..ccf237e 100644
--- a/build-staged.cjs
+++ b/build-staged.cjs
@@ -18,6 +18,7 @@ const out=all.map((p,i)=>{
const rollV=(p.variants||[]).slice().sort((a,b)=>parseFloat(b.price)-parseFloat(a.price))[0]||{};
const raw=colorRaw(tags); const bucket=bucketOf(raw)||'Neutral';
const img=(p.images&&p.images[0]&&p.images[0].src)||null;
+ const img2=(p.images&&p.images[1]&&p.images[1].src)||null; // 2nd image = room-setting shot when present
const pub=new Date(p.published_at||p.created_at||now);
return {id:i+1, sku:(rollV.sku||p.handle||('DW-'+(i+1))), title:titleClean(p.title), vendor:p.vendor||'Designer Wallcoverings',
category:p.product_type||'Wallcovering', subtype:pick(tags,SUBTYPES)||(p.product_type||'Wallcovering'),
@@ -25,7 +26,7 @@ const out=all.map((p,i)=>{
width_in:numFrom(tags,/(\d+(?:\.\d+)?)\s*"?\s*(?:inch|in\b)?\s*(?:wide|width)/i),
repeat_in:numFrom(tags,/(\d+(?:\.\d+)?)\s*"?\s*(?:v\s*)?repeat/i),
price:parseFloat(rollV.price)||0, inStock:(p.variants||[]).some(v=>v.available)!==false,
- featured:false, createdDaysAgo:Math.round((now-pub)/864e5), image:img};
+ featured:false, createdDaysAgo:Math.round((now-pub)/864e5), image:img, image2:img2};
}).filter(p=>p.image && p.price>0);
fs.writeFileSync('data/products.staged.json', JSON.stringify(out));
const cnt=f=>{const m={};out.forEach(p=>m[p[f]]=(m[p[f]]||0)+1);return Object.keys(m).length;};
← a3289a2 dw-discovery: default name + image card toggles to off
·
back to Dw Discovery
·
(newest)