added contact page

This commit is contained in:
2026-05-14 17:06:27 +02:00
parent b0f2634346
commit 0102c89d81
6 changed files with 290 additions and 5 deletions
+2
View File
@@ -40,6 +40,8 @@ pub async fn update_config(
if let Some(v) = patch.favicon { config.favicon = v; }
if let Some(v) = patch.theme { config.theme = v; }
if let Some(v) = patch.custom_css { config.custom_css = v; }
if let Some(v) = patch.contact_intro { config.contact_intro = v; }
if let Some(v) = patch.contact_links { config.contact_links = v; }
let config_str = serde_json::to_string_pretty(&config).map_err(|e| {
error!("Serialization error: {}", e);
+17
View File
@@ -1,6 +1,13 @@
use chrono::NaiveDate;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone)]
pub struct ContactLink {
pub kind: String,
pub label: String,
pub value: String,
}
#[derive(Serialize, Deserialize, Clone)]
pub struct SiteConfig {
pub title: String,
@@ -11,6 +18,10 @@ pub struct SiteConfig {
pub favicon: String,
pub theme: String,
pub custom_css: String,
#[serde(default)]
pub contact_intro: String,
#[serde(default)]
pub contact_links: Vec<ContactLink>,
}
impl Default for SiteConfig {
@@ -26,6 +37,8 @@ impl Default for SiteConfig {
favicon: "/favicon.svg".to_string(),
theme: "salon".to_string(),
custom_css: "".to_string(),
contact_intro: "".to_string(),
contact_links: Vec::new(),
}
}
}
@@ -48,6 +61,10 @@ pub struct SiteConfigPatch {
pub theme: Option<String>,
#[serde(default)]
pub custom_css: Option<String>,
#[serde(default)]
pub contact_intro: Option<String>,
#[serde(default)]
pub contact_links: Option<Vec<ContactLink>>,
}
#[derive(Serialize, Deserialize, Clone, Default)]