hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit a0447345418e735a4b0fd401c1610950f66ed778
parent 32bf8b763c647cac81decf0470824317fc31f8fc
Author: quoha <quoha@quoha.org>
Date:   Sun, 15 Mar 2015 20:56:20 -0500

Add "getenv" as an wrapper for os.Getenv

Add a wrapper for the os.Getenv function. The
wrapper takes as input a string that is assumed to be an exported
variable name.

Fixes #977

Diffstat:
Mtpl/template.go | 1+
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/tpl/template.go b/tpl/template.go
@@ -1341,6 +1341,7 @@ func init() {
 		"getCSV":      GetCSV,
 		"getCsv":      GetCSV,
 		"seq":         helpers.Seq,
+		"getenv":      func(varName string) string { return os.Getenv(varName) },
 	}
 
 }