hugo
Original:🇺🇸 English
Translated
Build, configure, and develop Hugo static sites and themes. Use when the user wants to create a new Hugo site, develop or customize a Hugo theme, write Hugo templates (layouts, partials, shortcodes), configure hugo.toml/yaml/json, work with Hugo's asset pipeline (images, CSS/Sass, JS bundling), manage content (pages, sections, taxonomies, menus), or deploy a Hugo site. Triggers on mentions of "Hugo", "hugo.toml", "static site generator", Hugo-related template syntax (Go templates, baseof, partials), or Hugo content workflows.
2installs
Sourcealahmadiq8/skills
Added on
NPX Install
npx skill4agent add alahmadiq8/skills hugoTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Hugo Static Site Generator
Quick Reference
- Docs: https://gohugo.io/documentation/
- Forum: https://discourse.gohugo.io/
- GitHub: https://github.com/gohugoio/hugo
- Template functions: https://gohugo.io/functions/
- Configuration: https://gohugo.io/configuration/introduction/
Core Commands
bash
hugo new site my-site # Create new site
hugo new theme my-theme # Create theme skeleton
hugo new content posts/my-post.md # Create content
hugo server -D # Dev server (include drafts)
hugo server --navigateToChanged # Auto-navigate to changed content
hugo # Build site to public/
hugo --minify # Build with minified output
hugo --gc # Build and clean unused cache
hugo mod init github.com/user/repo # Initialize Hugo modulesProject Structure
my-site/
├── hugo.toml # Site configuration
├── archetypes/ # Content templates for `hugo new`
│ └── default.md
├── assets/ # Files processed by Hugo Pipes (Sass, JS, images)
├── content/ # Site content (Markdown)
├── data/ # Data files (JSON, TOML, YAML)
├── i18n/ # Translation strings
├── layouts/ # Templates (override theme)
├── static/ # Static files copied as-is
├── themes/ # Installed themes
└── public/ # Generated site (build output)Workflow
Creating a New Site
- Run to scaffold
hugo new site <name> - Configure — see references/configuration.md
hugo.toml - Add a theme (install or create custom) — see references/theme-development.md
- Create content with
hugo new content <section>/<name>.md - Run for live development
hugo server -D - Build with for production
hugo --minify
Theme Development
Create custom themes or modify existing ones. See references/theme-development.md for:
- Theme directory structure and skeleton
- Template lookup order
- Base templates () and blocks
baseof.html - Partials and partial caching
- List and single templates
- Taxonomy and term templates
Templating
Write Go templates for layouts, partials, and shortcodes. See references/templating.md for:
- Go template syntax and functions
- Context (the dot ) and variable scoping
. - Range, with, if/else patterns
- Custom shortcodes
- Template debugging
Content Management
Organize and manage site content. See references/content-management.md for:
- Page bundles (leaf vs branch)
- Front matter fields
- Sections and taxonomies
- Menus
- Multilingual / i18n
- Content archetypes
Asset Pipeline
Process images, CSS/Sass, JavaScript, and more. See references/asset-pipeline.md for:
- Image processing (resize, crop, filters, WebP)
- Sass/SCSS compilation
- JavaScript bundling with esbuild
- Fingerprinting and SRI
- PostCSS / Tailwind CSS integration
Deployment
Deploy to hosting platforms. See references/deployment.md for:
- Netlify configuration
- Vercel setup
- Cloudflare Pages
- GitHub Pages with Actions
- General CI/CD patterns
Best Practices
- Keep images with content: Use page bundles (+ images in same directory) so Hugo can process them
index.md - Use config directory for complex sites: split into
hugo.toml,config/_default/hugo.toml,menus.tomlparams.toml - Asset pipeline minimum: Always ,
minify, and usefingerprintfor CSS/JS bundlesslice - Override, don't fork themes: Place overriding templates in project — Hugo's union file system gives project files precedence over theme files
layouts/ - Use partials for DRY templates: Break complex templates into focused partials; use for expensive operations
partialCached - Content organization mirrors URL structure: Top-level directories under become sections
content/ - Draft workflow: Use in front matter;
draft: trueshows drafts, production build excludes themhugo server -D - Use archetypes: Define content templates in for consistent front matter across content types
archetypes/