leptos_next_metadata/conventions/
types.rs1use std::path::PathBuf;
7
8#[derive(Debug, Clone)]
10pub struct FileConventions {
11 pub favicon: Option<Vec<FaviconFile>>,
13
14 pub icons: Option<Vec<IconFile>>,
16
17 pub apple_touch_icons: Option<Vec<AppleTouchIcon>>,
19
20 pub robots_txt: Option<RobotsTxt>,
22
23 pub sitemaps: Option<Vec<SitemapFile>>,
25
26 pub manifests: Option<Vec<ManifestFile>>,
28
29 pub og_images: Option<Vec<OgImageFile>>,
31
32 pub twitter_images: Option<Vec<TwitterImageFile>>,
34}
35
36#[derive(Debug, Clone)]
38pub struct FaviconFile {
39 pub path: PathBuf,
41
42 pub size: u64,
44
45 pub mime_type: String,
47
48 pub dimensions: Option<(u32, u32)>,
50}
51
52#[derive(Debug, Clone)]
54pub struct IconFile {
55 pub path: PathBuf,
57
58 pub size: u64,
60
61 pub mime_type: String,
63
64 pub dimensions: Option<(u32, u32)>,
66
67 pub icon_type: IconType,
69}
70
71#[derive(Debug, Clone)]
73pub struct AppleTouchIcon {
74 pub path: PathBuf,
76
77 pub size: u64,
79
80 pub mime_type: String,
82
83 pub dimensions: Option<(u32, u32)>,
85
86 pub color: Option<String>,
88}
89
90#[derive(Debug, Clone)]
92pub struct RobotsTxt {
93 pub path: PathBuf,
95
96 pub size: u64,
98
99 pub preview: String,
101}
102
103#[derive(Debug, Clone)]
105pub struct SitemapFile {
106 pub path: PathBuf,
108
109 pub size: u64,
111
112 pub mime_type: String,
114
115 pub sitemap_type: SitemapType,
117}
118
119#[derive(Debug, Clone)]
121pub struct ManifestFile {
122 pub path: PathBuf,
124
125 pub size: u64,
127
128 pub mime_type: String,
130
131 pub manifest_type: ManifestType,
133}
134
135#[derive(Debug, Clone)]
137pub struct OgImageFile {
138 pub path: PathBuf,
140
141 pub size: u64,
143
144 pub mime_type: String,
146
147 pub dimensions: Option<(u32, u32)>,
149
150 pub route_pattern: Option<String>,
152}
153
154#[derive(Debug, Clone)]
156pub struct TwitterImageFile {
157 pub path: PathBuf,
159
160 pub size: u64,
162
163 pub mime_type: String,
165
166 pub dimensions: Option<(u32, u32)>,
168
169 pub route_pattern: Option<String>,
171}
172
173#[derive(Debug, Clone, PartialEq, Eq)]
175pub enum IconType {
176 Icon,
178
179 MaskIcon,
181
182 ShortcutIcon,
184}
185
186#[derive(Debug, Clone, PartialEq, Eq)]
188pub enum SitemapType {
189 Sitemap,
191
192 SitemapIndex,
194
195 RobotsSitemap,
197}
198
199#[derive(Debug, Clone, PartialEq, Eq)]
201pub enum ManifestType {
202 WebAppManifest,
204 PWAManifest,
206}
207
208#[derive(Debug, Clone)]
210pub struct FileMetadata {
211 pub size: u64,
213
214 pub mime_type: String,
216
217 pub dimensions: Option<(u32, u32)>,
219}