登陆页面演示部分

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

先决条件

在架构或内容操作之前:确认共享 DatoCMS agent-skills 插件可用。如果缺少,询问用户是否已经安装;如果没有,请在继续之前请求安装。预计 DatoCMS MCP 已安装并运行。如果需要实时架构或内容事实并且 MCP 不可用,请暂停并要求用户安装或启动它。在采用 API 密钥、本地化字段、验证器、单例记录或允许的块之前,通过 MCP 检查实时模式/内容。

现有截面图案

营销页面使用此链:DatoCMS 块记录出现在本地化的page.sections 中。路由查询在app/[locale]/(common-layout)/[slug]/query.graphql中添加了一个内联片段。块碎片位于components/blocksWithVariants/<Typename>/fragment.graphql下。 React 渲染器位于 components/blocksWithVariants/<Typename>/<Variant>/ 下。

部分更改的工作流程

确认请求是关于常规页面正文部分,而不是布局、文档、内容记录维护或路由管道。通过MCP检查目标Page记录和sections验证器。当现有的块类型和变体与请求匹配时,重用它。如果需要新的块类型或字段,请将建模决策路由至datocms-content-modeling,并将模式实施路由至共享的 DatoCMS 实施技能或 MCP。

护栏

共享的页眉、页脚、导航、通知、徽标、社交链接和主题颜色属于landing-page-demo-layout。文档主页、文档页面、文档侧边栏和文档树结构属于landing-page-demo-docs。博客、作者、标签、推荐、定价等级、变更日志和法律记录都属于landing-page-demo-content-records,除非渲染器本身发生更改。新的路由支持类型、预览链接、静态参数、元数据和 SEO 分析映射属于 landing-page-demo-routing-preview。

验收标准

页面查询类型包括部分数据。当请求内容工作时,目标Page.sections包含预期的块。本地化部分保留了预期的区域设置覆盖范围。该部分以发布模式和草稿/实时预览呈现。现有部分仍然呈现不变。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@tomevault-io · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Landing Page Demo Sections

Use this for marketing page body sections in the landing page starter. Keep generic DatoCMS schema design and record operations in the shared DatoCMS skills.

## Prerequisites

Before schema or content operations:

- Confirm the shared DatoCMS `agent-skills` plugin is available. If it is missing, ask whether the user already has it installed; if not, request installation before continuing.
- Expect the DatoCMS MCP to be installed and running. If live schema or content facts are needed and MCP is unavailable, pause and ask the user to install or start it.
- Inspect live schema/content through MCP before assuming API keys, localized fields, validators, singleton records, or allowed blocks.

## Existing section pattern

Marketing pages use this chain:

1. A DatoCMS block record appears inside localized `page.sections`.
2. The route query adds an inline fragment in `app/[locale]/(common-layout)/[slug]/query.graphql`.
3. The block fragment lives under `components/blocksWithVariants/<Typename>/fragment.graphql`.
4. A React renderer lives under `components/blocksWithVariants/<Typename>/<Variant>/`.
5. `app/[locale]/(common-layout)/[slug]/Content.tsx` switches on `section.__typename` and display option fields.
6. GraphQL types are regenerated after query or fragment changes.

Existing section blocks: HeroSection, FeatureListSection, BrandSection, VideoSection, DetailSection, ReviewSection, PricingSection, FeaturedPostsSection, TeamSection, FaqSection, StatsSection, AboutIntro, AllPostsSection, RedirectSection, and ChangelogSection.

## Workflow for section changes

1. Confirm the request is about a regular page body section, not layout, docs, content-record maintenance, or route plumbing.
2. Inspect the target `Page` record and the `sections` validator through MCP.
3. Reuse an existing block type and variant when it matches the request.
4. If a new block type or field is needed, route modeling decisions to `datocms-content-modeling` and schema implementation to the shared DatoCMS implementation skills or MCP.
5. For end-to-end requests, update the real target `Page.sections` value, not only the code:
   - preserve existing sections and ordering unless the user specifies placement;
   - for localized `sections`, update all existing locale values unless the user requested one locale;
   - reuse existing linked records where possible;
   - if the page was published and the change should be public, publish the updated record.
6. Add or update the fragment and renderer under `components/blocksWithVariants/**`.
7. Update the route query and `Content.tsx` switch with the generated `__typename` and display option value.
8. Regenerate GraphQL types.
9. Verify the section in published rendering and draft/live preview.

## Guardrails

- Shared header, footer, navigation, notification, logo, social links, and theme color belong to `landing-page-demo-layout`.
- Docs home, docs pages, docs sidebar, and docs tree structure belong to `landing-page-demo-docs`.
- Blog, author, tag, testimonial, pricing tier, changelog, and legal records belong to `landing-page-demo-content-records` unless the renderer itself changes.
- New route-backed types, preview links, static params, metadata, and SEO-analysis mapping belong to `landing-page-demo-routing-preview`.
- Keep unknown section types safely ignored.

## Acceptance criteria

- The page query types include the section data.
- The target `Page.sections` contains the intended block when content work is requested.
- Localized sections keep the intended locale coverage.
- The section renders in published mode and draft/live preview.
- Existing sections still render unchanged.
- GraphQL type generation and build pass after code changes.

---
> Source: [datocms/next-landing-page-demo](https://github.com/datocms/next-landing-page-demo) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-22 -->

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。