use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OgImageData {
pub title: String,
pub description: Option<String>,
pub site_name: Option<String>,
pub author: Option<String>,
pub date: Option<String>,
pub tags: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct OgImageTemplate {
pub name: String,
pub layout: TemplateLayout,
}
impl OgImageTemplate {
#[must_use]
pub fn new(name: &str) -> Self {
Self { name: name.to_string(), layout: TemplateLayout::default() }
}
#[must_use]
pub fn centered(name: &str) -> Self {
Self { name: name.to_string(), layout: TemplateLayout::Centered }
}
#[must_use]
pub fn split(name: &str) -> Self {
Self { name: name.to_string(), layout: TemplateLayout::Split }
}
}
impl Default for OgImageTemplate {
fn default() -> Self {
Self::new("default")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum TemplateLayout {
#[default]
Default,
Centered,
Split,
Minimal,
Card,
}