@cogita/plugin-posts-frontmatter is the foundational content plugin for a blog site. It scans the posts directory, parses Markdown frontmatter, computes post routes, and exposes post data through virtual-posts-data for themes and other plugins.
Blog lists, tags, RSS, search, and SEO consumers read this data through the shared ContentIndex; they should not scan the same directory again.
The plugin supports .md and .mdx, walks nested directories, and provides sensible fallbacks for missing titles or dates. An absolute filePath is build-time data; runtime themes should consume only safe public fields.
With a posts directory and the posts route prefix:
Route calculation belongs to the shared utility boundary so RSS, search, and image consumers cannot produce different URLs for the same post.
A theme can declare the plugin, so most site authors only need to select the theme:
Custom consumers read the runtime module:
The plugin prepares the index in beforeBuild, creates post pages in addPages, and publishes post data in addRuntimeModules. Core invalidates the index before a development rebuild so new and edited posts enter the next build.
The plugin owns post discovery and metadata. It does not own tag filters, pagination, archives, RSS, or theme layouts. It should also expose empty runtime data when a site has no posts, preserving the zero-configuration experience.
The post virtual module exposes contentDataVersion. A theme or plugin should check the version before consuming the data and emit a diagnostic or degrade when it is incompatible. See the content index design and plugin API specification for shared capability and contract-version rules.
See the Chinese version for the same design in Chinese.