astro-tractstack 2.0.0-rc.41 → 2.0.0-rc.43

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": "astro-tractstack",
3
- "version": "2.0.0-rc.41",
3
+ "version": "2.0.0-rc.43",
4
4
  "description": "Astro integration for TractStack - redeeming the web from boring experiences",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -85,13 +85,12 @@ const defaultSocialDesc =
85
85
  description ||
86
86
  brandConfig.OGDESC ||
87
87
  `No-code website builder and content marketing platform`;
88
- const buildVersion = (() => {
89
- if (modDatetime) return modDatetime.getTime();
90
- if (pubDatetime) return pubDatetime.getTime();
91
- return Date.now();
92
- })();
93
- const socialImageWithVersion = `${defaultSocialImageURL}?v=${buildVersion}`;
94
- const socialLogoWithVersion = `${defaultSocialLogoURL}?v=${buildVersion}`;
88
+ const socialImageFullURL = brandConfig?.SITE_URL
89
+ ? `${brandConfig.SITE_URL.replace(/\/$/, '')}${defaultSocialImageURL}`
90
+ : `${defaultSocialImageURL}`;
91
+ const socialLogoFullURL = brandConfig?.SITE_URL
92
+ ? `${brandConfig.SITE_URL.replace(/\/$/, '')}${defaultSocialLogoURL}`
93
+ : `${defaultSocialLogoURL}`;
95
94
  const gtagId = brandConfig?.GTAG || false;
96
95
  const gtagUrl =
97
96
  typeof gtagId === `string` && gtagId.length > 1
@@ -144,14 +143,14 @@ const enableBunny = import.meta.env.PUBLIC_ENABLE_BUNNY === 'true';
144
143
  <meta property="og:type" content="website" />
145
144
  <meta property="og:description" content={defaultSocialDesc} />
146
145
  <meta property="og:url" content={fullCanonicalUrl} />
147
- <meta property="og:image" content={socialImageWithVersion} />
148
- <meta property="og:logo" content={socialLogoWithVersion} />
146
+ <meta property="og:image" content={socialImageFullURL} />
147
+ <meta property="og:logo" content={socialLogoFullURL} />
149
148
 
150
149
  <meta property="twitter:card" content="summary_large_image" />
151
150
  <meta property="twitter:url" content={fullCanonicalUrl} />
152
151
  <meta property="twitter:title" content={defaultSocialTitle} />
153
152
  <meta property="twitter:description" content={defaultSocialDesc} />
154
- <meta property="twitter:image" content={socialImageWithVersion} />
153
+ <meta property="twitter:image" content={socialImageFullURL} />
155
154
 
156
155
  {
157
156
  pubDatetime && (
@@ -13,6 +13,7 @@ export interface StoryData {
13
13
  menu: any;
14
14
  isHome: boolean;
15
15
  created: string;
16
+ socialImagePath?: string | null;
16
17
  }
17
18
 
18
19
  export async function getStoryData(
@@ -102,11 +102,17 @@ const brandConfig = await getBrandConfig(tenantId);
102
102
  if (!brandConfig.SITE_INIT) {
103
103
  return Astro.redirect('/storykeep');
104
104
  }
105
+
106
+ const ogImage =
107
+ typeof storyData.socialImagePath === `string`
108
+ ? storyData.socialImagePath
109
+ : undefined;
105
110
  ---
106
111
 
107
112
  <Layout
108
113
  title={storyfragmentTitle}
109
114
  slug={lookup || brandConfig.HOME_SLUG}
115
+ ogImage={ogImage}
110
116
  menu={storyData.menu || null}
111
117
  created={storyData.created}
112
118
  isContext={false}