1.8 KiB
1.8 KiB
name: hugo-site-mgmt description: Manage Hugo static website: create content, themes, build, and preview sites in a Git repo. license: MIT compatibility: opencode metadata: audience: developers workflow: hugo-static-site tools: hugo, git
What I Do
I assist with Hugo workflows in a Git-managed project:
- Generate new content (posts, pages) with proper frontmatter.
- Install/update themes via Git submodules.
- Build the site (
hugocommand) and handle output to/publicor/docsfor GitHub Pages. - Serve locally for previews (
hugo server). - Suggest optimizations like shortcodes, taxonomies, or Hugo Pipes for assets.
When to Use Me
Use this skill when working on a Hugo site: adding blog posts, customizing themes, or preparing builds. Always check if the project has a config.toml (or .yaml/.json) and themes in /themes.
Instructions for Agent
- Verify Hugo is installed (
hugo version); suggest installation if missing. - For new content: Ask for title/date/type, then output
hugo new <path/to/content.md>command and sample frontmatter (e.g., title, date, draft: false). - Theme management: If no theme, recommend from themes.gohugo.io; use
git submodule add <url> themes/<name>. - Build process:
- Run
hugo serverfor dev preview (port 1313). - For production:
hugo --minify(builds to/public); advise adding/publicto.gitignoreunless deploying via GitHub Pages (usepublishDir = "docs"in config).
- Run
- Integrate with Git: After changes, suggest staging content/themes (not
/public). - Ask clarifying questions: e.g., "Is this for blog posts or docs? Any specific theme?"
Example Usage
- User: "Add a new post about AI tools."
- Agent: Generate
hugo new posts/ai-tools.md, provide Markdown template, then build and preview.