open-graph 0.0.0

Generate HTML for Open Graph integration.
Documentation
  • Coverage
  • 100%
    23 out of 23 items documented1 out of 10 items with examples
  • Size
  • Source code size: 38.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 24s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • yoshuawuyts/open-graph
    4 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • yoshuawuyts

open-graph

crates.io version build status downloads docs.rs docs

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

License

MIT OR Apache-2.0