@easy-web/seo 1.2.3 → 1.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-web/seo",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "Shared SEO primitives for @easy-web/* consumer instances — Astro integration wrapping @astrojs/sitemap with i18n hreflang, dynamic robots.txt route with noIndex mode, and <SeoHead> component (canonical, OpenGraph, Twitter Cards, hreflang, theme-color, manifest).",
6
6
  "keywords": [
@@ -18,7 +18,8 @@
18
18
  "types": "./dist/index.d.ts",
19
19
  "import": "./dist/index.js"
20
20
  },
21
- "./components/*": "./src/components/*.astro"
21
+ "./components/*": "./src/components/*.astro",
22
+ "./components/*.astro": "./src/components/*.astro"
22
23
  },
23
24
  "files": [
24
25
  "dist",
@@ -32,7 +33,7 @@
32
33
  },
33
34
  "dependencies": {
34
35
  "@astrojs/sitemap": "^3.7.3",
35
- "@easy-web/i18n": "1.2.3"
36
+ "@easy-web/i18n": "1.3.1"
36
37
  },
37
38
  "devDependencies": {
38
39
  "astro": "^6.4.0",
@@ -33,7 +33,7 @@ const {
33
33
  ogImage,
34
34
  themeColor,
35
35
  manifest,
36
- noIndex = false,
36
+ noIndex,
37
37
  twitterCard = 'summary',
38
38
  twitterSite,
39
39
  alternates = [],
@@ -61,7 +61,16 @@ const servedPath = toServedPath(pathname, servedStyle);
61
61
  // A self-referencing canonical is omitted for the same reason: it would assert
62
62
  // the page is a canonical destination while the body says the opposite.
63
63
  const isNotFoundRoute = servedPath.split('/').filter(Boolean).pop() === '404';
64
- const shouldNoIndex = noIndex || isNotFoundRoute;
64
+
65
+ // The crawl policy is resolved once by easyWebSeo() and published to the
66
+ // environment, exactly like the trailing-slash style above. Defaulting the prop
67
+ // to `false` instead of reading that value meant `easyWebSeo({ noIndex: true })`
68
+ // suppressed the sitemap and wrote a disallow-all robots.txt while every page
69
+ // still shipped without a robots meta tag — the integration and the document
70
+ // disagreeing about the same policy. An explicit prop still wins, so a single
71
+ // page can opt out of a site-wide setting.
72
+ const policyNoIndex = process.env.EASY_WEB_SEO_NO_INDEX === 'true';
73
+ const shouldNoIndex = (noIndex ?? policyNoIndex) || isNotFoundRoute;
65
74
 
66
75
  const canonical = new URL(servedPath, site).href;
67
76
  const absoluteOgImage = ogImage ? new URL(ogImage, site).href : undefined;