Compare commits
No commits in common. "f793227b82f84ec0938fdd7463767157e121dab7" and "dedaed2281c626edb73035b135333a4f54a76011" have entirely different histories.
f793227b82
...
dedaed2281
|
@ -7,6 +7,3 @@ Cargo.lock
|
||||||
|
|
||||||
# Geany proyect config
|
# Geany proyect config
|
||||||
proyectos
|
proyectos
|
||||||
|
|
||||||
# Rocket Config
|
|
||||||
Rocket.toml
|
|
|
@ -53,14 +53,14 @@ impl SinglePost {
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct NotFound {
|
pub struct NotFound {
|
||||||
title: String,
|
title: String,
|
||||||
url: String,
|
uri: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NotFound {
|
impl NotFound {
|
||||||
pub fn new(url: String) -> Self {
|
pub fn new(uri: String) -> Self {
|
||||||
NotFound {
|
NotFound {
|
||||||
title: gen_title(),
|
title: gen_title(),
|
||||||
url,
|
uri,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,9 @@ fn show_post(title: String) -> Template {
|
||||||
Template::render("post", context)
|
Template::render("post", context)
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
let url = format!("/post/{}", title_splited.join("-"));
|
let uri = format!("/post/{}", title_splited.join("-"));
|
||||||
|
|
||||||
let context = contexts::NotFound::new(url);
|
let context = contexts::NotFound::new(uri);
|
||||||
|
|
||||||
Template::render("404", context)
|
Template::render("404", context)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue