Update to the latest pending version of gemtext

This commit is contained in:
Emi Tatsuo 2020-12-08 11:13:33 -05:00
parent 1c1e2567f5
commit 367cc17e8f
Signed by: Emi
GPG key ID: 68FAB2E2E6DFC98B
6 changed files with 10 additions and 9 deletions

View file

@ -22,7 +22,7 @@ async fn main() -> Result<()> {
)
)
.blank_line()
.link("https://github.com/Alch-Emi/kochab", Some("GitHub"))
.link("https://github.com/Alch-Emi/kochab", Some("GitLab".to_string()))
.blank_line()
.heading(2, "Usage")
.blank_line()

View file

@ -30,8 +30,8 @@ async fn handle_request(request: Request) -> Result<Response> {
document = document
.blank_line()
.link("/limit", Some("Go to rate limited page"))
.link("/", Some("Go to a page that's not rate limited"));
.link("/limit", Some("Go to rate limited page".to_string()))
.link("/", Some("Go to a page that's not rate limited".to_string()));
Ok(document.into())
}

View file

@ -54,8 +54,8 @@ async fn handle_main(_req: Request, user: RegisteredUser<String>) -> Result<Resp
.text("Your personal secret string:")
.text(user.as_ref())
.blank_line()
.link("/update", Some("Change your string"))
.link("/account", Some("Update your account"))
.link("/update", Some("Change your string".to_string()))
.link("/account", Some("Update your account".to_string()))
.into();
Ok(response)
}
@ -75,7 +75,7 @@ async fn handle_update(_request: Request, mut user: RegisteredUser<String>, inpu
let response = Gemtext::new()
.text("String updated!")
.blank_line()
.link("/", Some("Back"))
.link("/", Some("Back".to_string()))
.into();
Ok(response)

View file

@ -83,7 +83,7 @@ impl From<Vec<gemtext::Node>> for Body {
#[cfg(feature = "gemtext")]
impl From<Gemtext> for Body {
fn from(document: Gemtext) -> Self {
document.build().into()
document.normalize().build().into()
}
}

View file

@ -358,7 +358,7 @@ fn render_settings_menu<UserData: Serialize + DeserializeOwned>(
.blank_line()
.text(&format!("Welcome {}!", user.username()))
.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();
#[cfg(feature = "user_management_advanced")] {
@ -387,6 +387,7 @@ fn render_settings_menu<UserData: Serialize + DeserializeOwned>(
} else {
"Set password"
}
.to_string()
)
);
}

View file

@ -106,7 +106,7 @@ async fn serve_dir_listing<P: AsRef<Path>, B: AsRef<Path>>(path: P, virtual_path
.blank_line();
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") {