pub struct Config {
pub pages: Vec<MenuItemConfig>,
pub template_extras: Option<Vec<String>>,
}Expand description
Configuration for the application.
When it is loaded by crate::TeensyCms::from_config_path, all paths are considered related
to the config file itself.
In YAML format, the config would look like:
---
pages:
- path: about.html
url: /about
- title: Submenu
pages:
- path: sub/page.html
url: sub/page
template_extras:
# directories
- macros/
# single files
- layout.html
# globs
- helper/*.htmlFields§
§pages: Vec<MenuItemConfig>A list of pages and submenus to include.
template_extras: Option<Vec<String>>Extra templates to load into the rendering environment.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more