Skip to content

Commit

Permalink
Fix category and tag filters
Browse files Browse the repository at this point in the history
  • Loading branch information
rcvalle committed Nov 14, 2024
1 parent e4b9a0d commit 20a5634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _plugins/category_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module CategoryFilter
def category_url(category)
site = @context.registers[:site]
if site.config["categories_dir"]
"#{site.config["url"]}/#{site.config["baseurl"]}/#{site.config["categories_dir"]}/#{category.tr(" ", "-")}/"
"#{site.config["url"]}/#{site.config["categories_dir"]}/#{category.tr(" ", "-")}/"
else
"#{site.config["url"]}/#{site.config["baseurl"]}/categories/#{category.tr(" ", "-")}/"
"#{site.config["url"]}/categories/#{category.tr(" ", "-")}/"
end.gsub(/\/\/+/).with_index { |_, i| i.zero? ? "//" : "/" }
end
end
Expand Down
4 changes: 2 additions & 2 deletions _plugins/tag_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module TagFilter
def tag_url(tag)
site = @context.registers[:site]
if site.config["tags_dir"]
"#{site.config["url"]}/#{site.config["baseurl"]}/#{site.config["tags_dir"]}/#{tag.tr(" ", "-")}/"
"#{site.config["url"]}/#{site.config["tags_dir"]}/#{tag.tr(" ", "-")}/"
else
"#{site.config["url"]}/#{site.config["baseurl"]}/tags/#{tag.tr(" ", "-")}/"
"#{site.config["url"]}/tags/#{tag.tr(" ", "-")}/"
end.gsub(/\/\/+/).with_index { |_, i| i.zero? ? "//" : "/" }
end
end
Expand Down

0 comments on commit 20a5634

Please sign in to comment.