Skip to content

Commit be54fdd

Browse files
Remove search_query default value set
1 parent a085300 commit be54fdd

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

templates/core/home.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{%- endblock body_classes -%}
88

99
{%- block topbar -%}
10-
{% set search_query = Some(String::new()) %}
1110
{%- include "header/topbar.html" -%}
1211
{%- endblock topbar -%}
1312

templates/error.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ <h1 id="crate-title">{{ title }}</h1>
1010
{%- endblock header -%}
1111

1212
{%- block topbar -%}
13-
{% set search_query = Some(String::new()) %}
1413
{%- include "header/topbar.html" -%}
1514
{%- endblock topbar -%}

templates/header/topbar_end.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@
6666
{# If there is a search query, put it in the search bar #}
6767
{# The tabindex="-1" is used to prevent it to be the first input focused on the page when using the browser shortcut #}
6868
<input id="nav-search" name="query" type="text" aria-label="Find crate by search query" tabindex="-1"
69-
placeholder="Find crate" {%- if let Some(query) = search_query %}{% if !query.is_empty() %} value="{{ query }}" {%- endif %}{% endif %}>
69+
placeholder="Find crate"
70+
{% if search_query is defined %}
71+
{%- if let Some(query) = search_query %}
72+
{%- if !query.is_empty() +%}
73+
value="{{ query }}"
74+
{%- endif %}
75+
{%- endif %}
76+
{%- endif %}>
7077
</div>
7178
</form>
7279
</div>

templates/releases/releases.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
{%- endblock header -%}
1717

1818
{%- block topbar -%}
19-
{% set search_query = Some(String::new()) %}
2019
{%- include "header/topbar.html" -%}
2120
{%- endblock topbar -%}
2221

templates/rustdoc/topbar.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{# The url of the current release, `/crate/:name/:version` #}
22
{%- import "macros.html" as macros -%}
33

4-
{% set search_query = Some(String::new()) %}
54
{%- include "header/topbar_begin.html" -%}
65
{%- set crate_url = "/crate/{}/{}"|format(metadata.name, metadata.req_version) -%}
76
{%- set rest_menu_url -%}

0 commit comments

Comments
 (0)