diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-03-09 12:04:33 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-03-09 15:01:55 +0100 |
commit | ffcb4aeb8e392a80da7cad0f1e03a4102efb24ec (patch) | |
tree | 945afe631ef8451f8a401b0a159a78b64e905713 /hugolib/page.go | |
parent | 8279d2e2271ee64725133d36a12d1d7e2158bffd (diff) |
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
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 9db825256..f0f695227 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -449,12 +449,6 @@ func (p *pageState) initOutputFormat(isRenderingSite bool, idx int) error { return err } - if !p.renderable { - if _, err := p.Content(); err != nil { - return err - } - } - return nil } @@ -679,8 +673,6 @@ func (p *pageState) mapContent(bucket *pagesMapBucket, meta *pageMeta) error { s := p.shortcodeState - p.renderable = true - rn := &pageContentMap{ items: make([]interface{}, 0, 20), } @@ -703,12 +695,6 @@ Loop: switch { case it.Type == pageparser.TypeIgnore: - case it.Type == pageparser.TypeHTMLStart: - // This is HTML without front matter. It can still have shortcodes. - p.selfLayout = "__" + p.File().Filename() - p.renderable = false - p.s.BuildFlags.HasLateTemplate.CAS(false, true) - rn.AddBytes(it) case it.IsFrontMatter(): f := pageparser.FormatFromFrontMatterType(it.Type) m, err := metadecoders.Default.UnmarshalToMap(it.Val, f) |