Writing a new post
1cd site
2hugo new posts/my-post-title.md
This creates content/posts/my-post-title.md with draft: true. Write in markdown. When ready to publish, set draft: false and push.
Writing a new doc
1cd site
2hugo new docs/my-doc-title.md
Docs default to draft: false — they’re reference material. Add a category: to group them on the docs index page.
Frontmatter fields
Posts
1---
2title: "Post title"
3date: 2026-05-30
4draft: true # flip to false to publish
5tags: ["tag1", "tag2"]
6summary: "One sentence shown in lists and search results."
7updated: "31 May 2026" # optional — shown in article header
8---
Docs
1---
2title: "Doc title"
3date: 2026-05-30
4draft: false
5category: "Category name" # shown in sidebar grouping
6tags: ["tag1", "tag2"]
7summary: "One sentence description."
8---
Development
1cd site
2npm install # first time only
3npm run dev # live server at localhost:1313 (includes drafts)
4npm run build # production build → site/public/
Deploying
Push to main → Cloudflare Pages auto-builds and deploys within ~30 seconds. That’s it.
Cloudflare Access (private sections)
To protect /docs/* so only you can access it:
- Go to Cloudflare One → Access → Applications
- Create a new Self-hosted Application
- Domain:
dsantmaj.com, Path:/docs/* - Policy: Include → Emails → your@email.com
- Authentication method: One-time PIN (email code — no password)
Anyone hitting /docs/ will be asked for their email. Enter yours → Cloudflare emails a 6-digit code → enter it → you’re in. Session persists for 24 hours.