[#3] Split the tavern project into a workspace.

**tavern** - The blogging system library.
**loremaster** - Creates the database from a blogging repository.
**bard** - Dioxus components to display the blog.
This commit is contained in:
2025-08-29 20:43:36 -04:00
parent 7b5c69cc50
commit 3c6e82dfaf
40 changed files with 2766 additions and 33 deletions

56
tavern/src/tale.rs Normal file
View File

@ -0,0 +1,56 @@
use chrono::NaiveDateTime;
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`.
#[cfg(feature = "publisher")]
pub type Markdown = std::path::PathBuf;
/// A type alias representing the HTML content of the tale.
#[cfg(not(feature = "publisher"))]
pub type Markdown = String;
/// Metadata describing a tale.
///
/// This includes details such as the title, author, summary, and
/// associated tags.
#[derive(Deserialize, Serialize)]
pub struct Lore
{
/// 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 Date and Time that must elapse before this tale can be told.
pub publish_date: NaiveDateTime
}
/// Represents a post or story in the application.
#[derive(Deserialize, Serialize)]
pub struct Tale
{
/// Metadata of the post.
#[serde(flatten)]
pub lore: Lore,
/// The file path to the Markdown content of the tale.
pub story: Markdown
}