Skip to content

Commit 5949429

Browse files
authored
Fix: rendering of empty product page link in header template (#94)
* fix: rendering of empty product page link in header template * fix: apply same css to the new p-logo div
1 parent fdbf4f5 commit 5949429

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

canonical_sphinx/theme/static/header.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ ul.p-navigation__links li a {
6969
width: 100%;
7070
}
7171

72+
ul.p-navigation__links li div.p-logo {
73+
line-height: 1.5rem;
74+
padding: 1rem 0;
75+
}
76+
7277
ul.p-navigation__links .p-navigation__link {
7378
color: #ffffff;
7479
font-weight: 300;

canonical_sphinx/theme/templates/header.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@
55
<ul class="p-navigation__links" role="menu">
66

77
<li>
8+
{% if product_page %}
89
<a class="p-logo" href="https://{{ product_page }}" aria-current="page">
910
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
1011
<div class="p-logo-text p-heading--4">{{ project }}
1112
</div>
1213
</a>
14+
{% else %}
15+
<div class="p-logo">
16+
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
17+
<div class="p-logo-text p-heading--4">{{ project }}
18+
</div>
19+
</div>
20+
{% endif %}
1321
</li>
1422

1523
<li class="nav-ubuntu-com">
24+
{% if product_page %}
1625
<a href="https://{{ product_page }}" class="p-navigation__link">{{ product_page }}</a>
26+
{% endif %}
1727
</li>
1828

1929
<li>

0 commit comments

Comments
 (0)