diff --git a/packages/types/Cargo.toml b/packages/types/Cargo.toml index 728ba08..a2fb768 100644 --- a/packages/types/Cargo.toml +++ b/packages/types/Cargo.toml @@ -21,4 +21,4 @@ strum = { workspace = true } uuid = { workspace = true } log = { workspace = true } -yuuka = "^0.1" +yuuka = "^0.3" diff --git a/packages/types/src/config.rs b/packages/types/src/config.rs index 717a638..68b6141 100644 --- a/packages/types/src/config.rs +++ b/packages/types/src/config.rs @@ -2,31 +2,30 @@ use anyhow::{anyhow, Result}; use once_cell::sync::Lazy; use std::sync::{Arc, Mutex}; -use yuuka::derive_config; +use yuuka::derive_struct; use crate::consts::CONFIG_DIR; -derive_config!(Config { - portal: Portal { +derive_struct!(pub Config { + portal: { title_suffix: String, - footer_banner: [FooterBannerItem { + footer_banner: [{ text: String, url: Option, }], language: String, timezone: i32, }, - router: Router { + router: { media_entry_path: String, limit_referrer_host: Option>, }, - upload: Upload { + upload: { image_size_limit: String, webp_auto_convert: bool, use_source_file_name: bool, } }); -pub use __Config::*; pub static CONFIG: Lazy>> = Lazy::new(|| { let raw = std::fs::read_to_string(CONFIG_DIR.clone()).unwrap();