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