breb 0.5.0

the blog/reblog library and command-line tool
Documentation
use super::*;

impl super::Config {
	/// a random example config -- used for testing serialization internally.
	///
	/// what exactly this contains is utterly unspecified,
	/// and it might not even work on your machine.
	pub fn example() -> Self {
		Self {
			blog: BlogInfo {
				name: "example blog".into(),
				url: "blog.example.com".into(),
			},
			authors: vec![
				Author {
					name: "E. X. Ample".into(),
					email: Some("example@example.com".into()),
					website: None,
				}
			],
			sections: SectionList::Many {
				adjacent: Default::default(),
				sections: vec![
					ConfigSection::Normal(ConfigSectionBase {
						serves: ServeList {
							serves: vec![
								ServeInfo::Posts {
									serve_at: "/posts".into(),
									from: Some("posts/".into()),
									template: None,
									bases: Default::default(),
									styles: None,
									nav: None,
									locale: None,
									index: None,
								}
							],
							adjacent: AdjacentInfo {
								..Default::default()
							}
						},
						feeds: vec![],
					}),
					ConfigSection::Normal(ConfigSectionBase {
						serves: ServeList {
							serves: vec![
								ServeInfo::LocalGitRepo {
									serve_at: "/blog-reblog".into(),
									source: Some(".".into()),
								}
							],
							adjacent: AdjacentInfo {
								..Default::default()
							}
						},
						feeds: vec![],
					}),
					ConfigSection::Translated {
						base: ConfigSectionBase {
							serves: ServeList {
								serves: vec![
									ServeInfo::Posts {
										serve_at: "/posts".into(),
										from: None,
										template: None,
										bases: Default::default(),
										styles: None,
										nav: None,
										locale: None,
										index: None,
									}
								],
								adjacent: AdjacentInfo {
									..Default::default()
								}
							},
							feeds: vec![],
						},
						languages: vec![
							Translation {
								locale: "en_US".into(),
								url_prefix: "/".into(),
								path_prefix: Some("en".into()),
								adjacent: AdjacentInfo {
									nav: Some(vec![
										[("about".into(), "/about".into())].into_iter().collect(),
									]),
									..Default::default()
								}
							},
							Translation {
								locale: "es_ES".into(),
								url_prefix: "/es".into(),
								path_prefix: Some("es".into()),
								adjacent: AdjacentInfo {
									nav: Some(vec![
										[("sobre".into(), "/es/sobre".into())].into_iter().collect(),
									]),
									..Default::default()
								}
							},
						],
					}
				]
			},
		}
	}
}