This crate is a Rust library for using the Serde serialization framework with Jekyll-style front matter.
```rust use serde::{Deserialize, Serialize};
pub struct MyData { pub title: String }
fn main() { // Serialize let frontmatter = MyData { title: "Hello, World!".tostring() }; let content = "This is some content"; let output = serdefrontmatter::serialize(frontmatter, content).unwrap(); assert_eq!("---\ntitle: \"Hello, World!\"\n\n---\nThis is some content", output);
// Deserialize
let input = "---\ntitle: Hello, World!\n---\nThis is some content";
let (front_matter, content) = serde_frontmatter::deserialize::<MyData>(input).unwrap();
assert_eq!(front_matter, MyData { title: "Hello, World!".to_string() });
assert_eq!(content, "\nThis is some content");
} ```