[#1] Blog metadata can be stored using serde.

Created the initial blog data, posts and authors, and allows it to
be stored using serde.
This commit is contained in:
2025-08-22 10:46:38 -04:00
parent 35772ba1c6
commit 9dd87d0e42
10 changed files with 339 additions and 22 deletions

40
src/tale.rs Normal file
View File

@ -0,0 +1,40 @@
use serde::{Deserialize, Serialize};
/// A type alias representing the path to a Markdown file.
/// This type is used to point to the location of the content of a `Tale`.
pub type Markdown = std::path::PathBuf;
/// Represents a post or story in the application.
///
/// A `Tale` contains metadata about the post such as its title, author,
/// and tags, along with a path to its Markdown content.
#[derive(Deserialize, Serialize)]
pub struct Tale
{
/// The title of the tale.
pub title: String,
/// A URL-friendly version of the title, used for routing and linking.
pub slug: String,
/// The name of the author who wrote the tale.
pub author: String,
/// A short summary or description of the tale.
pub summary: String,
/// A list of tags associated with the tale for categorization and searching.
pub tags: Vec<String>,
/// The file path to the Markdown content of the tale.
pub content: Markdown
}
impl Tale
{
}