Skip to content

Commit 01d2017

Browse files
committed
Allow separate logo-href only for logo (use site root if none provided)
This improves the behavior for #1922, allowing the logo-href to only target the link around the logo (rather than overriding the link used for the title text as well).
1 parent 82b3018 commit 01d2017

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

src/resources/projects/website/navigation/quarto-nav.scss

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,32 @@ header.headroom--unpinned {
5959
}
6060

6161
.navbar-brand {
62-
text-overflow: ellipsis;
6362
overflow: hidden;
63+
text-overflow: ellipsis;
64+
}
65+
66+
.navbar-brand-container {
6467
max-width: calc(100% - 85px);
68+
min-width: 0;
69+
display: flex;
70+
align-items: center;
71+
margin-right: 1em;
72+
}
73+
74+
.navbar-brand.navbar-brand-logo {
75+
margin-right: 4px;
76+
display: inline-flex;
6577
}
6678

6779
.navbar-toggler {
6880
flex-basis: content;
6981
flex-shrink: 0;
7082
}
7183

72-
.navbar-brand > img {
84+
.navbar-logo {
7385
max-height: 24px;
7486
width: auto;
75-
padding-right: 6px;
87+
padding-right: 4px;
7688
}
7789

7890
nav .nav-item:not(.compact) {
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
<% if (navbar.title || navbar.logo) { %>
2-
<a class="navbar-brand" href="<%- navbar['logo-href'] || '/index.html' %>">
2+
<div class="navbar-brand-container">
33
<% if (navbar.logo) { %>
4-
<img src="<%- navbar.logo %>" alt="<%- navbar['logo-alt'] || '' %>" />
4+
<a href="<%- navbar['logo-href'] || '/index.html' %>" class="navbar-brand navbar-brand-logo">
5+
<img src="<%- navbar.logo %>" alt="<%- navbar['logo-alt'] || '' %>" class="navbar-logo" />
6+
</a>
57
<% } %>
8+
9+
610
<% if (navbar.title) { %>
11+
<a class="navbar-brand" href="/index.html">
712
<span class="navbar-title"><%- navbar.title %></span>
13+
</a>
814
<% } %>
9-
</a>
15+
</div>
1016
<% } %>

0 commit comments

Comments
 (0)