[object Object]

← back to Carmelwallpapers

pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback

0b699bc71dc2581409a4d868ef0ca07565a8bff5 · 2026-05-25 20:46:12 -0700 · Steve Abrams

Files touched

Diff

commit 0b699bc71dc2581409a4d868ef0ca07565a8bff5
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 25 20:46:12 2026 -0700

    pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback
---
 scripts/pull-from-shopify.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/pull-from-shopify.js b/scripts/pull-from-shopify.js
index b92bddf..646199e 100644
--- a/scripts/pull-from-shopify.js
+++ b/scripts/pull-from-shopify.js
@@ -8,6 +8,8 @@
 const https = require('https');
 const fs = require('fs');
 const path = require('path');
+const { classifyAesthetic } = require('../../_shared/microsite-aesthetic');
+const SITE_CFG_RAILS = (() => { try { return require('../site.config.json').rails || []; } catch { return []; } })();
 
 // Niche tags — match any of these
 const COASTAL_TAGS = /^(grasscloth|sisal|seagrass|jute|linen|raffia|rattan|bamboo|woven|coastal|botanical|natural|organic|hemp|cane|abaca|rush|wicker|palm|sea grass|boucle|bouclé|texture|handwoven|hand woven|natural fiber|fiber|earthy|neutral|sand|stone|stone wash|pebble|driftwood|shell|coral)$/i;
@@ -50,6 +52,12 @@ function aestheticOf(tags, title) {
   return 'natural';
 }
 
+function classifyForSite(tags, title) {
+  const railsMatch = classifyAesthetic(tags, SITE_CFG_RAILS);
+  if (railsMatch && railsMatch !== 'all') return railsMatch;
+  return aestheticOf(tags, title);
+}
+
 (async () => {
   console.log('Pulling DW /products.json (up to 30 pages)…');
   const all = [];
@@ -80,7 +88,7 @@ function aestheticOf(tags, title) {
       image_url: p.images[0].src,
       images: p.images.slice(0, 4).map(i => i.src),
       tags: p.tags || [],
-      aesthetic: aestheticOf(p.tags, p.title),
+      aesthetic: classifyForSite(p.tags, p.title),
       product_url: `https://designerwallcoverings.com/products/${p.handle}`,
       sample_url: `https://designerwallcoverings.com/products/${p.handle}#sample`,
     }));

← c78d2c2 retag aesthetic from PG: 833 rows updated  ·  back to Carmelwallpapers  ·  fix: scrub p.vendor leaks from customer-facing UI (use "Desi fafb001 →