shithub: hugo

Download patch

ref: 707d3cf13777a23ba6ab39d8d00d41f02b8c6a68
parent: 7d072fbbe62703c11d2b8a13e840390bbe469bdc
author: digitalcraftsman <digitalcraftsman@protonmail.com>
date: Sat Dec 31 12:55:03 EST 2016

docs, tpl: Fix documentation of  UniqueID

See #2861

--- a/docs/content/templates/variables.md
+++ b/docs/content/templates/variables.md
@@ -68,7 +68,7 @@
 **.Truncated** A boolean, `true` if the `.Summary` is truncated.  Useful for showing a "Read more..." link only if necessary.  See [Summaries](/content/summaries/) for more details.<br>
 **.Type** The content [type](/content/types/) (e.g. post).<br>
 **.URL** The relative URL for this page. Note that if `URL` is set directly in frontmatter, that URL is returned as-is.<br>
-**.UniqueID** The MD5-checksum of the page's filename<br>
+**.UniqueID** The MD5-checksum of the content file's path<br>
 **.Weight** Assigned weight (in the front matter) to this content, used in sorting.<br>
 **.WordCount** The number of words in the content.<br>
 
--- a/source/file.go
+++ b/source/file.go
@@ -32,13 +32,13 @@
 	section     string // The first directory
 	dir         string // The relative directory Path (minus file name)
 	ext         string // Just the ext (eg txt)
-	uniqueID    string // MD5 of the filename
+	uniqueID    string // MD5 of the file's path
 
 	translationBaseName string // `post` for `post.es.md` (if `Multilingual` is enabled.)
 	lang                string // The language code if `Multilingual` is enabled
 }
 
-// UniqueID is the MD5 hash of the filename and is for most practical applications,
+// UniqueID is the MD5 hash of the file's path and is for most practical applications,
 // Hugo content files being one of them, considered to be unique.
 func (f *File) UniqueID() string {
 	return f.uniqueID
--