From b56c8359f17fd5464dd3ebdbe23fcbe35f0e49ad Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 1 Jun 2025 19:59:08 -0400 Subject: fix: amy proofreads --- src/handlers.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index 8b3ea27..aa36e15 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -11,7 +11,7 @@ use crate::views::posts::PostsView; use crate::views::pro::ProTemplate; use askama::Template; use axum::extract::{Path, State}; -use axum::response::Html; +use axum::response::{Html, Redirect}; use std::sync::Arc; pub async fn about_handler(State(repo): State>) -> Html { @@ -44,6 +44,10 @@ pub async fn post_handler( Html(view.render().unwrap()) } +pub async fn post_redirect(Path(post_id): Path) -> Redirect { + Redirect::permanent(&format!("/blog/{post_id}")) +} + pub async fn k12_handler() -> Html { Html(K12Template {}.render().unwrap()) } -- cgit v1.2.3