mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Fix handling of HTML files without front matter
This means that any HTML file inside /content will be treated as a regular file. If you want it processes with shortcodes and a layout, add front matter. The defintion of an HTML file here is: * File with extension .htm or .html * With first non-whitespace character "<" that isn't a HTML comment. This is in line with the documentation. Fixes #7030 Fixes #7028 See #6789
This commit is contained in:
@@ -54,7 +54,7 @@ func BenchmarkContentMap(b *testing.B) {
|
||||
// real flow, so simulate this here.
|
||||
meta["lang"] = lang
|
||||
meta["path"] = meta.Filename()
|
||||
meta["classifier"] = files.ClassifyContentFile(fi.Name())
|
||||
meta["classifier"] = files.ClassifyContentFile(fi.Name(), meta.GetOpener())
|
||||
|
||||
})
|
||||
}
|
||||
@@ -115,7 +115,7 @@ func TestContentMap(t *testing.T) {
|
||||
// real flow, so simulate this here.
|
||||
meta["lang"] = lang
|
||||
meta["path"] = meta.Filename()
|
||||
meta["classifier"] = files.ClassifyContentFile(fi.Name())
|
||||
meta["classifier"] = files.ClassifyContentFile(fi.Name(), meta.GetOpener())
|
||||
meta["translationBaseName"] = helpers.Filename(fi.Name())
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user