I have a hugo template and I am giving hyperlink from one page to another page. I would like to pass some query parameters in the URL and read them in the template.
/list-page/?{{(querify "somekey" "value")}}
what I want to do is to check in /list-page/ if there is a ?somekey=value in the url. if there is, I would like to filter the list according to the parameter passed. If not, I will display the entire list. If it is not clear, I can try to explain more. I have tried {{ $value := (.Get "value") }} But this brakes it. it does not work at all. I am using Hugo Static Site Generator v0.55.6 Any help is appreciated.
That is an interesting way to get the effects of a dynamic web page within the static framework! You could even have buttons on the page to filter the list (and even update the query in the URL…). I’ll have to try this!
Well, yes. Thank you guys all. In the end I decided to read the url parameters with javascript in the page and filter the results accordingly. I was expecting to see a flash between unfiltered/filtered items in the page but luckily that was not the case.