Add --hugo-section-files-name flag for configurable index file output#455
Add --hugo-section-files-name flag for configurable index file output#455klocke-io wants to merge 1 commit into
Conversation
Add a new configuration option `--hugo-section-files-name` (default: `_index.md`) that controls the output filename when section files are renamed. This allows consumers using VitePress or other SSGs to set `--hugo-section-files-name=index.md` instead of relying on post-processing scripts to copy `_index.md` to `index.md`. The change replaces all hardcoded `_index.md` references with the configurable value across the writer, link resolver, frontmatter computation, alias plugin, docsy plugin, and persona plugin. Also resolves the existing TODO in HugoPrettyPath() to use IndexFileNames instead of hardcoded strings. Backward compatible: default value preserves existing behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
|
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle rotten |
Summary
--hugo-section-files-nameconfig option (default:_index.md) controlling the output filename when section files matching--hugo-section-filesare renamed--hugo-section-files-name=index.mdallows direct VitePress consumption without post-processing scripts that copy_index.md→index.md_index.mdreferences across writer, link resolver, frontmatter, alias, docsy, and persona pluginsHugoPrettyPath()to useIndexFileNamesinstead of hardcoded stringsMotivation
The SAP internal Gardener documentation is migrating from Hugo to VitePress. VitePress expects
index.mdwhile Docforge outputs_index.md(Hugo convention). Currently a post-processing script copies every_index.mdtoindex.mdafter each Docforge run. This flag eliminates that workaround.Config example
Test plan
go build ./...compiles successfully_index.mdpreserves backward compatibility🤖 Generated with Claude Code