Skip to content

Commit

Permalink
Fixed breadcrumbs (#96)
Browse files Browse the repository at this point in the history
* Fixed breadcrumbs

Added breadcrumb chevron back in, and changed to show inside hero instead of content when one exists

* Added check in case there is a hero
  • Loading branch information
SociableSteve authored Jul 31, 2023
1 parent e1d5b1e commit c7ef588
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions assets/images/icons/svgs/chevron-right-n400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion assets/style/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
margin: 0;
padding: 0;
line-height: 1.3rem;
color: var(--neutral-n400);
}

.breadcrumbs li:not(:first-of-type) {
background-image: url("/images/chevron_right.svg");
background-image: url("/images/icons/svgs/chevron-right-n400.svg");
background-repeat: no-repeat;
padding-left: 1.625rem; /* make space for the background image */
}
Expand Down
16 changes: 11 additions & 5 deletions layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
>
<%= render("/_sitehead/") %>
<body>
<%= render("/components/header/") %> <%= render("/_nav/",
:section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0)
%> <% if @item[:hero] %>
<section class="hero"><%= render(@item[:hero]) %></section>
<%= render("/components/header/") %>
<%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %>

<% if @item[:hero] %>
<section class="hero">
<% if (@item.identifier != '/') %>
<%= render("/components/breadcrumbs/") %>
<% end %>
<%= render(@item[:hero]) %>
</section>
<%end%>

<main>
Expand All @@ -29,7 +35,7 @@
<% end %>

<section class="content">
<% if (@item.identifier != '/') %>
<% if (@item.identifier != '/' && !@item[:hero]) %>
<%= render("/components/breadcrumbs/") %>
<% end %>

Expand Down

0 comments on commit c7ef588

Please sign in to comment.