Skip to main content

load_schemas

Function load_schemas 

Source
pub fn load_schemas(path: &Path) -> Result<Vec<ContentSchema>>
Expand description

Loads all content schemas from a content.schema.toml file.

Returns an empty Vec if the file does not exist — schemas are opt-in.

§Examples

use ssg::content::load_schemas;
use std::path::Path;

// Missing file ⇒ empty Vec, never an error.
let schemas = load_schemas(Path::new("./does-not-exist.toml")).unwrap();
assert!(schemas.is_empty());