CyberMages LLC

Innovation Powered by Wizardry

bard (0.3.0)

Published 2025-09-25 11:45:54 -04:00 by myrddin

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add bard@0.3.0

About this package

Dioxus components that will display a Tavern blogging system Blog.

Bard

Bard is the frontend rendering library for the Tavernworks blog system.
It provides Dioxus components for rendering blog content that has been compiled
into a SQLite database by Loreweaver and parsed by the Tavern engine.

Bard supports both server-side and client-side rendering and is designed to be
integrated into Dioxus applications.

Features

  • Dioxus components for routing and rendering blog pages
  • Works with content stored in a SQLite database
  • Compatible with dioxus-web and dioxus-desktop
  • Optional server integration via Axum for local hosting

Usage

To use Bard in a Dioxus application, you must:

  1. Initialize the database using bard::init_database.
  2. Add the Router::<bard::Page> component to your app.
  3. Optionally, define routes that include Bard under your own layout.

Example

#[component]
fn App() -> Element {
    rsx! {
        Router::<Page> {}
    }
}

#[derive(Routable, Clone, PartialEq)]
pub enum Page {
    #[layout(Navbar)]
    #[route("/")]
    Home {},

    #[child("/blog")]
    Bard
    {
       child: bard::Page
    },

    #[route("/:..route")]
    PageNotFound { route: Vec<String> }
}

Server-side Initialization

To serve the blog using Axum and load the database:

tokio::runtime::Runtime::new()
    .unwrap()
    .block_on(async move {
        bard::init_database("path/to/tavern.db").await;
    });

Features

Enable the following Cargo features as needed:

  • server: Enables Axum support for database-backed serving
  • web: Enables Dioxus web support

Copyright 2025 CyberMages LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS

Dependencies

ID Version
dioxus *
tavern ^0.3.0
tokio ^1.0
Details
Cargo
2025-09-25 11:45:54 -04:00
7
CyberMages LLC <Software@CyberMagesLLC.com>
Jason Travis Smith <Myrddin@CyberMages.tech>
Apache-2.0
35 KiB
Assets (1)
Versions (39) View all
0.3.17 2025-10-16
0.3.16 2025-10-16
0.3.15 2025-10-16
0.3.14 2025-10-12
0.3.13 2025-10-10