Minimal Hugo starter with Tailwind CSS v4 and Prettier, ready to deploy on Cloudflare Pages.
This starter is minimal but opinionated: Hugo, Tailwind CSS v4, Prettier with a pre-commit hook, and deploy to Cloudflare Pages. It has no theme, no components, and no JavaScript build step. The aim is a clean base you build on, not a site you strip down.
Deployment targets Cloudflare Pages only. Other hosts (Netlify, Vercel, GitHub Pages) will likely work with pnpm build, but they aren't documented or supported here.
-
Click Use this template on GitHub and clone your new repository.
-
Install dependencies and start the dev server:
pnpm install pnpm dev
-
Open http://localhost:1313.
Set baseURL, title, and params.description in hugo.toml to your own values. A page's description front matter overrides the site description.
| Command | Description |
|---|---|
pnpm dev |
Dev server, including drafts and future posts |
pnpm build |
Production build to public/ |
pnpm preview |
Dev server with production settings |
pnpm new <path> |
Create content, e.g. pnpm new posts/hello.md |
pnpm format |
Format all files with Prettier |
pnpm format:check |
Check formatting without writing |
A Lefthook pre-commit hook, installed by pnpm install, formats staged files with Prettier on every commit. Skip it once with git commit --no-verify.
The site deploys as a Cloudflare Pages project connected to your Git repository.
-
In the Cloudflare dashboard, go to Workers & Pages > Create > Pages > Import an existing Git repository and select your repository.
-
Set Build command to
pnpm buildand Build output directory topublic. -
Add these environment variables:
Variable Value Why HUGO_VERSION0.168.0The build image's Hugo is too old for this starter PNPM_VERSION12.16.1Pages ignores packageManagerinpackage.jsonNODE_VERSION26The build image defaults to an older Node.js LEFTHOOK0Skips installing the Git hook during the build
When upgrading Hugo, update HUGO_VERSION in the Cloudflare dashboard and hugo-version in .github/workflows/ci.yml.
Bug fixes and version bumps are welcome. Please open an issue before adding a feature, since most additions are out of scope on purpose.
Before opening a PR:
- Make sure
pnpm buildpasses. Formatting is handled by the pre-commit hook. CI runspnpm format:checkandpnpm buildon every PR. - Use Conventional Commits (
feat:,fix:,chore:), matching the existing history.
Distributed under the MIT License. See LICENSE for more information.