3 releases (stable)

1.0.1 Nov 18, 2018
1.0.0 Nov 17, 2018
0.1.0 Nov 17, 2018

#5 in #card

Download history 33/week @ 2018-11-23 17/week @ 2018-11-30 7/week @ 2018-12-07 3/week @ 2018-12-14

8 downloads per month

MIT/Apache

24KB
421 lines

twitter-card

crates.io version build status downloads docs.rs docs

Generate HTML for Twitter Card integration.

Examples

Basic usage

use twitter_card::{Summary, TwitterCard};

let card = Summary::builder()
  .site("@flickr")
  .title("Small Island Developing States Photo Submission")
  .desc("View the album on Flickr.")
  .image("https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg")
  .build();
<--! Output -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@flickr" />
<meta name="twitter:title" content="Small Island Developing States Photo Submission" />
<meta name="twitter:description" content="View the album on Flickr." />
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg" />

Installation

$ cargo add twitter-card

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

Dependencies

~56KB