twitter-card

Crates.iotwitter-card
lib.rstwitter-card
version1.0.1
sourcesrc
created_at2018-11-17 19:42:09.422096
updated_at2018-11-18 01:40:07.362201
descriptionGenerate HTML for Twitter Card integration.
homepage
repositoryhttps://github.com/chooxide/twitter-card
max_upload_size
id97279
size50,172
Yosh (yoshuawuyts)

documentation

https://docs.rs/twitter-card

README

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

Commit count: 13

cargo fmt