Skip to content

Commit

Permalink
chore: Use slugs with - instead of + by default in quick navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitcheljager committed Nov 26, 2024
1 parent e633bcb commit 63ce8a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/wiki/_quick_navigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div data-role="content-to-toggle" style="<%= "display: none" if @article.category.title != category.to_s %>">
<% props.each do |content| %>
<%= link_to content["en-US"],
CGI.escape(content["en-US"]).downcase,
CGI.escape(content["en-US"].gsub(/[^0-9a-z ]/i, "").parameterize).gsub("+", "-").downcase,
class: "quick-navigation__item #{ "quick-navigation__item--active" if @article.title == content["en-US"] }",
data: { prefetch: false, role: ( 'scroll-into-view-on-load' if @article.title == content["en-US"]) } %>
<% end %>
Expand All @@ -36,7 +36,7 @@
<div data-role="content-to-toggle" style="<%= "display: none" if @article.category.title != "Constants" %>">
<% constants.each do |name| %>
<%= link_to name,
CGI.escape(name).downcase,
CGI.escape(name.gsub(/[^0-9a-z ]/i, "").parameterize).gsub("+", "-").downcase,
class: "quick-navigation__item #{ "quick-navigation__item--active" if @article.title == name }",
data: { prefetch: false } %>
<% end %>
Expand Down

0 comments on commit 63ce8a2

Please sign in to comment.