New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpl: Add a querify function to generate query strings inside templates #2257

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@jimmysawczuk
Contributor

jimmysawczuk commented Jul 5, 2016

The querify function will take a set of parameters specified like a dict and return a url.Values object which can be .Encode'd into a query string.

Example:

<a href="http://www.google.com?{{ (querify "q" "test" "page" 3).Encode | safeHTML }}">Search</a>

Returns:

<a href="http://www.google.com?page=3&q=test">Search</a>
@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 5, 2016

Member

Looks good. Could you "correct" your commit messages (I know, pedantic, but we like the imperative mood and titles without period at the end).

Member

bep commented Jul 5, 2016

Looks good. Could you "correct" your commit messages (I know, pedantic, but we like the imperative mood and titles without period at the end).

tpl: Add a querify function to generate query strings inside templates
The query function will take a set of parameters specified like a dict and return a url.Values object which can be .Encode'd into a query string.

Example:

<a href="http://www.google.com?{{ (querify "q" "test" "page" 3).Encode | safeHTML }}">Search</a>

Returns:

<a href="http://www.google.com?page=3&q=test">Search</a>

@jimmysawczuk jimmysawczuk changed the title from tpl: Adds a querify function to generate query strings inside templates. to tpl: Add a querify function to generate query strings inside templates Jul 5, 2016

@jimmysawczuk

This comment has been minimized.

Show comment
Hide comment
@jimmysawczuk

jimmysawczuk Jul 5, 2016

Contributor

@bep no problem, fixed (I think) (and squashed into one commit).

Contributor

jimmysawczuk commented Jul 5, 2016

@bep no problem, fixed (I think) (and squashed into one commit).

@bep bep closed this in fbf4882 Jul 5, 2016

tychoish added a commit to tychoish/hugo that referenced this pull request Aug 13, 2017

tpl: Add a querify function to generate query strings inside templates
The query function will take a set of parameters specified like a dict and return a url.Values object which can be .Encode'd into a query string.

Example:

<a href="http://www.google.com?{{ (querify "q" "test" "page" 3).Encode | safeHTML }}">Search</a>

Returns:

<a href="http://www.google.com?page=3&q=test">Search</a>

Closes gohugoio#2257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment