card_widget.Rd
Provide a preview image and a widget, plus Twitter Player card metadata and get pack a packaged up, ready-to-deploy archive to deploy and used on Twitter.
card_widget(widget, output_dir = ulid::ulid_generate(), name_prefix = "wdgtcrd", preview_img, html_title = class(widget)[[1]], card_twitter_handle = "", card_title = html_title[[1]], card_description = "", card_image_url_prefix = "", card_player_url_prefix = "", card_player_width = 480, card_player_height = 480, background = "white", bundle_type = c("tgz", "zip"))
widget | an |
---|---|
output_dir | the path to save the card-able widget to. If the directory does
not exist it will be created for you (recursively). The value will be
|
name_prefix | the name-prefix for the widget's |
preview_img | the path to the local preview image for the card-able widget. This
file must exist and will be copied over to the deployable directory and renamed
(see |
html_title | the title for the |
card_twitter_handle | Your twitter handle including the |
card_title, card_description | The title and description that will be displayed in the tweet |
card_image_url_prefix | Prefix URL for where you will be copying the preview image to.
Generally, this wil be the same as |
card_player_url_prefix | Prefix URL for where you will be copying the |
card_player_width, card_player_height | the width and height for the player window in-tweet. These default to 480x480 and you should review the References section for links to guidelines for Twitter preferred image sizes. |
background |
|
bundle_type | either |
the path.expand()
ed path to the bundle_type
. The archive name will be name_prefix
plus the bundle_type
extension.
You can use Twitter's Validator to ensure your creation is usable before trying it in a tweet.
You can and should use Twitter's Validator to ensure your creation is usable before trying it in a tweet.