> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_13/session_04_content_collections_and_publishing_templates.md).

# Session 04: Content Collections And Publishing Templates

**Session ID**: `phase13-session04-content-collections-and-publishing-templates` **Package**: public-website **Status**: Complete **Estimated Tasks**: \~18-24 **Estimated Duration**: 2-4 hours

***

## Objective

Create typed blog and news collections with list/detail templates, draft filtering, seed content, and RSS-ready metadata.

***

## Scope

### In Scope (MVP)

* Implement `src/content.config.ts` with `blog` and `news` collections.
* Validate frontmatter with `astro/zod`.
* Create blog index and dynamic post routes.
* Create news index and dynamic post routes.
* Build shared content layout and post metadata components.
* Add post cards, tag list, collection hero, and related-post affordances if useful.
* Exclude drafts from production output.
* Permit visible draft badges in development templates.
* Add seed blog and news entries realistic enough to validate templates, RSS, sitemap, tags, and metadata.
* Include reading time or equivalent metadata if easy and dependency-light.

### Out of Scope

* Full editorial calendar.
* Search.
* CMS integration.
* Tag archive pages unless needed for the first template pass.
* Generated social images.

***

## Prerequisites

* [x] Session 01 completed.
* [x] Session 03 SEO component and site data available or stubbed.

***

## Deliverables

1. `src/content.config.ts` defining typed `blog` and `news` collections.
2. `src/pages/blog/index.astro` and `src/pages/blog/[...slug].astro`.
3. `src/pages/news/index.astro` and `src/pages/news/[...slug].astro`.
4. Shared content layout and content components.
5. Seed blog entries:
   * `introducing-factionos.md`
   * `local-first-agent-observability.md`
   * `why-agent-work-needs-a-cockpit.md`
6. Seed news entries:
   * `initial-public-website.md`
   * `public-demo-available.md`

***

## Collection Schema

Shared fields:

* `title`: string.
* `description`: string.
* `pubDate`: date.
* `updatedDate`: optional date.
* `draft`: boolean default false.
* `tags`: string array default empty.
* `heroImage`: optional image.
* `canonicalUrl`: optional URL.
* `author`: optional string.

News-specific optional fields:

* `category`: enum `release`, `changelog`, `company`, `press`.
* `version`: optional string.

Blog content types to support:

* Agent observability essays.
* Local-first architecture decisions.
* Gamification design.
* Product launch posts.
* Technical explainers.

News content types to support:

* Changelog items.
* Company updates.
* Release notes.
* Press announcements.

***

## Task Expansion Guidance

When expanded with `plansession`, keep the checklist to 18-24 tasks covering:

* Content config.
* Schema validation.
* Seed content.
* Blog list route.
* Blog detail route.
* News list route.
* News detail route.
* Shared content layout.
* Post card.
* Post metadata.
* Tags.
* Draft filtering.
* RSS integration.
* Sitemap validation.
* Build and typecheck.

***

## Success Criteria

* [ ] Blog and news indexes render.
* [ ] Dynamic post routes render.
* [ ] Invalid frontmatter fails type/schema validation.
* [ ] Drafts are excluded from production output.
* [ ] RSS feed builds with non-draft content.
* [ ] Seed content is specific to FactionOS and does not read like placeholder lorem ipsum.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_13/session_04_content_collections_and_publishing_templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
