Add --hugo-section-files-name flag for configurable index file output#455
Draft
klocke-io wants to merge 1 commit into
Draft
Add --hugo-section-files-name flag for configurable index file output#455klocke-io wants to merge 1 commit into
klocke-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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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