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
26 changes: 26 additions & 0 deletions _includes/back-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% assign back_href = nil %}
{% assign back_label = nil %}

{% assign path = page.url | remove: 'index.html' %}
{% unless path == '/' %}
{% if path == '/projects/' or path == '/projects' or path == '/writings/' or path == '/writings' or path == '/films/' or path == '/films' or path == '/contact/' or path == '/contact' %}
{% assign back_href = '/' %}
{% assign back_label = 'Home' %}
{% elsif page.collection == 'projects' %}
{% assign back_href = '/projects' %}
{% assign back_label = 'Projects' %}
{% elsif page.collection == 'films' %}
{% assign back_href = '/films' %}
{% assign back_label = 'Films' %}
{% elsif page.categories contains 'writings' %}
{% assign back_href = '/writings' %}
{% assign back_label = 'Writings' %}
{% endif %}
{% endunless %}

{% if back_href %}
<a href="{{ back_href | relative_url }}" class="back-link">
<svg class="back-link-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m12 19-7-7 7-7"/><path d="M19 12H5"/></svg>
{{ back_label }}
</a>
{% endif %}
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

<!-- Main Content Container -->
<div class="container">
{% include back-link.html %}
{{ content }}
</div>

Expand Down
27 changes: 27 additions & 0 deletions _sass/_biscuit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,33 @@ figcaption {
}
}

/* Back link above page titles */
.back-link {
display: inline-flex;
align-items: center;
gap: 0.375rem;
margin-bottom: 1.25rem;
font-size: 0.875rem;
text-decoration: none;
color: rgb(var(--fg) / 0.5);
transition: color 0.25s ease, transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);

&:hover {
color: rgb(var(--fg));
transform: translateX(-2px);
}

&-icon {
flex-shrink: 0;
}
}

@media (prefers-reduced-motion: reduce) {
.back-link:hover {
transform: none;
}
}

/* Shared prev/next nav cards (writings, films, projects) */
.post-nav {
margin-top: 5rem;
Expand Down
Loading