hugolib, output: Restrict Render to regular Pages

Using it for list pages doesn't work and has potential weird side-effects.

The user probably meant to range over .Site.ReqularPages, and that is now marked clearly in the log.
This commit is contained in:
Bjørn Erik Pedersen
2017-03-26 19:34:30 +02:00
parent e49a2b83ad
commit 930a3df1b7
6 changed files with 50 additions and 16 deletions

View File

@@ -1721,3 +1721,11 @@ func (p *Page) setValuesForKind(s *Site) {
p.URLPath.URL = "/" + path.Join(p.sections...) + "/"
}
}
// Used in error logs.
func (p *Page) pathOrTitle() string {
if p.Path() != "" {
return p.Path()
}
return p.Title
}