@se-studio/skills 1.8.1 → 1.8.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @se-studio/skills
2
2
 
3
+ ## 1.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Map page-test homepage canonical paths (`/`) to CMS slug `index` so control `indexed` is used instead of the variant's `noindex`.
8
+
3
9
  ## 1.8.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/skills",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "SE Studio agent skills for marketing site development with Contentful CMS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -138,7 +138,7 @@ If the slug is not a known variant in `testsByPath`, **return 404** (`notFound()
138
138
  Direct visits to a variant's own CMS URL (normal `[...slugs]` route) continue to use `generatePage` and show variant breadcrumbs.
139
139
 
140
140
  ```typescript
141
- import { findCanonicalPath } from '@se-studio/ab-testing';
141
+ import { controlSlugFromCanonicalPath, findCanonicalPath } from '@se-studio/ab-testing';
142
142
  import { joinCmsPathSegments } from '@se-studio/core-ui';
143
143
  import type { ResolvingMetadata } from 'next';
144
144
  import { notFound } from 'next/navigation';
@@ -174,7 +174,10 @@ export async function generateMetadata(
174
174
  ) {
175
175
  const { slug } = await extractDetails(props);
176
176
  const canonicalPath = requireCanonicalPath(slug);
177
- const canonicalSlug = canonicalPath.replace(/^\/|\/$/g, '') || slug;
177
+ // `/` → CMS slug `index`. Never `replace(...) || slug` — that uses the variant
178
+ // (indexed: false) and flip-flops robots on the homepage. generatePageTest*
179
+ // also re-resolves so a stale `|| slug` cannot noindex `/`.
180
+ const canonicalSlug = controlSlugFromCanonicalPath(canonicalPath);
178
181
  // Use generatePageTestMetadata: merges variant title/description with
179
182
  // canonical page's indexed flag so robots directives are always correct.
180
183
  return generatePageTestMetadata(slug, canonicalSlug, canonicalPath, getPageRouteConfig(canonicalSlug), parent);
@@ -183,12 +186,14 @@ export async function generateMetadata(
183
186
  export default async function (props: PageProps<'/page-test/[...slugs]'>) {
184
187
  const { slug } = await extractDetails(props);
185
188
  const canonicalPath = requireCanonicalPath(slug);
186
- const canonicalSlug = canonicalPath.replace(/^\/|\/$/g, '') || slug;
189
+ const canonicalSlug = controlSlugFromCanonicalPath(canonicalPath);
187
190
  // Use generatePageTest: variant contents with control identity (href, breadcrumbs, JSON-LD).
188
191
  return generatePageTest(slug, canonicalSlug, canonicalPath, getPageRouteConfig(canonicalSlug));
189
192
  }
190
193
  ```
191
194
 
195
+ If the site homepage CMS slug is not `index` (e.g. Pedestal `home`), pass it: `controlSlugFromCanonicalPath(canonicalPath, 'home')`.
196
+
192
197
  Also export `generatePageTestMetadata` and `generatePageTest` from the app's `src/lib/route-handlers.ts` destructuring alongside `generatePageMetadata`.
193
198
 
194
199
  ## See Also