@growth-labs/seo 0.2.4 → 0.2.5

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": "@growth-labs/seo",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -17,9 +17,21 @@ export interface Props {
17
17
  * differs from the request URL (e.g. canonicalizing away trailing slash).
18
18
  */
19
19
  canonical?: URL | string
20
+
21
+ /**
22
+ * Emit the `<link rel="alternate" type="text/markdown">` pointer for the
23
+ * current page. Defaults to `true`, matching 0.2.3/0.2.4 behavior.
24
+ *
25
+ * Pass `false` on routes where no `.md` twin exists (homepage, tag
26
+ * indexes, landing pages, search) to avoid a link that 404s. Suppressing
27
+ * the twin link here does NOT suppress other head tags — Apple News
28
+ * discovery still emits, centralized in one place rather than wrapping
29
+ * the whole `<AeoHead />` in a conditional.
30
+ */
31
+ emitTwinLink?: boolean
20
32
  }
21
33
 
22
- const { canonical } = Astro.props
34
+ const { canonical, emitTwinLink = true } = Astro.props
23
35
  const config = getConfig()
24
36
  const aeo = resolveAeoTwins(config.aeoTwins)
25
37
 
@@ -46,7 +58,7 @@ function defaultTwinUrl(url: string): string {
46
58
  }
47
59
 
48
60
  const twinHref =
49
- aeo && aeo.mode !== 'middleware'
61
+ emitTwinLink && aeo && aeo.mode !== 'middleware'
50
62
  ? (aeo.twinUrl ?? defaultTwinUrl)(pageUrl)
51
63
  : null
52
64
  ---