Overview
The Platform Foundation Hugo CLI consists of a growing collection of helper scripts that automate common documentation tasks.
Rather than manually creating directories, copying _index.md files, selecting archetypes, and remembering build commands, the CLI standardizes those operations into repeatable commands.
Why It Matters
Documentation should be as easy to create as code.
By automating repetitive tasks, contributors can focus on writing high-quality content instead of remembering directory structures or Hugo commands.
The CLI also enforces a consistent layout across every knowledge domain.
Where It Fits
Need Documentation
โ
โผ
Hugo Helper Script
โ
โผ
Scaffold Content
โ
โผ
Write Article
โ
โผ
Build Hugo Site
โ
โผ
Deploy Platform
The Big Picture
The helper scripts are located in:
tools/hugo/
Current toolkit:
create-kb-domain.sh
create-kb-bottle.sh
create-kb-article.sh
(build.sh)
(refresh.sh)
(publish.sh)
As the platform evolves, additional automation scripts will be added to this directory.
Core Commands
Create a Knowledge Base Domain
tools/hugo/create-kb-domain.sh beer
Creates:
content/kb/beer/
including all standard subsections.
Create a Bottle Review
tools/hugo/create-kb-bottle.sh \
beer \
goose-island-bourbon-county-brand-stout
Creates:
content/kb/beer/bottles/goose-island-bourbon-county-brand-stout.md
using the appropriate archetype.
Create a Knowledge Article
tools/hugo/create-kb-article.sh \
infrastructure \
hugo \
hugo-cli-cheatsheet
Creates:
content/kb/infrastructure/hugo/hugo-cli-cheatsheet.md
using the shared KB article archetype.
Build Workflow
Future helper scripts will automate the build process.
Build
tools/hugo/build.sh
Equivalent to:
docker build -t hugo .
Refresh
tools/hugo/refresh.sh
Equivalent to:
platform refresh hugo
Publish
tools/hugo/publish.sh
Will eventually automate:
- Docker build
- Docker tag
- ECR push
- Platform refresh
- Deployment validation
Engineering Analogy
The helper scripts serve the same purpose as Terraform modules.
Rather than repeatedly performing low-level operations, they encapsulate best practices behind a consistent interface.
Just as Terraform modules reduce infrastructure duplication, the Hugo CLI reduces documentation boilerplate.
Best Practices
- Create new content using helper scripts instead of manually creating files.
- Keep archetypes generic and reusable.
- Store automation scripts in
tools/hugo. - Update helper scripts when the documentation workflow changes.
- Prefer automation over repetitive manual tasks.
Common Mistakes
- Manually creating directories that the helper scripts already generate.
- Editing generated front matter before the archetype.
- Forgetting to publish (
draft = false). - Skipping the helper scripts and creating inconsistent content structures.
Pro Tip
If you perform the same documentation task more than two or three times, consider adding a new helper script to the Hugo CLI rather than repeating the manual workflow.
Key Takeaways
- The Hugo CLI standardizes documentation creation.
- Helper scripts eliminate repetitive scaffolding.
- Archetypes ensure consistent page structure.
- Automation improves speed, consistency, and maintainability.
- The CLI is expected to grow alongside Platform Foundation.
Related Articles
- Hugo Front Matter
- Hugo Archetypes
- Hugo Content Model
- Hugo Template Language