Quickly deploy a full-featured docs setup to Cloudflare Pages.
This is an opinionated setup: I have chosen to enable and configure features I usually want, such as navigation tabs and admonitions.
- MkDocs with the Material theme
- Vale GitHub Action
- Support for Plausible analytics
- Copy the contents of this repo to your own repo.
- Follow the instructions on how to deploy MkDocs to Cloudflare Pages. Note that this example repo uses the free version of Material. Once done, you have a live site!
- Clone your repo.
- Create a virtual environment:
python -m venv venv - Activate your virtual environment:
# PowerShell /venv/Scripts/activate.ps1 - Install requirements:
pip install -r requirements.txtNote: there are several ways to install the Material theme, which is the cornerstone of this project. But you must install using pip in order to use some features. I strongly recommend using pip.
- View locally with
mkdocs serve.
Vale provides linting, both locally and on pull request.
The setup in this repo includes the following styles:
- Microsoft: a Vale-compatible implementation of the Microsoft Writing Style Guide.
- write-good
- alex: a Vale-compatible implementation of the guidelines enforced by the alex, a linter designed to catch insensitive writing.
- In
styles, renameyour-company-stylesto your company name, and in.vale.inichangeyour-company-stylesto the new directory name. - In
styles/Vocab/default, add any terms you want Vale to accept or reject to the appropriate.txtfile. This is useful for allowing company-specific terminology (such as brand names) to pass the spell checker. Learn more about Vale vocabularies.
- Install Vale CLI and run it with
vale --glob='*.md' docs(this lints all Markdown files in yourdocsdirectory) - Install Vale CLI or Vale Server, and use with one of the integrations, such as the VS Code extension. There is a list of integrations in the docs.
The mkdocs.yml includes links to documentation on each theme feature that I'm using. The Material theme is the foundation of this project, and its documentation is extensive and very helpful. You can also learn more about MkDocs, the static site generator underpinning the theme.
Vale is a complex linting tool. The documentation is a good starting point.