feat: per-page titles, OG/SEO tags, HOST/PORT env vars, BASE_URL in config

This commit is contained in:
2026-05-04 22:38:58 +02:00
parent 38a3aa6bbf
commit b30a6a102b
8 changed files with 42 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
#[derive(Clone)]
pub struct AppConfig {
pub allow_registration: bool,
pub base_url: String,
}
impl AppConfig {
@@ -8,6 +9,8 @@ impl AppConfig {
let allow_registration = std::env::var("ALLOW_REGISTRATION")
.map(|v| v == "true" || v == "1")
.unwrap_or(false);
Self { allow_registration }
let base_url = std::env::var("BASE_URL")
.unwrap_or_else(|_| "http://localhost:3000".to_string());
Self { allow_registration, base_url }
}
}

View File

@@ -7,6 +7,8 @@ pub struct HtmlPageContext {
pub user_id: Option<Uuid>,
pub register_enabled: bool,
pub rss_url: String,
pub page_title: String,
pub canonical_url: String,
}
impl HtmlPageContext {