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...
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:
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:
hugo.toml (or hugo.yaml, hugo.yml, hugo.json, or config/*)archetypes/*
data/*
layouts/_shortcodes/* or layouts/shortcodes/*
layouts/_markup/*
content/**
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.
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:
Read references/conversion-workflow.md before changing files. Then:
hugo.toml, config.*, and module mounts.data/ when shortcodes or partials pull structured content from them.layouts/_shortcodes/ or layouts/shortcodes/.layouts/_markup/.include-style shortcodes into referenced content files when the docs site composes content from shared fragments.Use these rules by default:
title, description, date, draft, aliases, slug, url, weight, and nested params when they still carry meaning.publishDate, lastmod, expiryDate, and page resource metadata when they still affect meaning or downstream routing.Title to title, Description to description, and LinkTitle to linkTitle.pubdate, published, modified, and unpublishdate, plus tokens such as :default, :filename, :fileModTime, and :git.{{</* foo */>}} or {{%/* foo */%}} that appear in prose, tables, or notation examples.{.class #id} and code-fence attributes when the destination Markdown flavor supports them. If not, downgrade explicitly instead of silently dropping them.Many Hugo documentation sites use complex local behaviors. Be alert for these common patterns:
hugo.toml mounts content/en to the logical content root, so link and include resolution must use Hugo logical paths instead of preserving /en/ blindly.configuration/front-matter.md and [frontmatter] in hugo.toml before normalizing dates or slugs.include renders another page through RenderShortcodes; follow the referenced content file and inline the resulting Markdown.quick-reference, render-list-of-pages-in-section, and render-table-of-pages-in-section generate navigation content from sections; replace them with materialized Markdown lists or tables.glossary-term, glossary, get-page-desc, module-mounts-note, new-in, and deprecated-in expand to prose or badges; convert them into explicit Markdown text or callouts.code-toggle may read config snippets and data-backed examples; preserve the underlying code sample, not the UI toggle.datatable, per-lang-config-keys, root-configuration-keys, syntax-highlighting-styles, chroma-lexers, newtemplatesystem, and hl are also local shortcodes; inspect their implementations before deciding whether to materialize, flatten, or downgrade.features-table, optional-features-table, clients-example, or jupyter-example, inspect the referenced data/ files, local example sources, and Markdown-export partials before deciding whether to materialize or downgrade.(g); resolve these to stable glossary links instead of leaving the placeholder.img and imgproc are presentation helpers around page, global, or remote resources; preserve the underlying image reference and caption semantics.eturl emits links to embedded template sources; convert to a normal Markdown link if the destination is known, otherwise preserve as a textual note.ref and relref are obsolete for Markdown in modern Hugo docs and can interact poorly with the custom link render hook; resolve the final destination instead of preserving the shortcode.Read references/shortcodes-and-render-hooks.md before converting any file that contains Hugo syntax.
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.
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:
> Conversion note: <what the shortcode normally renders>.
Do not leave empty links, broken table cells, or stripped content with no explanation.
Use these facts when converting a Hugo documentation site that exhibits similar patterns:
hugo.toml mounts content/en to content, so English docs are the active content tree.$$...$$, \\(...\\), and \\[...\\] can be meaningful content, not junk.markup.goldmark.parser.attribute.block = true, so block attribute syntax may appear after fenced blocks and other block elements.markup.goldmark.parser.wrapStandAloneImageWithinParagraph = false, so standalone image attributes can target the image itself rather than a wrapping paragraph._common fragments referenced through % include %, so reading a page file alone is not enough to understand the rendered content.{{</* foo */>}} and {{%/* foo */%}}; these are documentation samples and must remain literal when they appear inside code examples, notation tables, or tutorial prose.hugo, npm install, go install, downloaded shell installers, or any network install step unless the user explicitly asks for it.Read these files as needed:
references/conversion-workflow.md
End-to-end process for repo-aware conversion.references/front-matter-and-content.md
Front matter mapping, common content conventions, and literal-example handling.references/shortcodes-and-render-hooks.md
Hugo shortcode notation, docs-site custom shortcodes, and render-hook implications.references/links-assets-and-validation.md
Link resolution, assets, validation, and residue triage.Use these scripts when helpful:
scripts/inventory_hugo_rules.py
Scan a Hugo site and emit a rule inventory.scripts/check_standard_markdown.py
Detect leftover Hugo syntax and common unsafe residue in Markdown output.