Skip to content

Commit

Permalink
Remove rest_menu_url filter
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and syphar committed Sep 21, 2024
1 parent ada6f3a commit 0620ea4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/web/page/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,6 @@ pub mod filters {
serde_json::to_string(value).expect("`encode_json` failed"),
))
}

pub fn rest_menu_url(current_target: &str, inner_path: &str) -> rinja::Result<String> {
if current_target.is_empty() {
return Ok(String::new());
}
Ok(format!("/{current_target}/{inner_path}"))
}
}

enum IconType {
Expand Down
6 changes: 3 additions & 3 deletions templates/rustdoc/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{%- include "header/topbar_begin.html" -%}
{%- set crate_url = "/crate/{}/{}"|format(metadata.name, metadata.req_version) -%}
{%- set rest_menu_url -%}
{%- if current_target is defined -%}
{%- set rest_menu_url = current_target|rest_menu_url(inner_path) -%}
{%- if current_target is defined && !current_target.is_empty() -%}
{%- set rest_menu_url = format!("/{}/{}", self.current_target, self.inner_path) -%}
{%- else -%}
{%- set rest_menu_url = ""|rest_menu_url(inner_path) -%}
{%- set rest_menu_url = String::new() -%}
{%- endif -%}
{%- set platform_menu_url = "{}/menus/platforms{}"|format(crate_url, rest_menu_url) -%}
{%- set releases_menu_url = "{}/menus/releases{}"|format(crate_url, rest_menu_url) -%}
Expand Down

0 comments on commit 0620ea4

Please sign in to comment.