diff --git a/src/content/collection.rs b/src/content/collection.rs index 0e9e84a..cc52a7b 100644 --- a/src/content/collection.rs +++ b/src/content/collection.rs @@ -28,9 +28,16 @@ pub struct Collection { #[derive(Debug, Serialize, ToSchema)] pub struct CollectionData { + /// Collection ID pub id: Uuid, + + /// Site ID pub slug: String, + + /// Collection URL name pub name: String, + + /// Collection parent (eg. blog categories have blog as parent) pub parent: Option, } diff --git a/src/content/post.rs b/src/content/post.rs index 64ea236..da8de35 100644 --- a/src/content/post.rs +++ b/src/content/post.rs @@ -9,6 +9,7 @@ use crate::cursor::{AsCursor, CursorList}; use super::Error; +/// Post as stored in repository #[derive(Deserialize, Serialize, FromRow)] pub struct Post { /// Post ID @@ -47,9 +48,11 @@ pub struct Post { pub deleted_at: Option, } +/// A single block in a post #[derive(Deserialize, Serialize, Debug, ToSchema)] #[serde(tag = "kind")] pub enum PostBlock { + /// Markdown-formatted text MarkupV1 { /// Markup format (markdown, html, plain) format: String, @@ -57,6 +60,7 @@ pub enum PostBlock { /// Markup content (before rendering) content: String, }, + /// Image gallery GalleryV1 { /// Images in the gallery images: Vec,