Skip to content

Commit b9a2300

Browse files
authored
Merge pull request #5050 from alphagov/improve-apps-and-repos-breadcrumbs
Improve apps and repos breadcrumbs
2 parents ec2eac9 + 2a50dd9 commit b9a2300

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/layouts/repo_layout.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<% end %>
1717

1818
<% wrap_layout :core do %>
19-
<% app_slug = current_page.path.match(/repos\/([^\/]+)\//) %>
19+
<% repo_slug = current_page.path.match(/repos\/([^\/]+)\//) %>
2020
<%= GovukPublishingComponents.render("govuk_publishing_components/components/breadcrumbs", {
2121
breadcrumbs: [
2222
{ title: "Home", url: "/" },
23-
current_page.path != "apps.html" ? { title: "Apps", url: "/apps.html" } : nil,
24-
app_slug ? { title: app_slug[1], url: "/repos/#{app_slug[1]}.html" } : nil,
23+
repo.is_app? ? { title: "Apps", url: "/apps.html" } : { title: "Repos", url: "/repos.html" },
24+
repo_slug ? { title: repo_slug[1], url: "/repos/#{repo_slug[1]}.html" } : nil,
2525
].compact,
2626
}) %>
2727
<%= partial 'partials/last_updated' if current_page.data.show_last_updated %>

0 commit comments

Comments
 (0)