Architecture
YiiPress is a static website engine with two user-facing modes: build a production-ready static site, and serve a live local preview of that same generated output.
The same pipeline is used by both commands:
yiipress buildwrites the final static files.yiipress serverebuilds the same output directory and serves it with live reload for local preview.
Content Model
User content lives under content/:
config.yaml— site-wide settings.navigation.yaml— one or more navigation menus.<collection>/_collection.yaml— collection settings.<collection>/*.md— entries in a collection.authors/*.md— author profiles.assets/and<collection>/assets/— copied static files.
YiiPress turns those files into immutable model objects: site config, navigation, collections, entries, authors, taxonomies, and output pages. Entry settings are resolved in this order:
The first configured value wins. For example, an entry permalink overrides a collection permalink, which overrides the site-wide pattern.
Build Pipeline
- Parse — read config, collection files, author files, and entry front matter.
- Index — resolve permalinks, apply draft/future filters, sort collections, group taxonomies, build archives, and connect authors.
- Render — convert Markdown to HTML, apply processors, render PHP templates, and produce page objects.
- Write — write
index.html, feeds, sitemap, redirects, search index, copied assets, and other static files.
Runtime Modes
Build
yiipress build is the production path. It generates static files and exits. The generated output can be deployed to any static host and does not require PHP in production.
Serve
yiipress serve is the preview path. It serves files from output/, injects live reload into HTML responses, and triggers normal builds when content or templates change. Because preview uses the same generated files as production, build and serve output stay aligned.
Extension Points
- Templates control page HTML. See Templates.
- Content processors transform Markdown and rendered HTML. See Plugins.
- Lifecycle hooks expose PSR-14 build and render events for plugin behavior that is not a single content transformation. See Plugins.
- Importers convert external content sources into Markdown files. See Importing content.
Engine-level implementation details, dependency flow, source layout, caching strategy, and performance notes are in Engine.