From 39fde5225dbcc4ac4188eaafd5c34b4a392a48dd Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 26 Apr 2023 10:41:49 +0200 Subject: [PATCH] post now available on /p --- src/routes/blog.rs | 4 ++-- templates/blog/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/blog.rs b/src/routes/blog.rs index 95a7d8c..1d5279e 100644 --- a/src/routes/blog.rs +++ b/src/routes/blog.rs @@ -118,12 +118,12 @@ struct BlogPostTemplate { post: Option, } -#[get("/blog/{id}")] +#[get("/blog/p/{id}")] pub async fn page(path: web::Path<(String,)>, config: web::Data) -> impl Responder { HttpResponse::Ok().body(build_post(path.into_inner().0, config.get_ref().to_owned())) } -pub fn build_post(file: String, config: Config) -> String { +fn build_post(file: String, config: Config) -> String { let mut post = None; let infos = get_post(&mut post, file); diff --git a/templates/blog/index.html b/templates/blog/index.html index 5dafa65..f246164 100644 --- a/templates/blog/index.html +++ b/templates/blog/index.html @@ -14,7 +14,7 @@
    {{#posts}} -
  • +
  • {{>blog/date.html}}

    {{title}}