3 releases (stable)

Uses old Rust 2015

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

#630 in Template engine

MIT/Apache

25KB
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

~65KB