From f45a8e354d1923cd5deaca85da46dce24a7102bd Mon Sep 17 00:00:00 2001 From: kirbylife Date: Tue, 20 Feb 2024 00:59:15 -0600 Subject: [PATCH] Fix 404 handler --- src/contexts.rs | 6 +++--- src/main.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/contexts.rs b/src/contexts.rs index 16e0683..caded14 100644 --- a/src/contexts.rs +++ b/src/contexts.rs @@ -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, } } } diff --git a/src/main.rs b/src/main.rs index eed923d..cf1a2e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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) }