This is the multi-page printable view of this section. Click here to print.
Build
1 - CI/CD
Prettier formatting
We use Prettier to format Docsy and the website files using the following command:
npm run check:format
To fix formatting, run Prettier: npm run fix:format.
i18n workaround
The translation files in the i18n directory are formatted using Prettier. But
Prettier removes the blank line before the # Feedback section heading. This
seems to be a known issue, for example see:
- Bug: Inconsistent newline formatting in YAML when changing scopes #15528
- Bug: New Line before comments at end of YAML files are removed #15720
We’ve worked around this bug, and avoided using prettier-ignore directives, by
formatting the preceding entry in the YAML file to be a block scalar, like this:
community_guideline: >-
Contribution Guidelines
This ensures that the blank line is preserved. Hopefully Prettier will be fixed and we’ll be able to remove this hack.
2 - Git repo info and branch model
Monorepo
The main Docsy repository is effectively a monorepo containing the Docsy:
- Theme at the repo root
- Website in the
docsy.devdirectory. The website uses the Docsy theme, of course, with extra styling.
These two projects are kept in sync at release points, but they may diverge between releases, usually to allow the website to ship doc content and UX improvements without forcing a theme release.
The main Docsy example site is Goldydocs, located in the Docsy example site repository.
Branch model
This repository’s branch model is as follows:
main: development branch for the next theme release and next site content.release: release and maintenance branch for the current stable theme version- Publishing branches used by Netlify:
deploy/prod: production site for the current stable release docs.doc-rooted: production branch for the doc-rooted site variant.- These branches determine what is published. They are not feature development branches.
The Goldydocs repo has the same model, except for doc-rooted which is not
used.
Tags
- Tags are used for official theme releases.
- Tags are created from
release.
Workflow
General workflow
Theme and site work is done on
main.When ready to release:
- Stable release: fast-forward merge from
maintorelease. - Patch release: create and merge a release PR from
maintorelease, e.g., by cherry-picking relevant commits.
- Stable release: fast-forward merge from
Publish site updates:
Fast-forward
deploy/prodfrommainwhen possible.Otherwise (usually because of
releasewas patched),Bring release-facing site updates (for example changelog and release blog updates) onto
mainfromrelease.
Netlify deploys from
deploy/prodanddoc-rooted.
This keeps theme releases and site deploys coordinated, but not tightly coupled.
Patch release workflow
For patches to the theme or website, generally prefer making the changes to
main first, though you can apply them to release then merge back to main.
Assuming the former, the patch-release workflow is as follows:
- Cherry-pick relevant commits from
maintorelease. - Create a and merge a release PR from
maintorelease. - Bring release-facing site updates (for example changelog and release blog
updates) back onto
mainfromrelease. - Update
deploy/prodfrommainby fast-forward merging if possible, if not then selectively bring in release relevant changes.
Branch sync and invariants
release:
- The theme release and maintenance branch.
- Theme tags come from this branch.
- Flow is usually from
maintoreleasevia fast-forward merge, when possible, cherry-picking otherwise (on patch releases) - Periodically, after a patch release, record branch ancestry without taking
content by periodically running
git merge -s ours releaseonmain.
deploy/prod:
- Reflects the current release docs baseline
- Can include site-only improvements that are compatible with the current release
Why this model?
- Keeps stable theme releases predictable while
mainmoves quickly. - Lets the website ship docs UX improvements without forcing a theme release.
- Preserves clear release tags for theme consumers.
- Keeps branch responsibilities explicit for a small maintainer team.