hubspot-cms-sync 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubspot-cms-sync",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Git-backed bidirectional sync for HubSpot CMS themes, content, blogs, forms, and assets.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -95,7 +95,12 @@ const REF_BEARING = (relPath) => {
95
95
  return (
96
96
  p === 'js/hs-forms.js' ||
97
97
  p.endsWith('.module/fields.json') ||
98
- p.endsWith('.module/module.html')
98
+ p.endsWith('.module/module.html') ||
99
+ // Page templates (incl. shared partials) may carry @asset refs to content
100
+ // assets (e.g. og:image, founder/product photos). Resolve them to the
101
+ // target's hosted URL on push, same as module.html — keeps content images
102
+ // (webp included, which the theme source rejects) out of the theme tree.
103
+ (p.startsWith('templates/') && p.endsWith('.html'))
99
104
  );
100
105
  };
101
106
 
@@ -261,7 +261,10 @@ export function renderPost(post, { siteDir, site, baseUrl = '', assetBase = '/as
261
261
  nav_active: null,
262
262
  nav_hide_cta: false,
263
263
  };
264
- return env.render(template, context);
264
+ // Resolve @asset refs that live in the TEMPLATE itself (not just content fields)
265
+ // e.g. og:image or img src pointing at content assets. Idempotent: already-resolved
266
+ // content has no @asset tokens left.
267
+ return resolveStaticRefs(env.render(template, context), { assetBase });
265
268
  }
266
269
 
267
270
  // ---------------------------------------------------------------------------
@@ -292,7 +295,7 @@ export function renderPage(page, { siteDir, site, baseUrl = '', assetBase = '/as
292
295
  nav_active: null,
293
296
  nav_hide_cta: false,
294
297
  };
295
- return env.render(page.template, context);
298
+ return resolveStaticRefs(env.render(page.template, context), { assetBase });
296
299
  }
297
300
 
298
301
  // ---------------------------------------------------------------------------
@@ -313,7 +316,7 @@ export function renderBlogListing(posts, { siteDir, site, baseUrl = '', assetBas
313
316
  nav_active: null,
314
317
  nav_hide_cta: false,
315
318
  };
316
- return env.render('templates/blog.html', context);
319
+ return resolveStaticRefs(env.render('templates/blog.html', context), { assetBase });
317
320
  }
318
321
 
319
322
  export { postContent, pageContent, assetUrl, localizeDate, makeEnv };