--- 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 (`hugo` command) and handle output to `/public` or `/docs` for 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 1. Verify Hugo is installed (`hugo version`); suggest installation if missing. 2. For new content: Ask for title/date/type, then output `hugo new ` command and sample frontmatter (e.g., title, date, draft: false). 3. Theme management: If no theme, recommend from themes.gohugo.io; use `git submodule add themes/`. 4. Build process: - Run `hugo server` for dev preview (port 1313). - For production: `hugo --minify` (builds to `/public`); advise adding `/public` to `.gitignore` unless deploying via GitHub Pages (use `publishDir = "docs"` in config). 5. Integrate with Git: After changes, suggest staging content/themes (not `/public`). 6. 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.