tempura 0.5.2

Pipeline-based Static site generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use anyhow::Context;

use crate::value::Value;

use super::Loader;

pub struct YamlLoader;

impl Loader for YamlLoader {
    fn load(reader: impl std::io::prelude::Read) -> anyhow::Result<Value> {
        let yaml =
            serde_yaml::from_reader(reader).with_context(|| "Could not parse YAML".to_string())?;

        Ok(Value::JSON(yaml))
    }
}