[#2] Refactored and added SQLX schema files.
This commit is contained in:
@ -1,24 +1,28 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use chrono::NaiveDate;
|
||||
use tavern::{Adventurer, Database, FrontMatter, Tale, Tavern};
|
||||
use tavern::{Adventurer, Database, Legend, Lore, Tale, Tavern};
|
||||
|
||||
|
||||
|
||||
#[cfg(feature = "publisher")]
|
||||
fn generate_tavern() -> Tavern
|
||||
{
|
||||
let author: Adventurer =
|
||||
Adventurer { name: String::from("Jason Smith"),
|
||||
handle: String::from("myrddin"),
|
||||
let legend: Legend = Legend
|
||||
{
|
||||
profile:
|
||||
String::from("https://cybermages.tech/about/myrddin"),
|
||||
image:
|
||||
String::from("https://cybermages.tech/about/myrddin/pic"),
|
||||
blurb: String::from("I love code!") };
|
||||
|
||||
let fm: FrontMatter =
|
||||
FrontMatter { title: String::from("Test post"),
|
||||
let author: Adventurer =
|
||||
Adventurer { name: String::from("Jason Smith"),
|
||||
handle: String::from("myrddin"),
|
||||
legend };
|
||||
|
||||
let lore: Lore =
|
||||
Lore { title: String::from("Test post"),
|
||||
slug: String::from("test_post"),
|
||||
author: author.handle.clone(),
|
||||
summary: String::from("The Moon is made of cheese!"),
|
||||
@ -30,8 +34,8 @@ fn generate_tavern() -> Tavern
|
||||
10, 41)
|
||||
.unwrap() };
|
||||
|
||||
let tale: Tale = Tale { front_matter: fm,
|
||||
content: PathBuf::from("posts/test_post.md") };
|
||||
let tale: Tale = Tale { lore,
|
||||
story: PathBuf::from("posts/test_post.md") };
|
||||
|
||||
|
||||
// Create a dummy posts directory and file for this example to work
|
||||
|
||||
Reference in New Issue
Block a user