Skip to content

Conversation

@tharunn0
Copy link

@tharunn0 tharunn0 commented Dec 11, 2025

Fixes #14112
– prevents the panic in hugo new when a content file exists with different case only.

Adds a small case-insensitive check in CreateContentPlaceHolder and returns a clear error instead of panicking.
--force behaviour is intentionally unchanged (still panics on pure case-conflicts).

mage -v check and mage hugoRace pass.

When "hugo new" is run and a file with the same name but different case
already exists (e.g. Floop.md vs floop.md), Hugo previously panicked in
applyArchetype because the internal page lookup is case-sensitive.

Add a case-insensitive directory check before writing the placeholder file
and return a clear error when a conflict is found.

The --force flag continues to overwrite exact matches (existing behaviour)
and will still panic on pure case-conflicts (also existing behaviour).

Fixes gohugoio#14112

Signed-off-by: Tharun V S <tharunvs777@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant