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