Skip to content

Commit

Permalink
Remove is_latest_version from templates
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and syphar committed Sep 14, 2024
1 parent 79ff6f7 commit 539850a
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion templates/about-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ <h1 id="crate-title" class="no-description">Docs.rs documentation</h1>
{% endblock %}

{%- block topbar -%}
{% set is_latest_version = true %}
{% let search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
1 change: 0 additions & 1 deletion templates/core/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
{%- endblock body_classes -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% set search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
Expand Down
1 change: 0 additions & 1 deletion templates/crate/build_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

{%- block topbar -%}
{%- set inner_path = metadata.target_name_url() -%}
{%- set is_latest_version = true -%}
{%- set is_prerelease = false -%}
{%- set has_crate = false %}
{%- include "rustdoc/topbar.html" -%}
Expand Down
1 change: 0 additions & 1 deletion templates/crate/builds.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

{%- block topbar -%}
{%- set inner_path = metadata.target_name_url() -%}
{%- set is_latest_version = true -%}
{%- include "rustdoc/topbar.html" -%}
{%- endblock topbar -%}

Expand Down
1 change: 0 additions & 1 deletion templates/crate/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

{%- block topbar -%}
{%- set inner_path = metadata.target_name_url() -%}
{%- set is_latest_version = true -%}
{%- include "rustdoc/topbar.html" -%}
{%- endblock topbar -%}

Expand Down
1 change: 0 additions & 1 deletion templates/crate/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

{%- block topbar -%}
{%- set inner_path = metadata.target_name_url() -%}
{%- set is_latest_version = true -%}
{%- include "rustdoc/topbar.html" -%}
{%- endblock topbar -%}

Expand Down
1 change: 0 additions & 1 deletion templates/crate/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

{%- block topbar -%}
{%- set inner_path = metadata.target_name_url() -%}
{%- set is_latest_version = true -%}
{%- include "rustdoc/topbar.html" -%}
{%- endblock topbar -%}

Expand Down
1 change: 0 additions & 1 deletion templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ <h1 id="crate-title">{{ title }}</h1>
{%- endblock header -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% set search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
2 changes: 1 addition & 1 deletion templates/header/topbar_begin.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
method="GET"
id="nav-search-form"
class="landing-search-form-nav {%
if !is_latest_version %}not-latest{% endif
if is_latest_version is defined && !is_latest_version %}not-latest{% endif
%} {% if metadata is defined && metadata.yanked.unwrap_or_default() %}yanked{% endif %}">

{# The top-left logo and name #}
Expand Down
1 change: 0 additions & 1 deletion templates/releases/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{%- endblock header -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% let search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
Expand Down
1 change: 0 additions & 1 deletion templates/releases/build_queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{%- endblock header -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% let search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
Expand Down
1 change: 0 additions & 1 deletion templates/releases/releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
{%- endblock header -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% set search_query = Some(String::new()) %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
Expand Down
1 change: 0 additions & 1 deletion templates/releases/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{%- endblock header -%}

{%- block topbar -%}
{% set is_latest_version = true %}
{% let search_query = search_query %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}
Expand Down
4 changes: 2 additions & 2 deletions templates/rustdoc/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@

{#- If this is the latest release and it's been yanked, just display a warning -#}
{%- set yanked = metadata.yanked.unwrap_or_default() -%}
{%- if is_latest_version && yanked -%}
{%- if (is_latest_version is not defined || is_latest_version) && yanked -%}
<li class="pure-menu-item">
<span class="pure-menu-link warn">
{{ "triangle-exclamation"|fas(false, false, "") }}
Expand All @@ -188,7 +188,7 @@
</li>

{#- If this isn't the most recent stable release, offer a link to the latest -#}
{%- elif !is_latest_version -%}
{%- elif is_latest_version is defined && !is_latest_version -%}
{% set tooltip %}
{% set title %}
{%- if yanked -%}
Expand Down

0 comments on commit 539850a

Please sign in to comment.