mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-11 18:51:36 +00:00
parent
ba8a00a6f9
commit
0ba9fb9631
1 changed files with 10 additions and 0 deletions
|
@ -880,6 +880,16 @@ Takes a string and sanitizes it for usage in URLs, converts spaces to "-".
|
|||
e.g. `<a href="/tags/{{ . | urlize }}">{{ . }}</a>`
|
||||
|
||||
|
||||
### querify
|
||||
|
||||
Takes a set of key-value pairs and returns a [`url.Values`](https://godoc.org/net/url#Values) object. The [`Encode`](https://godoc.org/net/url#Values.Encode) method turns the pairs into a [query string](https://en.wikipedia.org/wiki/Query_string) that cen be postpended to a url. E.g.
|
||||
|
||||
<a href="https://www.google.com?{{ (querify "q" "test" "page" 3).Encode | safeHTML }}">Search</a>
|
||||
|
||||
will be rendered as
|
||||
|
||||
<a href="https://www.google.com?page=3&q=test">Search</a>
|
||||
|
||||
|
||||
## Content Views
|
||||
|
||||
|
|
Loading…
Reference in a new issue