Skip to content

Commit

Permalink
add docs for ship template function UrlPathEscape
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Aug 29, 2019
1 parent b966cb4 commit ae92dc2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions content/docs/ship/template-functions/template-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae92dc2

Please sign in to comment.