summaryrefslogtreecommitdiffstats
path: root/hugolib/page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-26 19:34:30 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commit930a3df1b79d21f005a63918b89cc01ae5a4cd9e (patch)
tree07955b204d91ee67857beb1af2a6d49da4386086 /hugolib/page.go
parente49a2b83ad9825a978ecbf0ff5fd9b7331690c17 (diff)
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.
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index 84dfa2f43..fa9f40922 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -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
+}