# Topics and discussions

Topics are lightweight discussions for announcements and conversation that does not fit the question-and-answer shape. They live under the `/d` namespace.

## The model

A topic has a title, Markdown body, author, category, locale, kind, status, and a last-activity timestamp. Comments on a topic form the thread.

**Kinds:** `discussion` and `announcement`.
**Statuses:** `draft`, `pending`, `published`, `hidden`.
**Flags:** pinned, locked.

## Admin actions

| Action | Effect |
|---|---|
| Publish | Makes the topic publicly visible and sitemap-eligible |
| Hide | Removes it from public view without deleting it |
| Pin | Keeps it at the top of the listing |
| Lock | Closes the reply box; the page explains why replies are unavailable |
| Delete | Removes the topic and its comments |

Moderator controls render visually separated from member actions on the public page, so a moderator does not accidentally act as a member or vice versa.

## Following a topic

When follows are enabled, a signed-in active member can follow a published topic. Following requires POST and a CSRF token; an unauthenticated request never mutates state. A locked topic may still be followed — locking closes replies, not interest.

When a new comment is published on a topic, its followers are notified, excluding the commenting member, and no follower is notified twice for one comment.

Unpublished or missing topics cannot be followed.

## Comment counters and activity

A topic comment increments the topic's `comments_count` and refreshes `last_activity_at` in the same transaction. `last_activity_at` is what the sitemap reports as `lastmod` and what the "active" listing order uses.

## Structured data

Member-authored topics emit `DiscussionForumPosting` with the body in the `text` property (not `articleBody`), plus author, publication and modification dates, canonical URL, and interaction statistics.

Topics authored by editorial or system personas emit an ordinary page schema instead. An editorial post is house content; presenting it as independent user-generated discussion would be a false claim.

See [SEO pipeline](../07-internals/SEO-PIPELINE.md).

## Events emitted

`topic.created`, `topic.published`, `topic.updated`, `topic.locked`, `topic.unlocked`, `topic.comment_created`.
