summaryrefslogtreecommitdiff
path: root/docs/content/functions
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2017-07-31 22:50:41 -0400
committerDave Henderson <dhenderson@gmail.com>2017-07-31 23:10:01 -0400
commitf4a7377c5d3a22c19af32b549827f8a0509a76ab (patch)
treecb690698c633491bff4d2007bab932bd3e51862f /docs/content/functions
parent5a8845db8d22c1a74ae6f95654aedb2e5a9da83a (diff)
Moving getenv to separate package
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs/content/functions')
-rw-r--r--docs/content/functions/env.md26
-rw-r--r--docs/content/functions/general.md18
2 files changed, 26 insertions, 18 deletions
diff --git a/docs/content/functions/env.md b/docs/content/functions/env.md
new file mode 100644
index 00000000..ebbf8427
--- /dev/null
+++ b/docs/content/functions/env.md
@@ -0,0 +1,26 @@
+---
+title: env functions
+menu:
+ main:
+ parent: functions
+---
+
+## `env.Getenv`
+
+**Alias:** `getenv`
+
+Exposes the [os.Getenv](https://golang.org/pkg/os/#Getenv) function.
+
+This is a more forgiving alternative to using `.Env`, since missing keys will
+return an empty string.
+
+An optional default value can be given as well.
+
+#### Example
+
+```console
+$ gomplate -i 'Hello, {{env.Getenv "USER"}}'
+Hello, hairyhenderson
+$ gomplate -i 'Hey, {{getenv "FIRSTNAME" "you"}}!'
+Hey, you!
+``` \ No newline at end of file
diff --git a/docs/content/functions/general.md b/docs/content/functions/general.md
index 32aa6820..ab362573 100644
--- a/docs/content/functions/general.md
+++ b/docs/content/functions/general.md
@@ -5,24 +5,6 @@ menu:
parent: functions
---
-## `getenv`
-
-Exposes the [os.Getenv](https://golang.org/pkg/os/#Getenv) function.
-
-This is a more forgiving alternative to using `.Env`, since missing keys will
-return an empty string.
-
-An optional default value can be given as well.
-
-#### Example
-
-```console
-$ gomplate -i 'Hello, {{getenv "USER"}}'
-Hello, hairyhenderson
-$ gomplate -i 'Hey, {{getenv "FIRSTNAME" "you"}}!'
-Hey, you!
-```
-
## `bool`
Converts a true-ish string to a boolean. Can be used to simplify conditional statements based on environment variables or other text input.