Skip to content

Add taxonomy collection and dynamic taxonomy page template#408

Merged
zz-plant merged 1 commit into
mainfrom
codex/build-template-driven-taxonomy-page-system
Jan 16, 2026
Merged

Add taxonomy collection and dynamic taxonomy page template#408
zz-plant merged 1 commit into
mainfrom
codex/build-template-driven-taxonomy-page-system

Conversation

@zz-plant

Copy link
Copy Markdown
Owner

Motivation

  • Provide a template-driven taxonomy system so taxonomy pages are authored from a single structured source and render consistently across the site.
  • Capture lightweight metadata (owner, scope, readiness) and related artifacts with enough entries to avoid thin content and allow parent/sibling/child navigation to be derived automatically.

Description

  • Add src/content/taxonomy.json seeded with 15+ taxonomy entries describing slug, owner, scope, readiness, summary, and related artifacts.
  • Add src/content/taxonomy.ts with TypeScript types and an exported taxonomyEntries array.
  • Extend src/content.config.ts with a taxonomy collection and Zod schema (taxonomyEntrySchema and taxonomyArtifactSchema) so the collection is validated at build time.
  • Add an Astro route template src/pages/taxonomy/[...slug].astro that prerenders and uses getStaticPaths to create pages for each entry and renders summary, metadata panel, related artifacts, and links to parent, sibling, and child taxonomy levels.
  • Update docs/content-data.md with guidance for the taxonomy schema and validation notes.

Testing

  • Ran bun run check (parallel checks) which includes Lint, Unit Tests, Typecheck, Astro Check, Validate JSON, and Validate Glossary, and all checks passed.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 16, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
et3 89663d4 Commit Preview URL

Branch Preview URL
Jan 16 2026, 01:15 AM

@zz-plant zz-plant merged commit 0b6e906 into main Jan 16, 2026
1 of 2 checks passed
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zz-plant, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a robust, template-driven taxonomy system for the site. It enables the creation of consistently structured taxonomy pages by centralizing content in a JSON file, validating its structure with Zod schemas, and dynamically rendering pages with rich metadata and navigational capabilities. The primary goal is to provide a scalable and maintainable way to organize and present hierarchical content, ensuring a uniform user experience across all taxonomy-related pages.

Highlights

  • New Taxonomy Collection: Introduced a new taxonomy content collection, defined by src/content/taxonomy.json, to manage structured taxonomy entries.
  • Dynamic Taxonomy Page Template: Added an Astro route template (src/pages/taxonomy/[...slug].astro) that dynamically generates individual taxonomy pages, including navigation for parent, sibling, and child levels.
  • Schema Validation: Implemented Zod schemas (taxonomyEntrySchema and taxonomyArtifactSchema) in src/content.config.ts to ensure build-time validation of taxonomy data, enforcing consistency and required metadata.
  • TypeScript Integration: Created src/content/taxonomy.ts to provide TypeScript types for taxonomy entries and artifacts, enhancing type safety and developer experience.
  • Content Guidance: Updated docs/content-data.md with specific guidelines for authoring taxonomy entries, emphasizing nested slugs for navigation and the importance of populating metadata fields.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a new taxonomy system, which is a great addition for organizing content. The changes include new data files, TypeScript types, and Astro content collection schemas. My review focuses on improving the robustness and maintainability of the new code. I've suggested strengthening the Zod schema validation for taxonomy artifacts to ensure data consistency and prevent invalid links. I also recommended a structural improvement to automatically infer TypeScript types from the Zod schemas, which will make future maintenance easier and less error-prone. Overall, this is a well-structured feature addition.

Comment thread src/content.config.ts
Comment on lines +63 to +67
const taxonomyArtifactSchema = z.object({
label: z.string(),
href: z.string(),
type: z.string(),
});

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.

medium

The taxonomyArtifactSchema can be made more robust and consistent with other schemas in the project.

  1. HREF Validation: The href field is a plain string. To prevent invalid links, you could add validation to ensure it's a valid URL or path. A similar validation is already used for the href field in the participation collection's openSource schema.
  2. Type Enum: The type field currently accepts any string. Based on the data in src/content/taxonomy.json, there's a specific set of artifact types. Using z.enum() for this field would enforce consistency and prevent typos.

Here is a suggested update:

Suggested change
const taxonomyArtifactSchema = z.object({
label: z.string(),
href: z.string(),
type: z.string(),
});
const taxonomyArtifactSchema = z.object({
label: z.string(),
href: z.string().refine((val) => ["http", "/", "#", "mailto:"].some(prefix => val.startsWith(prefix)), { message: "href must be a valid URL, mailto, or path" }),
type: z.enum(["agenda", "catalog", "doctrine", "framework", "guide", "playbook", "policy", "program", "reference", "research", "standard", "tools", "workflow"]),
});

Comment thread src/content/taxonomy.ts
Comment on lines +3 to +18
export type TaxonomyArtifact = {
label: string;
href: string;
type: string;
};

export type TaxonomyEntry = {
id: string;
title: string;
slug: string;
summary: string;
owner: string;
scope: string;
readiness: "draft" | "alpha" | "beta" | "stable";
relatedArtifacts: TaxonomyArtifact[];
};

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.

medium

To improve maintainability and prevent types from becoming out of sync with their corresponding Zod schemas, consider deriving the TypeScript types directly from the schemas using z.infer.

Currently, TaxonomyArtifact and TaxonomyEntry are defined manually, duplicating the structure from src/content.config.ts. This is error-prone, as a change in one place requires a manual update in the other.

By co-locating the schemas and types (e.g., moving the Zod schemas from content.config.ts to this file) and using z.infer, you can ensure they are always synchronized. content.config.ts can then import the schemas from here.

For example:

import { z } from "zod";

export const taxonomyArtifactSchema = z.object({
  // ... schema definition
});
export type TaxonomyArtifact = z.infer<typeof taxonomyArtifactSchema>;

export const taxonomyEntrySchema = z.object({
  // ... schema definition
});
export type TaxonomyEntry = z.infer<typeof taxonomyEntrySchema>;

This approach makes the codebase more robust and easier to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant