Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 116 additions & 77 deletions .agents/references/components.md

Large diffs are not rendered by default.

218 changes: 111 additions & 107 deletions .agents/references/style-guide.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*.ts @cloudflare/content-engineering @kodster28
*.astro @cloudflare/content-engineering @kodster28
package.json @cloudflare/content-engineering
/src/schemas/tags.ts @cloudflare/content-engineering @kodster28
/src/util/api.ts @cloudflare/content-engineering @kodster28
/src/content/workers-ai-models/ @craigsdennis @cloudflare/content-engineering @cloudflare/product-owners @kodster28
/public/__redirects @cloudflare/content-engineering @cloudflare/product-owners
Expand Down Expand Up @@ -268,7 +267,7 @@ package.json @cloudflare/content-engineering

/src/content/docs/support/ @cloudflare/product-owners @cloudflare/customer-support @ngayerie
/src/assets/images/support/ @cloudflare/product-owners @cloudflare/customer-support @ngayerie
/src/content/docs/billing/ @cloudflare/customer-support @cloudflare/product-owners @ngayerie
/src/content/docs/billing/ @cloudflare/customer-support @cloudflare/product-owners @ngayerie

# Turnstile

Expand Down
56 changes: 25 additions & 31 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ pcx_content_type: how-to # Page type (see below)
sidebar:
order: 1 # Sort order in sidebar
label: Custom Label # Override sidebar text
tags: # Optional, validated against allowlist
- JavaScript
- Workers
products: # References to src/content/products/ entries
- workers
difficulty: Beginner # For tutorials: Beginner | Intermediate | Advanced
Expand All @@ -85,8 +82,6 @@ reviewed: 2025-01-15 # YYYY-MM-DD of last content review

Valid `pcx_content_type` values: `changelog`, `concept`, `configuration`, `design-guide`, `example`, `faq`, `get-started`, `how-to`, `integration-guide`, `implementation-guide`, `learning-unit`, `navigation`, `overview`, `reference`, `reference-architecture`, `reference-architecture-diagram`, `release-notes`, `solution-guide`, `troubleshooting`, `tutorial`, `video`.

Tags are validated against an allowlist in `src/schemas/tags.ts`. Invalid tags will fail the build.

### Writing and style rules

For MDX syntax, links, code blocks, formatting, and writing style, see `.agents/references/style-guide.md`. That file is the canonical agent reference — distilled from the full style guide at `src/content/docs/style-guide/`.
Expand Down Expand Up @@ -181,26 +176,25 @@ A separate Semgrep workflow checks style guide compliance (dates, "coming soon"
8. **Skipping heading levels** — H2 then H4 without H3 will violate style guide rules.
9. **`$` prefix in terminal commands** — the copy button copies verbatim, including the `$`.
10. **Invalid changelog product folders** — the product directory must exist in `src/content/products/`.
11. **Invalid tags** — tags are validated against the allowlist in `src/schemas/tags.ts`.
12. **Redirect issues** — source URLs in `public/__redirects` must end in `/` (or `*`, `.xml`, `.json`, `.html`). No fragments in source URLs. No infinite loops.
13. **Hand-crafted directory entry IDs** — never manually write `id` values in `src/content/directory/` files. Always run `node tools/directory-entry-ids --fix` to generate them.
11. **Redirect issues** — source URLs in `public/__redirects` must end in `/` (or `*`, `.xml`, `.json`, `.html`). No fragments in source URLs. No infinite loops.
12. **Hand-crafted directory entry IDs** — never manually write `id` values in `src/content/directory/` files. Always run `node tools/directory-entry-ids --fix` to generate them.

## Content collections

The site defines 20 content collections in `src/content.config.ts` with schemas in `src/schemas/`. The major ones:

| Collection | Location | Description |
| ------------------- | -------------------------------- | --------------------------------------- |
| `docs` | `src/content/docs/` | Main documentation pages (MDX) |
| `partials` | `src/content/partials/` | Reusable content snippets (MDX) |
| `changelog` | `src/content/changelog/` | Product changelogs (MDX) |
| `glossary` | `src/content/glossary/` | Glossary terms (YAML) |
| `products` | `src/content/products/` | Product metadata (YAML) |
| `plans` | `src/content/plans/` | Plan/pricing data (YAML) |
| `workers-ai-models` | `src/content/workers-ai-models/` | AI model definitions (JSON) |
| Collection | Location | Description |
| ------------------- | -------------------------------- | ---------------------------------------- |
| `docs` | `src/content/docs/` | Main documentation pages (MDX) |
| `partials` | `src/content/partials/` | Reusable content snippets (MDX) |
| `changelog` | `src/content/changelog/` | Product changelogs (MDX) |
| `glossary` | `src/content/glossary/` | Glossary terms (YAML) |
| `products` | `src/content/products/` | Product metadata (YAML) |
| `plans` | `src/content/plans/` | Plan/pricing data (YAML) |
| `workers-ai-models` | `src/content/workers-ai-models/` | AI model definitions (JSON) |
| `directory` | `src/content/directory/` | Product/feature directory entries (YAML) |
| `fields` | `src/content/fields/` | Ruleset engine field definitions (YAML) |
| `learning-paths` | `src/content/learning-paths/` | Learning path definitions (JSON) |
| `fields` | `src/content/fields/` | Ruleset engine field definitions (YAML) |
| `learning-paths` | `src/content/learning-paths/` | Learning path definitions (JSON) |

### Directory entry IDs

Expand Down Expand Up @@ -255,22 +249,22 @@ Existing components (`warp-download`, `stream-player`, `rule-id`, `check-box`, `

Repo-specific skills live in `.agents/skills/`. Each skill provides specialized instructions for a particular task. Load a skill when the task matches its description.

| Skill | When to use |
| ----- | ----------- |
| `changelog` | Creating, editing, or reviewing changelog entries |
| `code-review` | Reviewing Workers/platform code for type correctness and API usage |
| `dependabot-review` | Analyzing a Dependabot PR for impact on this repo |
| `docs-review` | Reviewing documentation PRs for style, structure, and correctness |
| `eli5` | Simplifying technical documentation for broader audiences |
| `pr` | Creating or updating GitHub pull requests |
| Skill | When to use |
| ------------------- | ------------------------------------------------------------------ |
| `changelog` | Creating, editing, or reviewing changelog entries |
| `code-review` | Reviewing Workers/platform code for type correctness and API usage |
| `dependabot-review` | Analyzing a Dependabot PR for impact on this repo |
| `docs-review` | Reviewing documentation PRs for style, structure, and correctness |
| `eli5` | Simplifying technical documentation for broader audiences |
| `pr` | Creating or updating GitHub pull requests |

Shared reference files in `.agents/references/`:

| File | Contents |
| ---- | -------- |
| File | Contents |
| ---------------- | ----------------------------------------------------------- |
| `style-guide.md` | Canonical writing and formatting rules for all content work |
| `components.md` | Full MDX component catalog with props and usage examples |
| `procedures.md` | Rules for writing step-by-step procedural instructions |
| `components.md` | Full MDX component catalog with props and usage examples |
| `procedures.md` | Rules for writing step-by-step procedural instructions |

## Commit conventions

Expand Down
2 changes: 0 additions & 2 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export default defineConfig({
"/rules/transform/examples/?operation=*",
"/ruleset-engine/rules-language/fields/reference/**",
"/workers/examples/?languages=*",
"/workers/examples/?tags=*",
"/workers/llms-full.txt",
"/workers-ai/models/**",
"/markdown.zip",
Expand Down Expand Up @@ -221,7 +220,6 @@ export default defineConfig({
headingLinks: false,
processedDirs: ["./src/content/partials/", "./src/content/changelog/"],
},
routeMiddleware: "./src/plugins/starlight/route-data.ts",
disable404Route: true,
}),
liveCode({}),
Expand Down
3 changes: 0 additions & 3 deletions src/components/ResourcesBySelector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type LearningPathsData = keyof CollectionEntry<"learning-paths">["data"];
type ResourcesData = DocsData | VideosData | LearningPathsData;

const props = z.object({
tags: z.string().array().optional(),
types: z.string().array(),
products: reference("directory").array().optional(),
directory: z.string().optional(),
Expand All @@ -30,7 +29,6 @@ const props = z.object({
});

const {
tags,
types,
products,
directory,
Expand All @@ -52,7 +50,6 @@ const filteredResources = [...docs, ...videos, ...learningPaths].filter(
return (
types.includes(type ?? "") &&
(directory ? id.startsWith(directory) : true) &&
(tags ? data.tags?.some((v: string) => tags.includes(v)) : true) &&
(products
? data.products?.some((v) =>
products.some((p) => p.id === (typeof v === "object" ? v.id : v)),
Expand Down
71 changes: 0 additions & 71 deletions src/components/TagsUsage.astro

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export { default as ResourcesBySelector } from "./ResourcesBySelector.astro";
export { default as RSSButton } from "./RSSButton.astro";
export { default as RuleID } from "./RuleID.astro";
export { default as Stream } from "./Stream.astro";
export { default as TagsUsage } from "./TagsUsage.astro";
export { default as TunnelCalculator } from "./TunnelCalculator.astro";
export { default as Type } from "./Type.astro";
export { default as TypeScriptExample } from "./TypeScriptExample.astro";
Expand Down
1 change: 0 additions & 1 deletion src/components/overrides/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ metaTags.map((attrs) => {
});
---


<script src="src/scripts/footnotes.ts"></script>
<script src="src/scripts/mermaid.ts"></script>
<script src="src/scripts/analytics.ts"></script>
Expand Down
10 changes: 0 additions & 10 deletions src/content/docs/pages/framework-guides/deploy-a-hono-site.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ Every time you commit new code to your Hono site, Cloudflare Pages will automati

## Related resources

### Tutorials

For more tutorials involving Hono and Cloudflare Pages, refer to the following resources:

<ResourcesBySelector
tags={["Hono"]}
types={["tutorial"]}
products={["pages"]}
/>

### Demo apps

For demo applications using Hono and Cloudflare Pages, refer to the following resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ export default defineEventHandler(({ context }) => {

## Related resources

### Tutorials

For more tutorials involving Nuxt, refer to the following resources:

<ResourcesBySelector tags={["Nuxt"]} types={["tutorial"]} />

### Demo apps

For demo applications using Nuxt, refer to the following resources:
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/rules/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ We have a separate listing for [Cache rules examples](/cache/how-to/cache-rules/
<ResourcesBySelector
directory="rules"
types={["example"]}
filterables={["products", "tags"]}
filterables={["products"]}
/>
6 changes: 1 addition & 5 deletions src/content/docs/rules/snippets/examples/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ Refer to the following examples to get started creating your snippet code.

Refer to [How Snippets work](/rules/snippets/how-it-works/) and [Create a snippet in the dashboard](/rules/snippets/create-dashboard/) for overall guidance.

<ResourcesBySelector
directory="rules/snippets/examples"
filterables={["tags"]}
types={["example"]}
/>
<ResourcesBySelector directory="rules/snippets/examples" types={["example"]} />
1 change: 0 additions & 1 deletion src/content/docs/rules/transform/examples/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ import { ResourcesBySelector } from "~/components";
<ResourcesBySelector
directory="rules/transform/examples/"
types={["example"]}
filterables={["tags"]}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import { ExternalResources } from "~/components";
import { ExternalResources } from "~/components";

## Demo apps

<ExternalResources type="apps" tags={["AI"]} products={["Pages"]} />

## Videos

<ExternalResources type="videos" tags={["AI"]} />
```

Expand All @@ -43,8 +45,6 @@ The type of resources to show, apps or videos.

Filter resources down to those where the `tags` property contains any of these strings.

To see a list of the available tags, and which pages are associated with them, refer to [this list](/style-guide/frontmatter/tags/).

### `products`

**type:** `string[]`
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/style-guide/components/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To choose the right component for your use case, browse this table which contain
| [`PackageManagers`](/style-guide/components/package-managers) | <p>Command switcher tabs. Display equivalent installation or execution commands for different package managers.</p> <Example> ![DirectoryListing component example](~/assets/images/style-guide/ui-elements/packagemanagers-example.png) </Example> |
| [`Plan`](/style-guide/components/plan/) | <p>Product plan availability badge. Show the plan required for a product or specific feature.</p> <Example> ![Plan component example](~/assets/images/style-guide/ui-elements/plan-example.png) </Example> |
| [`RelatedProduct`](/style-guide/components/related-product/) | <p>Formatted product reference. Visually highlight and link to a specific, complementary Cloudflare product, also featuring the product's logo.</p> <Example> ![RelatedProduct component example](~/assets/images/style-guide/ui-elements/relatedproduct-example.png) </Example> |
| [`ResourcesBySelector`](/style-guide/components/resources-by-selector/) | <p>Filterable code example library. Pull and display lists of code examples and resources based on tags and content type.</p> <Example> ![ResourcesBySelector component example](~/assets/images/style-guide/ui-elements/resourcesbyselector-example.png) </Example> |
| [`ResourcesBySelector`](/style-guide/components/resources-by-selector/) | <p>Filterable code example library. Pull and display lists of code examples and resources based on content type or products.</p> <Example> ![ResourcesBySelector component example](~/assets/images/style-guide/ui-elements/resourcesbyselector-example.png) </Example> |
| [`Stream`](/style-guide/components/stream/) | <p>Embeddable video player. Display a video player optimized for Cloudflare Stream.</p> <Example> ![Stream example](~/assets/images/style-guide/ui-elements/stream-example.png) </Example> |
| [`Tabs` and `TabItem`](/style-guide/components/tabs/) | <p>Switchable content tabs. Allow easy switching between content views for different code languages or configuration methods.</p> <Example> ![Tabs example](~/assets/images/style-guide/ui-elements/tabs-example.png) </Example> |
| [`Type` and `MetaInfo`](/style-guide/components/type-highlighting/) | <p>Pill-shaped data type badge and metadata annotation about a field or property. `Type` indicates API parameter data types (`String`, `Integer`) and `MetaInfo` indicates metadata constraints (`Required`, `Optional`, `Read-only`).</p> <Example> ![Type and MetaInfo example](~/assets/images/style-guide/ui-elements/type-example.png) </Example> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ products:

import { Type, MetaInfo } from "~/components";

The `ResourcesBySelector` component allows you to pull in documentation resources based on the `pcx_content_type`, `tags` and `products` frontmatter properties.
The `ResourcesBySelector` component allows you to pull in documentation resources based on the `pcx_content_type` and `products` frontmatter properties.

## Component

Expand All @@ -19,7 +19,7 @@ import { ResourcesBySelector } from "~/components";
<ResourcesBySelector
directory="workers/examples/"
types={["example"]}
filterables={["tags"]}
filterables={["products"]}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example was updated, but the rest of this file still references the deleted tags prop and filterables={["tags"]} (lines 12 and 34–44). Please clean those up too.

/>
```

Expand All @@ -31,18 +31,12 @@ import { ResourcesBySelector } from "~/components";

- `filterables` <Type text="string[]" />

An array of frontmatter properties to show in the frontend filter dropdown. For example, `filterables={["tags"]}` will allow users to filter based on each pages' `tags` frontmatter.
An array of frontmatter properties to show in the frontend filter dropdown. For example, `filterables={["products"]}` will allow users to filter based on each pages' `products` frontmatter.

- `types` <Type text="string[]" />

An array of `pcx_content_type` values to filter which content gets pulled into the component. For example, `types={["example"]}`.

- `tags` <Type text="string[]" /> <MetaInfo text="optional" />

An array of `tags` values to filter which content gets pulled into the component. For example, `tags={["AI"]}`.

To see a list of the available tags, and which pages are associated with them, refer to [this list](/style-guide/frontmatter/tags/).

- `products` <Type text="string[]" /> <MetaInfo text="optional" />

An array of `products` values to filter which content gets pulled into the component. For example, `products={["D1"]}`.
Expand Down
36 changes: 0 additions & 36 deletions src/content/docs/style-guide/frontmatter/tags.mdx

This file was deleted.

Loading