Adjusting to make the database better tested.
This commit is contained in:
@ -1,17 +1,15 @@
|
||||
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;
|
||||
#[derive(Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub enum Story
|
||||
{
|
||||
File(std::path::PathBuf),
|
||||
Html(String)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,7 +17,7 @@ pub type Markdown = String;
|
||||
///
|
||||
/// This includes details such as the title, author, summary, and
|
||||
/// associated tags.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct Lore
|
||||
{
|
||||
/// The title of the tale.
|
||||
@ -44,13 +42,14 @@ pub struct Lore
|
||||
|
||||
|
||||
/// Represents a post or story in the application.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Clone, PartialEq, 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
|
||||
/// The story content for this tale..
|
||||
#[serde(flatten)]
|
||||
pub story: Story
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user