diff --git a/resources/page/permalinks.go b/resources/page/permalinks.go index 953f4a2e8..f8cbcd62c 100644 --- a/resources/page/permalinks.go +++ b/resources/page/permalinks.go @@ -311,7 +311,7 @@ func (l PermalinkExpander) pageToPermalinkSections(p Page, _ string) (string, er // pageToPermalinkContentBaseName returns the URL-safe form of the content base name. func (l PermalinkExpander) pageToPermalinkContentBaseName(p Page, _ string) (string, error) { - return l.urlize(p.PathInfo().BaseNameNoIdentifier()), nil + return l.urlize(p.PathInfo().Unnormalized().BaseNameNoIdentifier()), nil } // pageToPermalinkSlugOrContentBaseName returns the URL-safe form of the slug, content base name. diff --git a/resources/page/permalinks_integration_test.go b/resources/page/permalinks_integration_test.go index 6ef450edd..c865e2704 100644 --- a/resources/page/permalinks_integration_test.go +++ b/resources/page/permalinks_integration_test.go @@ -14,6 +14,7 @@ package page_test import ( + "strings" "testing" "github.com/bep/logg" @@ -343,3 +344,29 @@ slug: "c2slug" b.AssertFileContent("public/myc/c1/index.html", "C1|/myc/c1/|term|") b.AssertFileContent("public/myc/c2slug/index.html", "C2|/myc/c2slug/|term|") } + +func TestIssue13755(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +disableKinds = ['home','rss','section','sitemap','taxonomy','term'] +disablePathToLower = false +[permalinks.page] +s1 = "/:contentbasename" +-- content/s1/aBc.md -- +--- +title: aBc +--- +-- layouts/all.html -- +{{ .Title }} +` + + b := hugolib.Test(t, files) + b.AssertFileExists("public/abc/index.html", true) + + files = strings.ReplaceAll(files, "disablePathToLower = false", "disablePathToLower = true") + + b = hugolib.Test(t, files) + b.AssertFileExists("public/aBc/index.html", true) +}