Compare commits
19 Commits
ce80af94ee
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 53e62fcb68 | |||
| 04c2182705 | |||
| f023f36558 | |||
| 62a2c4f5bc | |||
| 87bb1459b8 | |||
| 8dd20cb0cb | |||
| 55f1ac22b0 | |||
| c3ae332b0b | |||
| dede2e9072 | |||
| 4c03aea947 | |||
| ee82498161 | |||
| d822ecdf84 | |||
| e8a4c19fdb | |||
| 1a57f3d143 | |||
| 1a82e856d9 | |||
| e49ecbac4d | |||
| bca3e9f939 | |||
| 3fe3d874ca | |||
| 725824003b |
41
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: Build Tavernworks
|
||||||
|
run-name: Building on Silverymoon by ${{ gitea.actor }}.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: FreeBSD-14.1
|
||||||
|
env:
|
||||||
|
SOURCE_DIR: tavernworks
|
||||||
|
TARGET_DIR: /home/gitea/bin
|
||||||
|
steps:
|
||||||
|
- name: Setup Workspace
|
||||||
|
run: |
|
||||||
|
rm -rf ${{ github.workspace }}/*
|
||||||
|
echo "Source Dir: $SOURCE_DIR"
|
||||||
|
- name: Clone Repo
|
||||||
|
uses: https://gitea.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: CyberMages/tavernworks
|
||||||
|
token: ${{ secrets.CM_GIT_TOKEN }}
|
||||||
|
path: ${{ env.SOURCE_DIR }}
|
||||||
|
- name: Build Repo
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
ls -la
|
||||||
|
cd "$SOURCE_DIR"
|
||||||
|
echo "Current Shell: $SHELL"
|
||||||
|
echo "PATH=$PATH"
|
||||||
|
. ~/.profile
|
||||||
|
echo "PATH=$PATH"
|
||||||
|
echo "Building release."
|
||||||
|
cargo build --release
|
||||||
|
echo "Installing loreweaver."
|
||||||
|
cp ./target/release/loreweaver "$TARGET_DIR"
|
||||||
|
- name: Clean Workspace
|
||||||
|
run: |
|
||||||
|
rm -rf ${{ github.workspace }}/*
|
||||||
|
ls -la
|
||||||
1854
Cargo.lock
generated
BIN
assets/images/tavernworks_card.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
assets/images/tavernworks_logo.png
Normal file
|
After Width: | Height: | Size: 442 KiB |
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bard"
|
name = "bard"
|
||||||
version = "0.3.5"
|
version = "0.3.17"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Dioxus components that will display a Tavern blogging system Blog."
|
description = "Dioxus components that will display a Tavern blogging system Blog."
|
||||||
repository = "/CyberMages/tavern"
|
repository = "/CyberMages/tavern"
|
||||||
@ -14,12 +14,12 @@ name = "blog"
|
|||||||
path = "examples/blog.rs"
|
path = "examples/blog.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dioxus = { version = "*", features = ["router", "fullstack"] }
|
dioxus = { version = "=0.7.0-rc.1", features = ["router", "fullstack"] }
|
||||||
tavern = { version = "0.3.0", path = "../tavern", registry="cybermages", optional = true}
|
tavern = { version = "0.3.0", path = "../tavern", registry="cybermages", optional = true}
|
||||||
tokio = { version = "1.0", features = ["rt", "macros"], optional = true }
|
tokio = { version = "1.0", features = ["rt", "macros"], optional = true }
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["web"]
|
default = ["tavern"]
|
||||||
web = ["tavern", "dioxus/web"]
|
web = ["tavern", "dioxus/web"]
|
||||||
server = ["tavern/database", "dioxus/server", "tokio"]
|
server = ["tavern/database", "dioxus/server", "tokio"]
|
||||||
|
|||||||
@ -35,6 +35,9 @@
|
|||||||
|
|
||||||
.blog_list
|
.blog_list
|
||||||
{
|
{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
order: 5;
|
order: 5;
|
||||||
|
|
||||||
.blog_title
|
.blog_title
|
||||||
@ -43,6 +46,13 @@
|
|||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blog_title_image
|
||||||
|
{
|
||||||
|
width: 23rem;
|
||||||
|
align-self: center;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
.blog_item
|
.blog_item
|
||||||
{
|
{
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
@ -51,6 +61,16 @@
|
|||||||
{
|
{
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
|
|
||||||
|
a:link, a:visited
|
||||||
|
{
|
||||||
|
color: var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
{
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p
|
p
|
||||||
@ -97,7 +117,7 @@
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.embeded_video
|
.embedded_video
|
||||||
{
|
{
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -140,7 +160,7 @@
|
|||||||
order: 1;
|
order: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 70px;
|
margin-top: 185px;
|
||||||
margin-right: 70px;
|
margin-right: 70px;
|
||||||
position:sticky;
|
position:sticky;
|
||||||
top: 150px;
|
top: 150px;
|
||||||
@ -239,3 +259,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.video_link
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 1000px)
|
||||||
|
{
|
||||||
|
.blog_post .blog_post_tale
|
||||||
|
{
|
||||||
|
.video_link
|
||||||
|
{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.embedded_video
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
BIN
bard/assets/images/bard_logo.png
Normal file
|
After Width: | Height: | Size: 220 KiB |
@ -80,13 +80,13 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
// Retrieve the provided settings from context.
|
// Retrieve the provided settings from context.
|
||||||
let settings = use_context::<BardSettings>();
|
let settings = use_context::<BardSettings>();
|
||||||
|
|
||||||
let list = use_server_future(move ||
|
let list = use_resource(move ||
|
||||||
{
|
{
|
||||||
let t = tags();
|
let tags = tags();
|
||||||
let categories = t.iter().cloned().collect();
|
let categories: Vec<String> = tags.iter().cloned().collect();
|
||||||
|
|
||||||
async move { get_blog_list(categories).await }
|
async move { get_blog_list(categories).await }
|
||||||
})?;
|
});
|
||||||
|
|
||||||
rsx!
|
rsx!
|
||||||
{
|
{
|
||||||
@ -94,6 +94,34 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
{
|
{
|
||||||
class: "blog_list",
|
class: "blog_list",
|
||||||
|
|
||||||
|
match settings.blog_image
|
||||||
|
{
|
||||||
|
Some(image) =>
|
||||||
|
{
|
||||||
|
match settings.blog_name
|
||||||
|
{
|
||||||
|
Some(title) =>
|
||||||
|
{
|
||||||
|
rsx!
|
||||||
|
{
|
||||||
|
h1 { class: "blog_title visually_hidden", "{title}" }
|
||||||
|
img { class: "blog_title_image", alt: "{title} blog logo", src: image }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
None =>
|
||||||
|
{
|
||||||
|
rsx!
|
||||||
|
{
|
||||||
|
h1 { class: "blog_title visually_hidden", "Blog" }
|
||||||
|
img { class: "blog_title_image", alt: "Blog logo", src: image }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
None =>
|
||||||
|
{
|
||||||
match settings.blog_name
|
match settings.blog_name
|
||||||
{
|
{
|
||||||
Some(title) =>
|
Some(title) =>
|
||||||
@ -103,6 +131,7 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
h1 { class: "blog_title", "{title}" }
|
h1 { class: "blog_title", "{title}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
None =>
|
None =>
|
||||||
{
|
{
|
||||||
rsx!
|
rsx!
|
||||||
@ -111,6 +140,8 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(Ok(lores)) = &*list.read()
|
if let Some(Ok(lores)) = &*list.read()
|
||||||
{
|
{
|
||||||
@ -118,6 +149,7 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
{
|
{
|
||||||
BlogItem
|
BlogItem
|
||||||
{
|
{
|
||||||
|
key: "{lore.slug}",
|
||||||
title: lore.title.clone(),
|
title: lore.title.clone(),
|
||||||
slug: lore.slug.clone(),
|
slug: lore.slug.clone(),
|
||||||
author: lore.author.clone(),
|
author: lore.author.clone(),
|
||||||
@ -144,6 +176,7 @@ pub fn BlogList(tags: Signal<HashSet<String>>, children: Element) -> Element
|
|||||||
#[component]
|
#[component]
|
||||||
pub fn ToggleTag(tag: String, toggled_tags: Signal<HashSet<String>>) -> Element
|
pub fn ToggleTag(tag: String, toggled_tags: Signal<HashSet<String>>) -> Element
|
||||||
{
|
{
|
||||||
|
let is_checked = toggled_tags.read().is_toggled(&tag);
|
||||||
rsx!
|
rsx!
|
||||||
{
|
{
|
||||||
label
|
label
|
||||||
@ -153,7 +186,7 @@ pub fn ToggleTag(tag: String, toggled_tags: Signal<HashSet<String>>) -> Element
|
|||||||
input
|
input
|
||||||
{
|
{
|
||||||
r#type: "checkbox",
|
r#type: "checkbox",
|
||||||
checked: toggled_tags.read().is_toggled(&tag),
|
checked: is_checked,
|
||||||
onchange: move |_|
|
onchange: move |_|
|
||||||
{
|
{
|
||||||
toggled_tags.write().toggle(&tag.clone());
|
toggled_tags.write().toggle(&tag.clone());
|
||||||
@ -182,7 +215,7 @@ pub fn ToggleTag(tag: String, toggled_tags: Signal<HashSet<String>>) -> Element
|
|||||||
// which tags should be selected based on the current URL, returning both pieces
|
// which tags should be selected based on the current URL, returning both pieces
|
||||||
// of data together for clean state management.
|
// of data together for clean state management.
|
||||||
#[component]
|
#[component]
|
||||||
pub fn TagSelector(url_tag: ReadOnlySignal<String>,
|
pub fn TagSelector(url_tag: ReadSignal<String>,
|
||||||
toggled_tags: Signal<HashSet<String>>) -> Element
|
toggled_tags: Signal<HashSet<String>>) -> Element
|
||||||
{
|
{
|
||||||
// Use use_resource to handle both fetching tags AND initializing selection
|
// Use use_resource to handle both fetching tags AND initializing selection
|
||||||
|
|||||||
@ -23,8 +23,12 @@ pub fn BlogAuthor() -> Element
|
|||||||
|
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn PostHeaderAuthor(adventurer: Adventurer) -> Element
|
pub fn PostHeaderAuthor(author: Option<Adventurer>, publish_date: String) -> Element
|
||||||
{
|
{
|
||||||
|
match author
|
||||||
|
{
|
||||||
|
Some(adventurer) =>
|
||||||
|
{
|
||||||
rsx!
|
rsx!
|
||||||
{
|
{
|
||||||
document::Meta
|
document::Meta
|
||||||
@ -33,6 +37,11 @@ pub fn PostHeaderAuthor(adventurer: Adventurer) -> Element
|
|||||||
content: "{adventurer.name}"
|
content: "{adventurer.name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i
|
||||||
|
{
|
||||||
|
"Published: {publish_date}"
|
||||||
|
}
|
||||||
|
|
||||||
p
|
p
|
||||||
{
|
{
|
||||||
b
|
b
|
||||||
@ -42,10 +51,37 @@ pub fn PostHeaderAuthor(adventurer: Adventurer) -> Element
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
None=>
|
||||||
|
{
|
||||||
|
rsx!
|
||||||
|
{
|
||||||
|
document::Meta
|
||||||
|
{
|
||||||
|
name: "author",
|
||||||
|
content: "Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
i
|
||||||
|
{
|
||||||
|
"Published: {publish_date}"
|
||||||
|
}
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
b
|
||||||
|
{
|
||||||
|
"Author: Unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn PostHeader(tale: Tale) -> Element
|
pub fn PostHeader(tale: Tale, adventurer: Option<Adventurer>) -> Element
|
||||||
{
|
{
|
||||||
// Get the pages URL.
|
// Get the pages URL.
|
||||||
let url: Page = use_route();
|
let url: Page = use_route();
|
||||||
@ -53,27 +89,20 @@ pub fn PostHeader(tale: Tale) -> Element
|
|||||||
// Get the blog's image to use as a placeholder if there isn't one for the
|
// Get the blog's image to use as a placeholder if there isn't one for the
|
||||||
// blog post.
|
// blog post.
|
||||||
// Retrieve the provided settings from context.
|
// Retrieve the provided settings from context.
|
||||||
let _settings = use_context::<BardSettings>();
|
let settings = use_context::<BardSettings>();
|
||||||
|
|
||||||
let author_future = use_server_future(move ||
|
|
||||||
{
|
|
||||||
let handle: String = tale.lore.author.clone();
|
|
||||||
|
|
||||||
async move { get_author(handle).await }
|
|
||||||
})?;
|
|
||||||
|
|
||||||
rsx!
|
rsx!
|
||||||
{
|
{
|
||||||
// Adding for SEO and OpenGraph post sharing.
|
|
||||||
document::Meta { name: "title", content: "{tale.lore.title}" }
|
|
||||||
document::Meta { name: "description", content: "{tale.lore.summary}" }
|
|
||||||
|
|
||||||
// Open Graph (used by LinkedIn, Bluesky, Discord, etc.)
|
// Open Graph (used by LinkedIn, Bluesky, Discord, etc.)
|
||||||
|
document::Meta { property: "og:locale", content: "en_US" }
|
||||||
|
document::Meta { name: "title", property: "og:title", content: "{tale.lore.title}" }
|
||||||
|
document::Meta { name: "description", property: "og:description", content: "{tale.lore.summary}" }
|
||||||
document::Meta { property: "og:type", content: "article" }
|
document::Meta { property: "og:type", content: "article" }
|
||||||
document::Meta { property: "og:title", content: "{tale.lore.title}" }
|
|
||||||
document::Meta { property: "og:description", content: "{tale.lore.summary}" }
|
|
||||||
document::Meta { property: "og:url", content: "{url}" }
|
document::Meta { property: "og:url", content: "{url}" }
|
||||||
document::Meta { property: "og:image", content: "" }
|
if let Some(image) = settings.default_post_image
|
||||||
|
{
|
||||||
|
document::Meta { name: "image", property: "og:image", content: "{image}" }
|
||||||
|
}
|
||||||
|
|
||||||
h1 { {tale.lore.title} }
|
h1 { {tale.lore.title} }
|
||||||
|
|
||||||
@ -88,13 +117,10 @@ pub fn PostHeader(tale: Tale) -> Element
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(Ok(Some(adventurer))) = (author_future.value())()
|
PostHeaderAuthor
|
||||||
{
|
{
|
||||||
PostHeaderAuthor { adventurer: adventurer }
|
author: adventurer,
|
||||||
}
|
publish_date: tale.lore.publish_date.format("%m/%d/%Y").to_string()
|
||||||
else
|
|
||||||
{
|
|
||||||
p { "Loading author..." }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,7 +148,12 @@ pub fn BlogPost(slug: Signal<String>, children: Element) -> Element
|
|||||||
// Make this reactive so that as the page changes it should rerun this.
|
// Make this reactive so that as the page changes it should rerun this.
|
||||||
let url_slug = slug();
|
let url_slug = slug();
|
||||||
|
|
||||||
async move { get_blog_post(url_slug).await }
|
async move
|
||||||
|
{
|
||||||
|
let post = get_blog_post(url_slug).await?;
|
||||||
|
let author = get_author(post.lore.author.clone()).await?;
|
||||||
|
Ok::<_, ServerFnError>((post, author))
|
||||||
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
rsx!
|
rsx!
|
||||||
@ -131,11 +162,12 @@ pub fn BlogPost(slug: Signal<String>, children: Element) -> Element
|
|||||||
{
|
{
|
||||||
class: "blog_post",
|
class: "blog_post",
|
||||||
|
|
||||||
if let Some(Ok(tale)) = (post_future.value())()
|
if let Some(Ok((tale, adventurer))) = (post_future.value())()
|
||||||
{
|
{
|
||||||
PostHeader
|
PostHeader
|
||||||
{
|
{
|
||||||
tale: tale.clone()
|
tale: tale.clone(),
|
||||||
|
adventurer: adventurer.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
Story { text: tale.story }
|
Story { text: tale.story }
|
||||||
|
|||||||
@ -8,7 +8,7 @@ use crate::components::{BlogList, TagSelector};
|
|||||||
|
|
||||||
/// Blog page
|
/// Blog page
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Blog(tag: ReadOnlySignal<String>) -> Element
|
pub fn Blog(tag: ReadSignal<String>) -> Element
|
||||||
{
|
{
|
||||||
let categories: Signal<HashSet<String>> =
|
let categories: Signal<HashSet<String>> =
|
||||||
use_signal(|| HashSet::new());
|
use_signal(|| HashSet::new());
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use crate::components::{BlogPost, TagNav};
|
|||||||
|
|
||||||
/// Blog page
|
/// Blog page
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Post(slug: ReadOnlySignal<String>) -> Element
|
pub fn Post(slug: ReadSignal<String>) -> Element
|
||||||
{
|
{
|
||||||
// Create a copy of the current slug to detect changes.
|
// Create a copy of the current slug to detect changes.
|
||||||
let url_slug = use_signal(|| slug());
|
let url_slug = use_signal(|| slug());
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum StylesheetBehavior
|
pub enum StylesheetBehavior
|
||||||
{
|
{
|
||||||
@ -23,6 +24,13 @@ pub struct BardSettings
|
|||||||
/// it is still available for screen readers.
|
/// it is still available for screen readers.
|
||||||
pub blog_name: Option<String>,
|
pub blog_name: Option<String>,
|
||||||
|
|
||||||
|
/// The image to use for the blog title instead of just the name.
|
||||||
|
pub blog_image: Option<Asset>,
|
||||||
|
|
||||||
|
/// The image to use for the default post image in open graph. This is what
|
||||||
|
/// is shown when sharing the article.
|
||||||
|
pub default_post_image: Option<Asset>,
|
||||||
|
|
||||||
/// A user defined stylesheet and how the library should include it.
|
/// A user defined stylesheet and how the library should include it.
|
||||||
pub stylesheet: StylesheetBehavior
|
pub stylesheet: StylesheetBehavior
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,22 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "blog_test"
|
name = "blog_test"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
authors = ["Myrddin Dundragon <myrddin@cybermages.tech>"]
|
authors = ["Myrddin Dundragon <myrddin@cybermages.tech>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
axum = { version = "0.7.0", optional = true }
|
axum = { version = "0.8.4", optional = true }
|
||||||
axum-server = { version = "0.7.1", optional = true }
|
axum-server = { version = "0.7.2", optional = true }
|
||||||
dioxus = { version = "*", features = ["router", "fullstack"] }
|
dioxus = { version = "=0.7.0-rc.1", features = ["router", "fullstack"] }
|
||||||
dioxus-cli-config = { version = "*", optional = true }
|
|
||||||
bard = { version = "*", path="../bard", optional = true }
|
bard = { version = "*", path="../bard", optional = true }
|
||||||
tokio = { version = "1.0", optional = true }
|
tokio = { version = "1.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["web"]
|
default = ["bard"]
|
||||||
web = ["dioxus/web", "bard"]
|
web = ["dioxus/web", "bard/web"]
|
||||||
server = ["dioxus/server", "axum", "axum-server", "tokio/rt-multi-thread", "tokio/macros", "dioxus-cli-config", "bard/server"]
|
server = ["dioxus/server", "axum", "axum-server", "tokio/rt-multi-thread", "tokio/macros", "bard/server"]
|
||||||
|
|
||||||
[profile.wasm-dev]
|
[profile.wasm-dev]
|
||||||
inherits = "dev"
|
inherits = "dev"
|
||||||
|
|||||||
BIN
blog_test/assets/runes_and_ramblings_logo.png
Normal file
|
After Width: | Height: | Size: 1019 KiB |
BIN
blog_test/assets/runes_and_ramblings_text.png
Normal file
|
After Width: | Height: | Size: 335 KiB |
@ -6,6 +6,10 @@ use bard::*;
|
|||||||
|
|
||||||
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
||||||
const BLOG: Asset = asset!("/assets/blog.css");
|
const BLOG: Asset = asset!("/assets/blog.css");
|
||||||
|
const BLOG_IMAGE: Asset = asset!("/assets/runes_and_ramblings_text.png",
|
||||||
|
AssetOptions::builder().with_hash_suffix(false));
|
||||||
|
const POST_IMAGE: Asset = asset!("/assets/runes_and_ramblings_logo.png",
|
||||||
|
AssetOptions::builder().with_hash_suffix(false));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -13,13 +17,16 @@ fn main()
|
|||||||
{
|
{
|
||||||
#[cfg(feature = "server")]
|
#[cfg(feature = "server")]
|
||||||
{
|
{
|
||||||
let _ = tokio::runtime::Runtime::new()
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
.unwrap()
|
rt.block_on(async
|
||||||
.block_on(async move { bard::init_database("/home/myrddin/cybermages/website/tavern.db").await });
|
{
|
||||||
|
let db_path = "/home/myrddin/cybermages/website/tavern.db";
|
||||||
|
|
||||||
|
let _ = bard::init_database(db_path).await;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "web")]
|
LaunchBuilder::new().launch(App);
|
||||||
dioxus::launch(App);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@ -28,6 +35,8 @@ fn App() -> Element
|
|||||||
let custom_settings = BardSettings
|
let custom_settings = BardSettings
|
||||||
{
|
{
|
||||||
blog_name: Some(String::from("Blog Test")),
|
blog_name: Some(String::from("Blog Test")),
|
||||||
|
blog_image: Some(BLOG_IMAGE),
|
||||||
|
default_post_image: Some(POST_IMAGE),
|
||||||
stylesheet: StylesheetBehavior::Extend(BLOG),
|
stylesheet: StylesheetBehavior::Extend(BLOG),
|
||||||
};
|
};
|
||||||
provide_context(custom_settings);
|
provide_context(custom_settings);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "loreweaver"
|
name = "loreweaver"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Converts a blog repository into an SQLite database using the Tavern blog system."
|
description = "Converts a blog repository into an SQLite database using the Tavern blog system."
|
||||||
repository = "/CyberMages/tavern"
|
repository = "/CyberMages/tavern"
|
||||||
|
|||||||
BIN
loreweaver/assets/images/loreweaver_logo.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
2
rust-toolchain.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "nightly"
|
||||||
BIN
tavern/assets/images/tavern_logo.png
Normal file
|
After Width: | Height: | Size: 249 KiB |