Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions website/modules/asset/ui/src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,46 @@
line-height: 150%;
}
}

.breadcrumb {
font-weight: $font-weight-medium;
font-size: $font-size-body-small-mobile;
line-height: 150%;
margin-left: 40px;
color: $black;
@include breakpoint-extra-extra-large {
margin-left: 120px;
}
}

.breadcrumb-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-wrap: wrap;
gap: 6px;
}

.breadcrumb-item::after {
content: '/';
margin-left: 6px;
color: $gray-300;
}

.breadcrumb-item:last-child::after {
content: '';
}

.breadcrumb-link {
color: $gray-300;
text-decoration: none;
}

.breadcrumb-link:hover {
text-decoration: underline;
}

.breadcrumb-home {
color: $gray-300;
}
30 changes: 30 additions & 0 deletions website/views/fragments/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,34 @@
<footer class="sf-container">
<p class="sf-copy">&#169; {{ data.currentYear or '2025' }} S&F</p>
</footer>
{% fragment breadcrumbs() %}
<nav class="breadcrumb" aria-label="Breadcrumb navigation">
<ol class="breadcrumb-list">
{% if data.page._url == data.home._url %}
<li class="breadcrumb-home" aria-current="page">
<span>S&amp;F Home</span>
</li>
{% else %} {% for page in data.page._ancestors %}
<li class="breadcrumb-item">
<a href="{{ page._url }}" class="breadcrumb-link">
{% if page._url == data.home._url %} Home {% else %} {{ page.title }} {%
endif %}
</a>
</li>
{% endfor %} {% if data.piece %}
<li class="breadcrumb-item">
<a href="{{ data.page._url }}" class="breadcrumb-link">
{{ data.page.title }}
</a>
</li>
<li class="breadcrumb-item breadcrumb-item-current" aria-current="page">
<span>{{ data.piece.title }}</span>
</li>
{% else %}
<li class="breadcrumb-item breadcrumb-item-current" aria-current="page">
<span>{{ data.page.title }}</span>
</li>
{% endif %} {% endif %}
</ol>
</nav>
{% endfragment %}
24 changes: 20 additions & 4 deletions website/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,30 @@
override the title block in a template that does not have access to an
Apostrophe page or piece.') }} {% endif %} {% endblock %} {% block beforeMain %}
<a class="sr-only" href="#main">Skip to content</a>
<div class="bp-wrapper relative" data-barba="wrapper" data-barba-namespace="home">
{% render fragments.header() %}
<main class="bp-main" role="main" id="main" {% if not data.user %}data-barba="container"{% endif %}>
<div
class="bp-wrapper relative"
data-barba="wrapper"
data-barba-namespace="home"
>
{% render fragments.header() %} {% render fragments.breadcrumbs() %}
<main
class="bp-main"
role="main"
id="main"
{%
if
not
data.user
%}data-barba="container"
{%
endif
%}
>
<div class="sf-container">
{% endblock %} {% block main %} {# Usually, your page templates in the
@apostrophecms/pages module will override this block. It is safe to assume
this is where your page-specific content should go. #} {% endblock %} {%
block afterMain %}
block afterMain %}
</div>
</main>
{% render fragments.footer() %}
Expand Down