@techninja/clearstack 0.3.33 → 0.3.35

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.
@@ -25,9 +25,9 @@ still handles rendering for real users.
25
25
  ```yaml
26
26
  routes:
27
27
  /traits/:id:
28
- title: "{trait.emoji} {trait.name} | {app.name}"
29
- description: "{trait.description}"
30
- image: "{trait.cover_image.url}"
28
+ title: '{trait.emoji} {trait.name} | {app.name}'
29
+ description: '{trait.description}'
30
+ image: '{trait.cover_image.url}'
31
31
  data: trait_manifest.traits
32
32
  ```
33
33
 
@@ -41,16 +41,20 @@ export function buildMetaTags(meta) {
41
41
  }
42
42
 
43
43
  /**
44
- * Inject OG meta tags into an HTML shell (replaces <title> and adds meta).
44
+ * Inject OG meta tags into an HTML shell (replaces <title> and existing OG/twitter meta).
45
45
  * @param {string} html - The base index.html content
46
46
  * @param {OGMeta} meta
47
47
  * @returns {string}
48
48
  */
49
49
  export function injectMeta(html, meta) {
50
50
  const tags = buildMetaTags(meta);
51
+ // Strip existing OG and twitter meta tags (single or multi-line)
52
+ let cleaned = html.replace(/\s*<meta\s+(?:property="og:[^"]*"|name="twitter:[^"]*")[^>]*\/?>/g, '');
53
+ // Also strip standalone name="description" meta
54
+ cleaned = cleaned.replace(/\s*<meta\s+name="description"[^>]*\/?>/g, '');
51
55
  // Replace existing <title>...</title> with full meta block
52
- const withMeta = html.replace(/<title>[^<]*<\/title>/, tags);
53
- return withMeta;
56
+ cleaned = cleaned.replace(/<title>[^<]*<\/title>/, tags);
57
+ return cleaned;
54
58
  }
55
59
 
56
60
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techninja/clearstack",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
4
4
  "type": "module",
5
5
  "description": "A no-build web component framework specification — scaffold, validate, and evolve spec-compliant projects",
6
6
  "bin": {
@@ -25,9 +25,9 @@ still handles rendering for real users.
25
25
  ```yaml
26
26
  routes:
27
27
  /traits/:id:
28
- title: "{trait.emoji} {trait.name} | {app.name}"
29
- description: "{trait.description}"
30
- image: "{trait.cover_image.url}"
28
+ title: '{trait.emoji} {trait.name} | {app.name}'
29
+ description: '{trait.description}'
30
+ image: '{trait.cover_image.url}'
31
31
  data: trait_manifest.traits
32
32
  ```
33
33