shithub: hugo

Download patch

ref: 4f0665f476e06e9707621c18f7422fdeb776e0d1
parent: fc8c5ad824160cbf0868a8fb54c24a382626c73c
author: Vas Sudanagunta <[email protected]>
date: Fri May 25 15:59:58 EDT 2018

Enhance Page and Resource String()

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -2013,7 +2013,11 @@
 }
 
 func (p *Page) String() string {
+	if p.Path() != "" {
+		return fmt.Sprintf("Page(%s)", p.Path())
+	}
 	return fmt.Sprintf("Page(%q)", p.title)
+
 }
 
 // Scratch returns the writable context associated with this Page.
--- a/resource/resource.go
+++ b/resource/resource.go
@@ -419,8 +419,6 @@
 	// The relative path to this resource.
 	relTargetPath dirFile
 
-	file string
-
 	// Base is set when the output format's path has a offset, e.g. for AMP.
 	base string
 
@@ -552,6 +550,10 @@
 
 func (l *genericResource) AbsSourceFilename() string {
 	return l.sourceFilename
+}
+
+func (l *genericResource) String() string {
+	return fmt.Sprintf("Resource(%s: %s)", l.resourceType, l.name)
 }
 
 func (l *genericResource) Publish() error {