Skip to main content

systemprompt_provider_contracts/web_config/
mod.rs

1//! Web rendering configuration: paths, branding, theme, layout, and
2//! navigation. These types are serialized to / from YAML in the
3//! `webconfig.yaml` of each profile.
4
5mod branding;
6mod error;
7mod i18n;
8mod paths;
9mod theme;
10
11pub use branding::{BrandingConfig, LogoConfig, LogoVariant};
12pub use error::WebConfigError;
13pub use i18n::SiteI18nConfig;
14pub use paths::{ContentConfig, PathsConfig, ScriptConfig};
15pub use theme::{
16    AnimationConfig, BackgroundColors, BorderColors, CardConfig, CardGradient, CardPadding,
17    CardRadius, ColorPalette, ColorsConfig, FontConfig, FontFile, FontsConfig, LayoutConfig,
18    MobileCardConfig, MobileConfig, MobileLayout, MobileTypography, PrimaryColor, RadiusConfig,
19    ShadowSet, ShadowsConfig, SidebarConfig, SpacingConfig, SurfaceColors, TextColors,
20    TouchTargetsConfig, TypographyConfig, TypographySizes, TypographyWeights, ZIndexConfig,
21};
22
23use serde::{Deserialize, Serialize};
24use std::collections::HashMap;
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(deny_unknown_fields)]
28pub struct WebConfig {
29    pub paths: PathsConfig,
30    #[serde(default)]
31    pub scripts: Vec<ScriptConfig>,
32    #[serde(default)]
33    pub content: Option<ContentConfig>,
34    pub branding: BrandingConfig,
35    pub fonts: FontsConfig,
36    pub colors: ColorsConfig,
37    pub typography: TypographyConfig,
38    pub spacing: SpacingConfig,
39    pub radius: RadiusConfig,
40    pub shadows: ShadowsConfig,
41    pub animation: AnimationConfig,
42    #[serde(rename = "zIndex")]
43    pub z_index: ZIndexConfig,
44    pub layout: LayoutConfig,
45    pub card: CardConfig,
46    pub mobile: MobileConfig,
47    #[serde(rename = "touchTargets")]
48    pub touch_targets: TouchTargetsConfig,
49    #[serde(default)]
50    pub nav: NavConfig,
51    #[serde(default)]
52    pub social_action_bar: SocialActionBarConfig,
53    #[serde(default)]
54    pub pages: HashMap<String, serde_json::Value>,
55    #[serde(default)]
56    pub i18n: SiteI18nConfig,
57}
58
59#[derive(Debug, Clone, Serialize, Deserialize, Default)]
60#[serde(deny_unknown_fields)]
61pub struct NavConfig {
62    #[serde(default, rename = "app_url")]
63    pub app: String,
64    #[serde(default, rename = "docs_url")]
65    pub docs: String,
66    #[serde(default, rename = "blog_url")]
67    pub blog: String,
68    #[serde(default, rename = "playbooks_url")]
69    pub playbooks: String,
70    #[serde(default, rename = "github_url")]
71    pub github: String,
72    #[serde(default, rename = "getting_started_url")]
73    pub getting_started: String,
74}
75
76#[derive(Debug, Clone, Serialize, Deserialize, Default)]
77#[serde(deny_unknown_fields)]
78pub struct SocialActionBarConfig {
79    #[serde(default)]
80    pub label: String,
81    #[serde(default)]
82    pub platforms: Vec<SocialPlatform>,
83    #[serde(default)]
84    pub enable_share: bool,
85}
86
87#[derive(Debug, Clone, Serialize, Deserialize, Default)]
88#[serde(deny_unknown_fields)]
89pub struct SocialPlatform {
90    #[serde(rename = "type")]
91    pub platform_type: String,
92    #[serde(default)]
93    pub url: Option<String>,
94    #[serde(default)]
95    pub label: Option<String>,
96}