Added the ability to specify images.
The blog title can now be set to be an image. If not it will default to the text. If no text it will just be "Blog". A Post has now been given a default post image that will be used for all posts for their openGraph sharing. This can later be expanded to allow a blog post to have a desired image.
This commit is contained in:
@ -10,7 +10,6 @@ edition = "2021"
|
||||
axum = { version = "0.8.4", optional = true }
|
||||
axum-server = { version = "0.7.2", optional = true }
|
||||
dioxus = { version = "=0.7.0-rc.1", features = ["router", "fullstack"] }
|
||||
#dioxus-cli-config = { version = "*", optional = true }
|
||||
bard = { version = "*", path="../bard", optional = true }
|
||||
tokio = { version = "1.0", optional = true }
|
||||
|
||||
|
||||
BIN
blog_test/assets/runes_and_ramblings_logo.png
Normal file
BIN
blog_test/assets/runes_and_ramblings_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1019 KiB |
BIN
blog_test/assets/runes_and_ramblings_text.png
Normal file
BIN
blog_test/assets/runes_and_ramblings_text.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 335 KiB |
@ -6,6 +6,11 @@ use bard::*;
|
||||
|
||||
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
||||
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));
|
||||
|
||||
|
||||
|
||||
fn main()
|
||||
@ -30,6 +35,8 @@ fn App() -> Element
|
||||
let custom_settings = BardSettings
|
||||
{
|
||||
blog_name: Some(String::from("Blog Test")),
|
||||
blog_image: Some(BLOG_IMAGE),
|
||||
default_post_image: Some(POST_IMAGE),
|
||||
stylesheet: StylesheetBehavior::Extend(BLOG),
|
||||
};
|
||||
provide_context(custom_settings);
|
||||
|
||||
Reference in New Issue
Block a user