Skip to content

Commit

Permalink
Fix the wget footer
Browse files Browse the repository at this point in the history
...by having it use the absolute url instead of the breadcrumbs
  • Loading branch information
Silux committed Feb 21, 2023
1 parent 53bac03 commit 067edc3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn page(
}
}
nav {
(qr_spoiler(conf.show_qrcode, abs_url))
(qr_spoiler(conf.show_qrcode, abs_url.as_ref()))
(color_scheme_selector(conf.hide_theme_selector))
}
div.container {
Expand Down Expand Up @@ -193,7 +193,7 @@ pub fn page(
}
div.footer {
@if conf.show_wget_footer {
(wget_footer(&title_path, current_user))
(wget_footer(abs_url.as_ref(), current_user))
}
@if !conf.hide_version_footer {
(version_footer())
Expand Down Expand Up @@ -267,11 +267,11 @@ fn version_footer() -> Markup {
}
}

fn wget_footer(title_path: &str, current_user: Option<&CurrentUser>) -> Markup {
fn wget_footer(abs_path: &str, current_user: Option<&CurrentUser>) -> Markup {
let count = {
let count_slashes = title_path.matches('/').count();
if count_slashes > 0 {
count_slashes - 1
let count_slashes = abs_path.matches('/').count();
if count_slashes >= 4 {
count_slashes - 4
} else {
0
}
Expand All @@ -286,7 +286,7 @@ fn wget_footer(title_path: &str, current_user: Option<&CurrentUser>) -> Markup {
html! {
div.downloadDirectory {
p { "Download folder:" }
div.cmd { (format!("wget -r -c -nH -np --cut-dirs={count} -R \"index.html*\"{user_params} \"http://{title_path}/?raw=true\"")) }
div.cmd { (format!("wget -r -c -nH -np --cut-dirs={count} -R \"index.html*\"{user_params} \"{abs_path}?raw=true\"")) }
}
}
}
Expand Down

0 comments on commit 067edc3

Please sign in to comment.