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:
Bjørn Erik Pedersen
2020-03-09 12:04:33 +01:00
parent 8279d2e227
commit ffcb4aeb8e
18 changed files with 168 additions and 309 deletions

View File

@@ -28,7 +28,6 @@ var (
// The content related items on a Page.
type pageContent struct {
renderable bool
selfLayout string
truncated bool
@@ -52,7 +51,7 @@ func (p pageContent) contentToRender(renderedShortcodes map[string]string) []byt
case pageContentReplacement:
c = append(c, v.val...)
case *shortcode:
if !p.renderable || !v.insertPlaceholder() {
if !v.insertPlaceholder() {
// Insert the rendered shortcode.
renderedShortcode, found := renderedShortcodes[v.placeholder]
if !found {