Compare commits
17 Commits
3fe3d874ca
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 53e62fcb68 | |||
| 04c2182705 | |||
| f023f36558 | |||
| 62a2c4f5bc | |||
| 87bb1459b8 | |||
| 8dd20cb0cb | |||
| 55f1ac22b0 | |||
| c3ae332b0b | |||
| dede2e9072 | |||
| 4c03aea947 | |||
| ee82498161 | |||
| d822ecdf84 | |||
| e8a4c19fdb | |||
| 1a57f3d143 | |||
| 1a82e856d9 | |||
| e49ecbac4d | |||
| bca3e9f939 |
41
.gitea/workflows/build.yaml
Normal file
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
|
||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -297,7 +297,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bard"
|
name = "bard"
|
||||||
version = "0.3.7"
|
version = "0.3.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dioxus",
|
"dioxus",
|
||||||
"tavern",
|
"tavern",
|
||||||
|
|||||||
BIN
assets/images/tavernworks_card.png
Normal file
BIN
assets/images/tavernworks_card.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 246 KiB |
BIN
assets/images/tavernworks_logo.png
Normal file
BIN
assets/images/tavernworks_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 442 KiB |
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bard"
|
name = "bard"
|
||||||
version = "0.3.8"
|
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"
|
||||||
|
|||||||
@ -117,7 +117,7 @@
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.embeded_video
|
.embedded_video
|
||||||
{
|
{
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -259,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
BIN
bard/assets/images/bard_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 220 KiB |
@ -15,12 +15,12 @@ pub fn BlogItem(title: String, slug: String, author: String, summary: String,
|
|||||||
tags: Vec<String>)
|
tags: Vec<String>)
|
||||||
-> Element
|
-> Element
|
||||||
{
|
{
|
||||||
let author_future = use_resource(move ||
|
let author_future = use_server_future(move ||
|
||||||
{
|
{
|
||||||
let handle: String = author.clone();
|
let handle: String = author.clone();
|
||||||
|
|
||||||
async move { get_author(handle).await }
|
async move { get_author(handle).await }
|
||||||
});
|
})?;
|
||||||
|
|
||||||
rsx!
|
rsx!
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,29 +23,65 @@ pub fn BlogAuthor() -> Element
|
|||||||
|
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn PostHeaderAuthor(adventurer: Adventurer) -> Element
|
pub fn PostHeaderAuthor(author: Option<Adventurer>, publish_date: String) -> Element
|
||||||
{
|
{
|
||||||
rsx!
|
match author
|
||||||
{
|
{
|
||||||
document::Meta
|
Some(adventurer) =>
|
||||||
{
|
{
|
||||||
name: "author",
|
rsx!
|
||||||
content: "{adventurer.name}"
|
{
|
||||||
|
document::Meta
|
||||||
|
{
|
||||||
|
name: "author",
|
||||||
|
content: "{adventurer.name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
i
|
||||||
|
{
|
||||||
|
"Published: {publish_date}"
|
||||||
|
}
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
b
|
||||||
|
{
|
||||||
|
"Author: ",
|
||||||
|
a { href: "{adventurer.legend.profile}", "{adventurer.name}" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p
|
None=>
|
||||||
{
|
{
|
||||||
b
|
rsx!
|
||||||
{
|
{
|
||||||
"Author: ",
|
document::Meta
|
||||||
a { href: "{adventurer.legend.profile}", "{adventurer.name}" }
|
{
|
||||||
|
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();
|
||||||
@ -55,27 +91,17 @@ pub fn PostHeader(tale: Tale) -> Element
|
|||||||
// 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}" }
|
||||||
if let Some(image) = settings.default_post_image
|
if let Some(image) = settings.default_post_image
|
||||||
{
|
{
|
||||||
document::Meta { property: "og:image", content: image }
|
document::Meta { name: "image", property: "og:image", content: "{image}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 { {tale.lore.title} }
|
h1 { {tale.lore.title} }
|
||||||
@ -91,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..." }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,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!
|
||||||
@ -134,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 }
|
||||||
|
|||||||
@ -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
BIN
loreweaver/assets/images/loreweaver_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
BIN
tavern/assets/images/tavern_logo.png
Normal file
BIN
tavern/assets/images/tavern_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 249 KiB |
Reference in New Issue
Block a user