In this guide you will create a docs-and-writing site, preview it locally, add a page, and build the exact folder a static host receives.
- Install the package
npm install tidypresspnpm add tidypress - Scaffold a publishing root
npx tidypress init --preset docs-writing --site-url https://docs.example.comTidyPress creates
site/, the default publish root. Use a real production URL when you know it; canonical URLs, Open Graph URLs, RSS, and sitemap output depend on it. - Start the development server
npx tidypress devOpen
http://localhost:4321. The CLI discoverssite/tidypress.config.tsfrom the repository root. - Publish a documentation page
Create
site/src/content/docs/first-build.mdx:--- title: First build description: Verify the complete author-to-artifact path. order: 2 --- <Steps> <Step title="Write">Edit this file in git.</Step> <Step title="Build">Run `npx tidypress build`.</Step> </Steps>MDX components are registered by the engine; no local import is needed.
- Build and inspect production output
npx tidypress build npx tidypress previewThe default artifact is
site/build/and includes static pages, bundled assets, the Pagefind index, andllms.txt. Search is a production-build feature, so validate it throughpreviewrather thandev.
What was created
- site/
- tidypress.config.ts
- public/
- src/
- content/
- docs/
- writing/
- pages/
- content/
- build/
The folder containing tidypress.config.ts is the publish root. The
src/content/docs/ folder is the docs collection. They are different
concepts even when the publish root happens to be named site/.
Choose a different starting shape
| Preset | Initial public shape |
|---|---|
lab | Writing and projects; docs and pages disabled |
blog | Writing only |
persona | Hero, projects, writing, and an About page |
docs-writing | Docs and writing |
body-of-work | Works, projects, writing, reference, and process; docs disabled |
body-of-work-docs | Body of work plus product docs |
custom | Docs, writing, and a sample playbooks collection |
default is an alias for lab.
Useful next commands
npx tidypress doctor
npx tidypress clean
npx tidypress build --output ./dist
npx tidypress build --no-llms-txt doctor checks the baseline setup. clean removes the publish-root build and
TidyPress cache. --output selects another build directory. --no-llms-txt
omits the agent-readable Markdown artifact for that build.