hubspot-cms-sync 0.5.0 → 0.5.1
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 +1 -1
- package/src/lib/render.mjs +6 -0
package/package.json
CHANGED
package/src/lib/render.mjs
CHANGED
|
@@ -228,6 +228,12 @@ function makeEnv(siteDir, { site, opts }) {
|
|
|
228
228
|
env.addFilter('format_date', formatDate);
|
|
229
229
|
|
|
230
230
|
env.addGlobal('get_asset_url', assetUrl);
|
|
231
|
+
// Absolute site origin from the build's baseUrl (e.g. https://www2.7thsense.io).
|
|
232
|
+
// Templates need it for absolute URLs that relative paths can't satisfy —
|
|
233
|
+
// og:image/twitter:image especially, which social scrapers reject when relative.
|
|
234
|
+
// Empty string on the HubSpot target (where baseUrl is unset), so a template
|
|
235
|
+
// that does `base_url ~ '/assets/x'` yields a root-relative path there.
|
|
236
|
+
env.addGlobal('base_url', opts.baseUrl || '');
|
|
231
237
|
env.addGlobal('html_lang', opts.lang || 'en');
|
|
232
238
|
env.addGlobal('html_lang_dir', '');
|
|
233
239
|
env.addGlobal('standard_header_includes', opts.headerIncludes || '');
|