summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-25 10:24:46 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-25 14:57:29 +0100
commitd310595a2ba672fa30dc9a9a2679542cfc919a35 (patch)
tree14ae73ab6bce20d236759d73e6181f006e4de8f4 /hugolib
parent049dd1d7e0e106d861c60e5417c907bc3a686dcb (diff)
resource: Revert the normalization of Resource.Name
Which means that .Name now returns the same as it did in 0.122.0. Closes #12142
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/content_map_page.go4
-rw-r--r--hugolib/pagebundler_test.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index ee7f22676..ba0c858fe 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -542,7 +542,7 @@ func (m *pageMap) getOrCreateResourcesForPage(ps *pageState) resource.Resources
for _, r := range res2 {
var found bool
for _, r2 := range res {
- if r2.Name() == r.Name() {
+ if r2.(resource.NameNormalizedProvider).NameNormalized() == r.(resource.NameNormalizedProvider).NameNormalized() {
found = true
break
}
@@ -1633,7 +1633,7 @@ func (sa *sitePagesAssembler) assembleResources() error {
TargetBasePaths: targetBasePaths,
BasePathRelPermalink: targetPaths.SubResourceBaseLink,
BasePathTargetPath: baseTarget,
- Name: relPath,
+ NameNormalized: relPath,
NameOriginal: relPathOriginal,
LazyPublish: !ps.m.pageConfig.Build.PublishResources,
}
diff --git a/hugolib/pagebundler_test.go b/hugolib/pagebundler_test.go
index ff7998ed9..a46ef0b56 100644
--- a/hugolib/pagebundler_test.go
+++ b/hugolib/pagebundler_test.go
@@ -871,7 +871,7 @@ RegularPages: {{ range .RegularPages }}{{ .RelPermalink }}|File LogicalName: {{
b := Test(t, files)
// Note that the sort order gives us the most specific data file for the en language (the data.en.json).
- b.AssertFileContent("public/mysection/mybundle/index.html", `Single:|/mysection/mybundle|File LogicalName: index.md||/mysection/mybundle/|page|Resources: data.json: Data JSON.|foo/p1.html: |p1.html: |p1.md: |data.txt: Data en txt.|$`)
+ b.AssertFileContent("public/mysection/mybundle/index.html", `Single:|/mysection/mybundle|File LogicalName: index.md||/mysection/mybundle/|page|Resources: data.en.txt: Data en txt.|data.json: Data JSON.|foo/p1.html: |p1.html: |p1.md: |$`)
b.AssertFileContent("public/mysection/index.html",
"List: |/mysection|File LogicalName: _index.md|/mysection/|section|Resources: sectiondata.json: Secion data JSON.|sectiondata.txt: Section data TXT.|$",
"RegularPages: /mysection/foo/p2/|File LogicalName: p2.md|/mysection/mybundle/|File LogicalName: index.md|/mysection/p2/|File LogicalName: p2.md|$")
@@ -886,12 +886,12 @@ baseURL = "https://example.com"
F1.
-- layouts/_default/single.html --
GetMatch: {{ with .Resources.GetMatch "f1.en.*" }}{{ .Name }}: {{ .Content }}|{{ end }}
-Match: {{ range .Resources.Match "f1.en.*" }}{{ .Name }}: {{ .Content }}|{{ end }}
+Match: {{ range .Resources.Match "f1.En.*" }}{{ .Name }}: {{ .Content }}|{{ end }}
`
b := Test(t, files)
- b.AssertFileContent("public/mybundle/index.html", "GetMatch: f1.txt: F1.|", "Match: f1.txt: F1.|")
+ b.AssertFileContent("public/mybundle/index.html", "GetMatch: f1.en.txt: F1.|", "Match: f1.en.txt: F1.|")
}
func TestBundleResourcesWhenLanguageVariantIsDraft(t *testing.T) {
@@ -917,5 +917,5 @@ GetMatch: {{ with .Resources.GetMatch "f1.*" }}{{ .Name }}: {{ .Content }}|{{ en
b := Test(t, files)
- b.AssertFileContent("public/mybundle/index.html", "GetMatch: f1.txt: F1.|")
+ b.AssertFileContent("public/mybundle/index.html", "GetMatch: f1.en.txt: F1.|")
}