1 unstable release
0.0.0 | Jan 18, 2019 |
---|
#43 in #social
13KB
114 lines
open-graph
Generate HTML for Open Graph integration.
Examples
Basic usage
use open_graph::{OpenGraph, ObjectType};
let card = OpenGraph::builder()
.site("@flickr")
.title("The Rock")
.type(ObjectType::VideoMovie)
.image("http://ia.media-imdb.com/images/rock.jpg")
.build();
<--! Output -->
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
Installation
$ cargo add open-graph
Safety
This crate uses #![deny(unsafe_code)]
to ensure everything is implemented in
100% Safe Rust.
Contributing
Want to join us? Check out our "Contributing" guide and take a look at some of these issues:
References
- Open Graph protocol specification
- Facebook object debugger
- LinkedIn post inspector
- Facebook webmasters sharing guide
License
MIT OR Apache-2.0
Dependencies
~1.5MB
~45K SLoC