From ae92dc26a43363fadb9bc6fe8584f1061e0fcce8 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 28 Aug 2019 17:08:48 -0700 Subject: [PATCH] add docs for ship template function UrlPathEscape added in https://github.com/replicatedhq/ship/pull/1059 --- .../docs/ship/template-functions/template-types.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/docs/ship/template-functions/template-types.md b/content/docs/ship/template-functions/template-types.md index 163e53be8..d5292cb6c 100644 --- a/content/docs/ship/template-functions/template-types.md +++ b/content/docs/ship/template-functions/template-types.md @@ -90,10 +90,21 @@ Trim returns a string with all leading and trailing string contained in the opti func UrlEncode(stringToEncode string) string ``` Returns the string, url encoded. +Equivalent to the [`QueryEscape`](https://godoc.org/net/url#QueryEscape) function within the golang `net/url` library. ```yaml '{{repl ConfigOption "smtp_email" | UrlEncode }}:{{repl ConfigOption "smtp_password" | UrlEncode }}@smtp.example.com:587' ``` +{{< template_function name="UrlEncode" >}} +```go +func UrlPathEscape(stringToEncode string) string +``` +Returns the string, url *path* encoded. +Equivalent to the [`PathEscape`](https://godoc.org/net/url#PathEscape) function within the golang `net/url` library. +```yaml +'{{repl ConfigOption "smtp_email" | UrlPathEscape }}:{{repl ConfigOption "smtp_password" | UrlPathEscape }}@smtp.example.com:587' +``` + {{< template_function name="Base64Encode" >}} ```go func Base64Encode(stringToEncode string) string