shithub: hugo

Download patch

ref: 6180c85fb8f95e01446b74c50cab3f0480305fe4
parent: d3a98325c31d7f02f0762e589a4986e55b2a0da2
author: Bjørn Erik Pedersen <[email protected]>
date: Thu Nov 1 06:04:51 EDT 2018

hugolib: Fix REF_NOT_FOUND logging to include page path

Fixes #5371

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -494,10 +494,10 @@
 }
 
 func (s siteRefLinker) logNotFound(ref, what string, p *Page) {
-	if p != nil {
+	if p == nil {
 		s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q: %s", s.s.Lang(), ref, what)
 	} else {
-		s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q from page %q: %s", s.s.Lang(), ref, p.absoluteSourceRef(), what)
+		s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q from page %q: %s", s.s.Lang(), ref, p.pathOrTitle(), what)
 	}
 
 }