Overview
Architecture, data flow, and core behavior of Notepub.
Notepub has one core idea: keep your content in Markdown, then apply declarative rules to produce routes and HTML.
End-to-end flow
notepub index
- Reads markdown from
content.source(localors3). - Parses frontmatter.
- Applies
rules.yaml(types, permalinks, validations, links, collections). - Writes artifacts to
paths.artifacts_dir:resolve.jsonsearch.jsonsitemap-index.xmland chunkedsitemap-*.xmlrobots.txtcollections/*.json(if materialization is enabled)
notepub serve
- Loads
resolve.json. - Renders markdown on request with theme templates.
- Exposes endpoints like
/health,/metrics,/v1/search,/search,/media/*,/assets/*.
notepub build
- Uses the same resolve/render model.
- Produces static files in
dist/. - Copies theme assets and SEO artifacts.
- Generates
404.html.
Core concepts
- Content contract comes from frontmatter +
rules.fields. - URL structure comes from
rules.types.<type>.permalink. - Template selection comes from
rules.types.<type>.template. - Internal links can be resolved from fields and wikilinks.
- Collections are query definitions available in templates (runtime) and optionally materialized as JSON.
Serve vs build
- Use
servewhen you want a running app that can read from local/S3 and return dynamic routes. - Use
buildwhen you need pure static hosting (GitHub Pages, Netlify, Cloudflare Pages, S3 static hosting).
Newcomer recommendation
Start with Getting Started and do one full deploy before changing rules deeply.