Skip to content

fix(hugo): gate Hugo-specific transforms behind --hugo flag - #497

Merged
VelmiraS merged 1 commit into
masterfrom
fix/hugo-enabled-guard
Sep 16, 2026
Merged

VelmiraS merged 1 commit into
masterfrom
fix/hugo-enabled-guard

Conversation

@VelmiraS

Copy link
Copy Markdown
Contributor

Three places in the pipeline ran Hugo-specific logic regardless of the --hugo flag: _index.md rename in FSWriter, HugoStructuralDirs trimming in buildOutputLink, and ReAnchorRootAbsolute in resolveRelativeToAbsolute. All three are now guarded by Hugo.Enabled / f.Hugo.

What this PR does / why we need it:
With --hugo=false, three Hugo-specific transformations still fired unconditionally: README.md was renamed to _index.md, structural directory prefixes were stripped from output links, and root-absolute links were re-anchored using Hugo structural dirs. This fixes all three by gating each behind the Hugo.Enabled / f.Hugo flag.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
No behavior change for --hugo=true (the default). The existing test "hugo structural dir stripped" expected the buggy behavior and has been corrected to reflect the fixed output.

Release note:

With --hugo=false, Hugo-specific transforms (index file rename, structural dir stripping, root-absolute link re-anchoring) no longer fire. Users who relied on hugo-section-files: [] to suppress the rename can now use hugo: false alone.

Three places in the pipeline ran Hugo-specific logic regardless of the
--hugo flag: _index.md rename in FSWriter, HugoStructuralDirs trimming
in buildOutputLink, and ReAnchorRootAbsolute in resolveRelativeToAbsolute.
All three are now guarded by Hugo.Enabled / f.Hugo.
@gardener-prow gardener-prow Bot added the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Sep 15, 2026
@VelmiraS
VelmiraS requested a review from klocke-io September 15, 2026 08:03
@gardener-prow gardener-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 15, 2026
@VelmiraS VelmiraS self-assigned this Sep 15, 2026

@klocke-io klocke-io left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2026
@gardener-prow

gardener-prow Bot commented Sep 15, 2026

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 84f0c219b81c03a11c000d05fab0fccc4d45b0cf

@gardener-prow

gardener-prow Bot commented Sep 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klocke-io

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 15, 2026
@VelmiraS
VelmiraS merged commit 5810042 into master Sep 16, 2026
52 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants