From 5abeaaac7e5d65b749566e834a7b09508a1aff3a Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 19 Oct 2019 21:15:11 +0100 Subject: [PATCH] fix(widget): allow spaces in filters in Pages and Featured widgets Fix #1388 --- layouts/partials/widgets/featured.html | 4 ++-- layouts/partials/widgets/pages.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/widgets/featured.html b/layouts/partials/widgets/featured.html index 1b5948e5..91bb1f91 100644 --- a/layouts/partials/widgets/featured.html +++ b/layouts/partials/widgets/featured.html @@ -12,11 +12,11 @@ {{/* Filters */}} {{ if $st.Params.content.filters.tag }} - {{ $archive_page := site.GetPage (printf "tags/%s" $st.Params.content.filters.tag) }} + {{ $archive_page := site.GetPage (printf "tags/%s" (urlize $st.Params.content.filters.tag)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.category }} - {{ $archive_page := site.GetPage (printf "categories/%s" $st.Params.content.filters.category) }} + {{ $archive_page := site.GetPage (printf "categories/%s" (urlize $st.Params.content.filters.category)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.publication_type }} diff --git a/layouts/partials/widgets/pages.html b/layouts/partials/widgets/pages.html index 9f9a1d14..11639dc8 100644 --- a/layouts/partials/widgets/pages.html +++ b/layouts/partials/widgets/pages.html @@ -19,11 +19,11 @@ {{/* Filters */}} {{ if $st.Params.content.filters.tag }} - {{ $archive_page = site.GetPage (printf "tags/%s" $st.Params.content.filters.tag) }} + {{ $archive_page = site.GetPage (printf "tags/%s" (urlize $st.Params.content.filters.tag)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.category }} - {{ $archive_page = site.GetPage (printf "categories/%s" $st.Params.content.filters.category) }} + {{ $archive_page = site.GetPage (printf "categories/%s" (urlize $st.Params.content.filters.category)) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ if $st.Params.content.filters.publication_type }}