Skip to content

Commit 33fae41

Browse files
Nemo157Joshua Nelson
authored and
Joshua Nelson
committed
Link to crate page from navbar on crate page
1 parent fc27066 commit 33fae41

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

templates/rustdoc/topbar.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
{%- include "header/topbar_begin.html" -%}
77

88
<ul class="pure-menu-list">
9-
<li class="pure-menu-item {% if 'skip_package_details' not in __tera_context %}pure-menu-has-children{% endif %}">
9+
{% if 'skip_package_details' in __tera_context %}
10+
<li class="pure-menu-item">
11+
<a href="{{ crate_url | safe }}" class="pure-menu-link" title="{{ krate.description }}">
12+
{{ "cube" | fas }}
13+
<span class="title">{{ krate.name }}-{{ krate.version }}</span>
14+
</a>
15+
</li>
16+
17+
{% else %}
18+
<li class="pure-menu-item pure-menu-has-children">
1019
<a href="#" class="pure-menu-link" title="{{ krate.description }}">
1120
{{ "cube" | fas }}
1221
<span class="title">{{ krate.name }}-{{ krate.version }}</span>
1322
</a>
1423

15-
{% if 'skip_package_details' not in __tera_context %}
1624
{# Crate details #}
1725
<div class="pure-menu-children package-details-menu">
1826
{# Crate name, description and license #}
@@ -160,10 +168,10 @@
160168
</div>
161169
{%- endif -%}
162170
</div>
163-
{%- endif -%}
164-
</li>{#
171+
</li>
172+
{%- endif -%}
165173

166-
If this is the latest release and it's been yanked, just display a warning #}
174+
{# If this is the latest release and it's been yanked, just display a warning #}
167175
{%- if is_latest_version and krate.yanked -%}
168176
<li class="pure-menu-item">
169177
<span class="pure-menu-link warn">

0 commit comments

Comments
 (0)