summaryrefslogtreecommitdiffhomepage
path: root/source
diff options
context:
space:
mode:
authorCameron Moore <[email protected]>2018-09-06 20:40:37 -0500
committerBjørn Erik Pedersen <[email protected]>2018-09-07 08:25:51 +0200
commit30bc4ed0a01f965cc2f9187ccb6ab5d28a3149f6 (patch)
treeec739b714ea03de1f1d9d519feb3f0b1ac94548d /source
parentf6f22ad944a1c308fd823792b2fbff1504f42cef (diff)
downloadhugo-30bc4ed0a01f965cc2f9187ccb6ab5d28a3149f6.tar.gz
hugo-30bc4ed0a01f965cc2f9187ccb6ab5d28a3149f6.zip
Improve some godoc comments
Diffstat (limited to 'source')
-rw-r--r--source/fileInfo.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/fileInfo.go b/source/fileInfo.go
index 7510f306e..fc55706fe 100644
--- a/source/fileInfo.go
+++ b/source/fileInfo.go
@@ -114,31 +114,34 @@ type FileInfo struct {
lazyInit sync.Once
}
-// Filename returns a file's filename.
+// Filename returns a file's absolute path and filename on disk.
func (fi *FileInfo) Filename() string { return fi.filename }
-// Path returns a file's relative path.
+// Path gets the relative path including file name and extension. The directory
+// is relative to the content root.
func (fi *FileInfo) Path() string { return fi.relPath }
-// Dir returns a file's directory.
+// Dir gets the name of the directory that contains this file. The directory is
+// relative to the content root.
func (fi *FileInfo) Dir() string { return fi.relDir }
-// Extension returns a file's extension.
+// Extension is an alias to Ext().
func (fi *FileInfo) Extension() string { return fi.Ext() }
-// Ext returns a file's extension without the leading period.
+// Ext returns a file's extension without the leading period (ie. "md").
func (fi *FileInfo) Ext() string { return fi.ext }
-// Lang returns a file's language.
+// Lang returns a file's language (ie. "sv").
func (fi *FileInfo) Lang() string { return fi.lang }
-// LogicalName returns a file's name.
+// LogicalName returns a file's name and extension (ie. "page.sv.md").
func (fi *FileInfo) LogicalName() string { return fi.name }
-// BaseFileName returns a file's base name.
+// BaseFileName returns a file's name without extension (ie. "page.sv").
func (fi *FileInfo) BaseFileName() string { return fi.baseName }
-// TranslationBaseName returns a file's translation base name.
+// TranslationBaseName returns a file's translation base name without the
+// language segement (ie. "page").
func (fi *FileInfo) TranslationBaseName() string { return fi.translationBaseName }
// Section returns a file's section.
@@ -147,7 +150,7 @@ func (fi *FileInfo) Section() string {
return fi.section
}
-// UniqueID returns a file's unique identifier.
+// UniqueID returns a file's unique, MD5 hash identifier.
func (fi *FileInfo) UniqueID() string {
fi.init()
return fi.uniqueID