Skip to main content

build_oembed

Function build_oembed 

Source
pub fn build_oembed(
    title: &str,
    author: Option<&str>,
    provider_name: Option<&str>,
    provider_url: Option<&str>,
) -> Value
Expand description

Builds one oEmbed 1.0 link-type document.

ยงExamples

use ssg::oembed::build_oembed;
let doc = build_oembed(
    "Hello",
    Some("[email protected] (Jane)"),
    Some("Example"),
    Some("https://example.com"),
);
assert_eq!(doc["version"], "1.0");
assert_eq!(doc["type"], "link");
assert_eq!(doc["title"], "Hello");
assert_eq!(doc["provider_name"], "Example");
assert_eq!(doc["author_name"], "Jane");