Skip to content

Panic on new content creation #14112

@danshearer

Description

@danshearer

What version of Hugo are you using (hugo version)?

hugo v0.152.2+extended+withdeploy linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes

Conditions to reproduce

A file with the same name exists only with different case, for example Floop.md or fLoOp.md . There is no problem if floop,md exists with exact case, when hugo correctly reports that the file exists and aborts.

hugo new content/articles floop.md

Panic

[user@machine ]$ hugo new content/articles/floop.md
panic: [BUG] no Page found for "/home/user/site/example.org/content/articles/floop.md"

goroutine 1 [running]:
github.com/gohugoio/hugo/create.(*contentBuilder).applyArcheType(0xc000bf6e40, {0xc000a91a00, 0x3b}, {0x5636a68403c0, 0xc00038fec0})
github.com/gohugoio/hugo/create/content.go:275 +0x346
github.com/gohugoio/hugo/create.(*contentBuilder).buildFile(0xc000bf6e40)
github.com/gohugoio/hugo/create/content.go:244 +0x1a8
github.com/gohugoio/hugo/create.NewContent.func1()
github.com/gohugoio/hugo/create/content.go:105 +0x216
github.com/gohugoio/hugo/create.NewContent(0xc000b1cb00, {0x0, 0x0}, {0x7ffc7c90a108, 0x19}, 0x0)
github.com/gohugoio/hugo/create/content.go:108 +0x5a9
github.com/gohugoio/hugo/commands.newNewCommand.func1({0x0?, 0x0?}, 0x0?, 0xc0008c0840, {0xc000a51320, 0x0?, 0x0?})
github.com/gohugoio/hugo/commands/new.go:62 +0x18e
github.com/gohugoio/hugo/commands.(*simpleCommand).Run(0x0?, {0x5636a6829f58?, 0x5636a866d2e0?}, 0x0?, {0xc000a51320?, 0xc0007459f8?, 0x0?})
github.com/gohugoio/hugo/commands/commandeer.go:649 +0x3c
github.com/bep/simplecobra.(*Commandeer).compile.func1(0xc000899a00?, {0xc000a51320?, 0x4?, 0x5636a570c246?})
github.com/bep/[email protected]/simplecobra.go:113 +0x4c
github.com/spf13/cobra.(*Command).execute(0xc000a6e608, {0xc000a512e0, 0x1, 0x1})
github.com/spf13/[email protected]/command.go:1015 +0xb02
github.com/spf13/cobra.(*Command).ExecuteC(0xc000a26608)
github.com/spf13/[email protected]/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
github.com/spf13/[email protected]/command.go:1080
github.com/bep/simplecobra.(*Exec).Execute(0xc0007820b8, {0x5636a6829f58?, 0x5636a866d2e0?}, {0xc0005b1940?, 0x5636a6174940?, 0xc0000ae688?})
github.com/bep/[email protected]/simplecobra.go:155 +0xd4
github.com/gohugoio/hugo/commands.Execute({0xc00011a4f0, 0x2, 0x2})
github.com/gohugoio/hugo/commands/commandeer.go:68 +0x2f3
main.main()
github.com/gohugoio/hugo/main.go:25 +0x57

Possible (?) documentation problem

I have not found any reference to what Hugo's rules are on case sensitivity for content files. Perhaps I just haven't looked in the right place. I'd lean to case-insensitivity with an error for identical files, because these mistakes are easy to make, but I just want to know what the rules are.

Hugo does have the disablePathToLower parameter for creating case-sensitive URLs, but that's entirely different.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions