seperated url and title + escape

This commit is contained in:
2026-05-09 09:59:27 +02:00
parent e6cfd61307
commit 4ff9579cff
10 changed files with 78 additions and 17 deletions
+4
View File
@@ -193,6 +193,7 @@ pub async fn create_post(
let meta = PostMeta {
date: payload.date.unwrap_or_else(|| Utc::now().date_naive()),
title: payload.title.map(|t| t.trim().to_string()).filter(|t| !t.is_empty()),
summary: payload.summary.filter(|s| !s.trim().is_empty()),
tags: payload.tags,
draft: payload.draft,
@@ -204,6 +205,7 @@ pub async fn create_post(
Ok(Json(PostDetail {
slug,
date: meta.date,
title: meta.title,
summary: meta.summary,
tags: meta.tags,
draft: meta.draft,
@@ -272,6 +274,7 @@ pub async fn list_posts(
posts.push(PostInfo {
slug: slug.to_string(),
date: meta.date,
title: meta.title.clone(),
summary: meta.summary.clone(),
tags: meta.tags.clone(),
draft: meta.draft,
@@ -305,6 +308,7 @@ pub async fn get_post(
Ok(Json(PostDetail {
slug,
date: meta.date,
title: meta.title,
summary: meta.summary,
tags: meta.tags,
draft: meta.draft,