Update to the latest pending version of gemtext
This commit is contained in:
parent
1c1e2567f5
commit
367cc17e8f
|
@ -22,7 +22,7 @@ async fn main() -> Result<()> {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.link("https://github.com/Alch-Emi/kochab", Some("GitHub"))
|
.link("https://github.com/Alch-Emi/kochab", Some("GitLab".to_string()))
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.heading(2, "Usage")
|
.heading(2, "Usage")
|
||||||
.blank_line()
|
.blank_line()
|
||||||
|
|
|
@ -30,8 +30,8 @@ async fn handle_request(request: Request) -> Result<Response> {
|
||||||
|
|
||||||
document = document
|
document = document
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.link("/limit", Some("Go to rate limited page"))
|
.link("/limit", Some("Go to rate limited page".to_string()))
|
||||||
.link("/", Some("Go to a page that's not rate limited"));
|
.link("/", Some("Go to a page that's not rate limited".to_string()));
|
||||||
|
|
||||||
Ok(document.into())
|
Ok(document.into())
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,8 @@ async fn handle_main(_req: Request, user: RegisteredUser<String>) -> Result<Resp
|
||||||
.text("Your personal secret string:")
|
.text("Your personal secret string:")
|
||||||
.text(user.as_ref())
|
.text(user.as_ref())
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.link("/update", Some("Change your string"))
|
.link("/update", Some("Change your string".to_string()))
|
||||||
.link("/account", Some("Update your account"))
|
.link("/account", Some("Update your account".to_string()))
|
||||||
.into();
|
.into();
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ async fn handle_update(_request: Request, mut user: RegisteredUser<String>, inpu
|
||||||
let response = Gemtext::new()
|
let response = Gemtext::new()
|
||||||
.text("String updated!")
|
.text("String updated!")
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.link("/", Some("Back"))
|
.link("/", Some("Back".to_string()))
|
||||||
.into();
|
.into();
|
||||||
Ok(response)
|
Ok(response)
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ impl From<Vec<gemtext::Node>> for Body {
|
||||||
#[cfg(feature = "gemtext")]
|
#[cfg(feature = "gemtext")]
|
||||||
impl From<Gemtext> for Body {
|
impl From<Gemtext> for Body {
|
||||||
fn from(document: Gemtext) -> Self {
|
fn from(document: Gemtext) -> Self {
|
||||||
document.build().into()
|
document.normalize().build().into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ fn render_settings_menu<UserData: Serialize + DeserializeOwned>(
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.text(&format!("Welcome {}!", user.username()))
|
.text(&format!("Welcome {}!", user.username()))
|
||||||
.blank_line()
|
.blank_line()
|
||||||
.link(get_redirect(&user).as_str(), Some("Back to the app"))
|
.link(get_redirect(&user).as_str(), Some("Back to the app".to_string()))
|
||||||
.blank_line();
|
.blank_line();
|
||||||
|
|
||||||
#[cfg(feature = "user_management_advanced")] {
|
#[cfg(feature = "user_management_advanced")] {
|
||||||
|
@ -387,6 +387,7 @@ fn render_settings_menu<UserData: Serialize + DeserializeOwned>(
|
||||||
} else {
|
} else {
|
||||||
"Set password"
|
"Set password"
|
||||||
}
|
}
|
||||||
|
.to_string()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ async fn serve_dir_listing<P: AsRef<Path>, B: AsRef<Path>>(path: P, virtual_path
|
||||||
.blank_line();
|
.blank_line();
|
||||||
|
|
||||||
if virtual_path.get(0).map(<_>::as_ref) != Some(Path::new("")) {
|
if virtual_path.get(0).map(<_>::as_ref) != Some(Path::new("")) {
|
||||||
document = document.link("..", Some("📁 ../"));
|
document = document.link("..", Some("📁 ../".to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
while let Some(entry) = dir.next_entry().await.expect("Failed to list directory") {
|
while let Some(entry) = dir.next_entry().await.expect("Failed to list directory") {
|
||||||
|
|
Loading…
Reference in New Issue