ワンクリックで
hugo
Use when creating, developing, building, or troubleshooting websites with the Hugo static site generator.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when creating, developing, building, or troubleshooting websites with the Hugo static site generator.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | hugo |
| description | Use when creating, developing, building, or troubleshooting websites with the Hugo static site generator. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| platforms | ["linux","macos","windows"] |
| metadata | {"hermes":{"tags":["hugo","static-site-generator","ssg","markdown","themes","templates","deployment"],"related_skills":["plan","requesting-code-review"]}} |
Use this skill when the user wants to create, run, edit, build, or debug a site built with Hugo.
Hugo is a static site generator with a CLI-centered workflow: create a project, add content under content/, render with templates and/or a theme, preview with hugo server, then build the deployable output with hugo.
Prefer Hugo's own CLI and documentation over framework-specific folklore. The canonical docs are at https://gohugo.io/.
Important current details confirmed from the docs and local CLI:
hugo new project <path>.hugo new project has aliases project and site, so hugo new site <path> also works.hugo new content <path> creates new content, usually with draft = true in front matter.hugo server is the development server and hugo / hugo build generates the static site.languageCode is deprecated; prefer locale in config.hugo version returned hugo v0.161.1+extended+withdeploy, so the extended edition is a good default recommendation.public/ or another output directoryhugo mod, hugo list, hugo env, and hugo configDo not use this skill for:
Prefer the extended edition unless the user explicitly says they only need the standard edition.
Documented installation commands from gohugo.io:
brew install hugo
sudo port install hugo
choco install hugo-extended
scoop install hugo-extended
winget install Hugo.Hugo.Extended
brew install hugo
sudo snap install hugo
Notes:
Always verify with:
hugo version
Useful environment check:
hugo env
These are the commands to reach for first:
hugo Build the site
hugo build Explicit build command
hugo server Start the embedded dev server
hugo new project PATH Create a new project
hugo new site PATH Alias for new project
hugo new content PATH Create a new content file
hugo list drafts List draft content
hugo config Show effective project config
hugo mod ... Manage Hugo modules
hugo version Show version
hugo env Show version and environment info
Use one of these:
hugo new project mysite
hugo new site mysite
If you want YAML or JSON config instead of TOML:
hugo new project mysite --format yaml
Then enter the project:
cd mysite
Prefer locale over the deprecated languageCode key.
Minimal hugo.toml:
baseURL = 'https://example.org/'
locale = 'en-us'
title = 'My Hugo Site'
If a theme is being used, add its config according to the theme docs. For a classic themes-directory setup this may look like:
theme = 'ananke'
Create a post or page:
hugo new content posts/my-first-post.md
hugo new content about.md
Typical generated front matter looks like this:
+++
title = 'My First Post'
date = 2026-06-10T12:00:00Z
draft = true
+++
Important behavior:
hugo will not publish drafts by default.hugo server -D.draft = false or remove the draft flag if appropriate.Most common dev command:
hugo server -D
Useful variations:
hugo server --bind 0.0.0.0 --port 1313 -D
hugo server --disableFastRender -D
Useful server facts confirmed from local CLI help:
127.0.0.11313-D includes draft content--openBrowser opens the site after startup--tlsAuto can generate locally trusted certificatesDefault build:
hugo
Explicit build command:
hugo build
Choose an output directory:
hugo --destination public
Common production-ish build:
hugo --minify --gc
Draft and scheduling control:
hugo -D
hugo -F
hugo -E
These flags include draft, future, or expired content respectively. Use them intentionally; they are usually not what you want for production.
The official quick start uses a Git submodule. Example:
git init
git submodule add https://github.com/gohugo-ananke/ananke themes/ananke
Then set the theme in hugo.toml:
theme = 'ananke'
This is a good default when the theme's docs show a themes/<name> workflow.
When a theme uses Hugo Modules, initialize the project module first:
hugo mod init example.com/mysite
Then follow the theme's module import instructions.
Useful maintenance commands:
hugo mod tidy
hugo mod get
hugo mod verify
Use module mode when the theme or component docs explicitly refer to module.imports, go.mod, or Hugo Modules.
Use this when the user wants the smallest reproducible Hugo setup without pulling a third-party theme.
hugo new project demo
cd demo
baseURL = 'https://example.org/'
locale = 'en-us'
title = 'Demo Site'
layouts/_default/baseof.html
<!doctype html>
<html><body>{{ block "main" . }}{{ end }}</body></html>
layouts/index.html
{{ define "main" }}
<h1>{{ .Site.Title }}</h1>
{{ range .Site.RegularPages }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
{{ end }}
layouts/_default/single.html
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
{{ end }}
hugo new content posts/hello.md
Then edit the file so draft = false and add body content.
hugo server -D
hugo --destination public
This exact pattern was validated locally with Hugo v0.161.1: project creation, content creation, module initialization, and a build to a custom destination all succeeded.
When working on URL structure, distinguish between the permalink tokens and the permalink configuration form.
Important rules:
:sectionslugs and :sectionslug are permalink tokens introduced before v0.161.0 (the docs mark them as new in v0.149.0).pattern and an optional target page matcher.url front matter field overrides any matching permalink pattern.Array-form example:
permalinks:
- pattern: /:sectionslugs
target:
kind: section
- pattern: /:sectionslugs/:slug
target:
kind: page
Audit workflow for permalink-heavy themes or sites:
url: overrides in front matter before blaming the permalink config.hugo config to inspect Hugo's effective configuration.hugo config may normalize older map-form rules into matcher-based [[permalinks]] output.public/ or a temporary --destination.Compatibility pitfall:
permalinks need to use the same data shape. If the site config uses array form but an imported module or theme config still uses map form, Hugo can fail during config merge with a panic like interface conversion: interface {} is []interface {}, not hmaps.Params.permalinks, including local replace overrides in go.mod.hugo config and a real hugo build. A successful edit to the site config alone is not enough proof if a module config still uses the old shape.See also references/permalinks-v0161.md for a compact audit note.
When a Hugo site is broken, inspect in this order:
hugo version
hugo env
hugo config
hugo server -D
hugo --gc --minify
hugo list drafts
hugo list future
hugo list expired
hugo mod tidy
hugo mod verify
Using languageCode in new configs.
locale = 'en-us'.Expecting draft content to appear in a normal build.
hugo excludes drafts by default.hugo server -D while writing, then set draft = false before release.Seeing found no layout file warnings.
section, taxonomy, home, or single.layouts/ or by installing/configuring a theme that provides them.Pulling in a theme without following that theme's installation style.
themes/ directory.Broken absolute links after deploy.
baseURL is wrong for the final host.baseURL to the production URL before build, or use environment-specific config.Creating content from the wrong directory.
hugo new content ... should be run from the project root unless you are explicitly using --source.Linux snap confusion.
Assuming hugo server is the same as a production deployment.
hugo build before claiming the site is deploy-ready.When helping a user with Hugo, prefer concise, command-first answers in this shape:
Goal: <what we are doing>
Project root: <path>
Commands:
1. <command>
2. <command>
Files to edit:
- <path>
Verification:
- <what to check>
If you actually built or tested something, include:
hugo version runs successfullyhugo new project or hugo new sitebaseURL and uses locale instead of deprecated languageCodecontent/hugo server -D for preview, draft = false for productionhugo or hugo build completed successfullypublic/ by default, or custom --destination) contains generated fileshugo mod tidy / hugo mod verify as needed