We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The filter by tag (or category) of the pages widget does not work if the tag (or category) contains a blank space. For example:
pages
# content/talk/mytalk.index.md tags = ["Great tag"]
# content/home/talks.md [content.filters] tag = "Great tag"
This is due to the fact that the query is made on an url in layout/widgets/partials/pages.html:
layout/widgets/partials/pages.html
{{ if $st.Params.content.filters.category }} {{ $archive_page = site.GetPage (printf "categories/%s" $st.Params.content.filters.category) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }}
Hugo will look at webiste.com/tags/Great tag instead of its url version webiste.com/tags/great-tag.
webiste.com/tags/Great tag
webiste.com/tags/great-tag
I suggest to add urlize (3 times: tags, categories, and publication_types):
urlize
{{ if $st.Params.content.filters.category }} {{ $archive_page = site.GetPage (urlize (printf "categories/%s" $st.Params.content.filters.category)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }}
By the way, it might better to allow multiple tags (or categories) as a filter instead of only one?
The text was updated successfully, but these errors were encountered:
5abeaaa
fix(widget): allow spaces in filters in Pages and Featured widgets
81ebbc4
Fix HugoBlox#1388
793e62e
No branches or pull requests
Problem
The filter by tag (or category) of the
pages
widget does not work if the tag (or category) contains a blank space. For example:This is due to the fact that the query is made on an url in
layout/widgets/partials/pages.html
:Hugo will look at
webiste.com/tags/Great tag
instead of its url versionwebiste.com/tags/great-tag
.Possible fix
I suggest to add
urlize
(3 times: tags, categories, and publication_types):Enhancement?
By the way, it might better to allow multiple tags (or categories) as a filter instead of only one?
The text was updated successfully, but these errors were encountered: