Debian Codegraph @

docs/content/en/functions/go-template/urlquery.md

raw
1 ---
2 title: urlquery
3 description: Returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: []
9 returnType: string
10 signatures: ['urlquery VALUE [VALUE...]']
11 aliases: [/functions/urlquery]
12 ---
13
14 This template code:
15
16 ```go-html-template
17 {{ $u := urlquery "https://" "example.com" | safeURL }}
18 <a href="https://example.org?url={{ $u }}">Link</a>
19 ```
20
21 Is rendered to:
22
23 ```html
24 <a href="https://example.org?url=https%3A%2F%2Fexample.com">Link</a>
25 ```
26
27 {{% include "/_common/functions/go-template/text-template.md" %}}