mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	@@ -730,7 +730,7 @@ func (h *HugoSites) processPartial(ctx context.Context, l logg.LevelLogger, conf
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		case files.ComponentFolderLayouts:
 | 
							case files.ComponentFolderLayouts:
 | 
				
			||||||
			tmplChanged = true
 | 
								tmplChanged = true
 | 
				
			||||||
			templatePath := pathInfo.TrimLeadingSlash().PathNoLang()
 | 
								templatePath := pathInfo.Unnormalized().TrimLeadingSlash().PathNoLang()
 | 
				
			||||||
			if !h.Tmpl().HasTemplate(templatePath) {
 | 
								if !h.Tmpl().HasTemplate(templatePath) {
 | 
				
			||||||
				tmplAdded = true
 | 
									tmplAdded = true
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1490,3 +1490,27 @@ title: "Default"
 | 
				
			|||||||
	// Just make sure that it doesn't panic.
 | 
						// Just make sure that it doesn't panic.
 | 
				
			||||||
	b.EditFileReplaceAll("archetypes/default.md", "Default", "Default Edited").Build()
 | 
						b.EditFileReplaceAll("archetypes/default.md", "Default", "Default Edited").Build()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestRebuildEditMixedCaseTemplateFileIssue12165(t *testing.T) {
 | 
				
			||||||
 | 
						t.Parallel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						files := `
 | 
				
			||||||
 | 
					-- hugo.toml --
 | 
				
			||||||
 | 
					baseURL = "https://example.com"
 | 
				
			||||||
 | 
					disableLiveReload = true
 | 
				
			||||||
 | 
					-- layouts/partials/MyTemplate.html --
 | 
				
			||||||
 | 
					MyTemplate
 | 
				
			||||||
 | 
					-- layouts/index.html --
 | 
				
			||||||
 | 
					MyTemplate: {{ partial "MyTemplate.html" . }}|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						b := TestRunning(t, files)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						b.AssertFileContent("public/index.html", "MyTemplate: MyTemplate")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						b.EditFileReplaceAll("layouts/partials/MyTemplate.html", "MyTemplate", "MyTemplate Edited").Build()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						b.AssertFileContent("public/index.html", "MyTemplate: MyTemplate Edited")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user