Home / Market / hugo to markdown

hugo to markdown

Convert Hugo documentation sites and Hugo-managed content into standard Markdown.

skill★ 508610 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: hugo-to-markdown description: "Convert Hugo documentation sites and Hugo-managed content into standard Markdown." risk: critical source: https://github.com/chaunsin/agent-skills/tree/master/skills/hugo-to-markdown source_repo: chaunsin/agent-skills source_type: community date_added: 2026-07-01 license: Apache-2.0 license_source: https://github.com/chaunsin/agent-skills/blob/master/LICENSE

---

Hugo To Markdown

When to Use

Use this skill when you need convert Hugo documentation sites and Hugo-managed content into standard Markdown. Use when Agent needs to inspect a local Hugo repository, read hugo.toml or config files, content/, archetypes/, layouts/_shortcodes/, layouts/_markup/, and related docs content, then produce Markdown...

Overview

Use this skill when Markdown output must be derived from the local Hugo site, not guessed from generic Hugo knowledge. The conversion rules are the combination of Hugo's official behavior and the repository's own configuration, shortcode templates, render hooks, archetypes, and content conventions.

The target output is standard Markdown:

Official Basis

Treat the repository's own Hugo configuration and templates as the primary ruleset. For any site under conversion, inspect these rule sources in the user's provided site root:

Also read any local docs that define shortcode, front matter, bundle, resource, and render-hook behavior.

Do not assume built-in Hugo defaults if the repository overrides them locally.

Workflow

1. Inventory the site before converting files

Always inspect the site-level rules first.

python3 scripts/inventory_hugo_rules.py --site-root /path/to/hugo-site

Example invocation for the user's site:

python3 skills/hugo-to-markdown/scripts/inventory_hugo_rules.py \
  --site-root /path/to/your-hugo-site

This inventory step is mandatory for batch work. It identifies:

2. Convert with repository rules, not generic heuristics

Read references/conversion-workflow.md before changing files. Then:

  1. Resolve the real content root from hugo.toml, config.*, and module mounts.
  2. Read archetypes to understand expected front matter shape.
  3. Read the front matter configuration to understand date aliases, fallback order, filename-derived dates, and other inferred metadata.
  4. Read site data sources in data/ when shortcodes or partials pull structured content from them.
  5. Read custom shortcode templates in layouts/_shortcodes/ or layouts/shortcodes/.
  6. Classify each encountered shortcode as embedded, custom, or inline, then check whether it uses named or positional arguments, block syntax, or self-closing syntax.
  7. Read render hooks in layouts/_markup/.
  8. Check whether the repo already defines Markdown- or JSON-facing export templates and partials; if it does, use those as evidence for how the site itself downgrades Hugo constructs.
  9. Follow include-style shortcodes into referenced content files when the docs site composes content from shared fragments.
  10. Convert one file or one coherent section at a time.

3. Preserve semantics during conversion

Use these rules by default:

4. Apply Hugo-specific body rules carefully

Many Hugo documentation sites use complex local behaviors. Be alert for these common patterns:

Read references/shortcodes-and-render-hooks.md before converting any file that contains Hugo syntax.

5. Validate the output

After conversion, scan the generated Markdown for leftover Hugo-only syntax.

python3 skills/hugo-to-markdown/scripts/check_standard_markdown.py \
  --root /path/to/output

If the validator reports active Hugo syntax outside code fences, either:

Do not silently ship unresolved {{< ... >}}, {{% ... %}}, or Go template expressions.

6. Downgrade explicitly when full materialization is not safe

If a shortcode depends on build-time data, generated examples, or external source files that you cannot resolve deterministically from the local repo snapshot, replace it with an explicit Markdown note.

Use a short, boring format such as:

Do not leave empty links, broken table cells, or stripped content with no explanation.

Common Hugo Docs Site Patterns

Use these facts when converting a Hugo documentation site that exhibits similar patterns:

Safety Rules