A CMS is integrated as a middleware that returns a page.
How to create a CMS middleware
You can create a middleware by writing a JavaScript module:
- that exports a handler function that accepts optionally, a props object (only data, no functions)
- and returns a function that accepts a web api request and returns a page as object:
- with as default, a mandatory React Element
- and optionally, a frontmatter and a toc
Example
- You can take a look to the local markdown middleware file, it's a CMS plugin that returns local Markdown file as page.
- The remote Markdown example page provider that returns Markdown page from GitHub.