social_link {blastula}R Documentation

Specify the components of a social link

Description

The social_link() function is used exclusively within block_social_links() with as many calls as the number of social sharing icons/links required. By providing a supported service name, a hosted icon image can be used. A link must be provided; it will be part of social sharing icon. All icons are rounded, transparent, and consist of a single color, or level of gray.

Usage

social_link(service, link, variant = NULL, alt = NULL)

Arguments

service

Either the name of a social sharing service or either of website, email, or rss.

link

The relevant link to content on the service.

variant

The variant of the icon to use. Options include bw (black and white, the default), color, dark_gray, gray, and light_gray.

alt

Text description of image passed to the alt attribute inside of the image (⁠<img>⁠) tag for use when image loading is disabled and on screen readers. If not supplied, then the name of the service will be used as alt text.

Details

The following social sharing services have hosted icons available:

Examples

# Create an email message with some
# articles in the `body`; in the footer,
# add some social sharing icons linking
# to web content
email <-
  compose_email(
    body =
      blocks(
        block_title("Exciting Travel Destinations"),
        block_articles(
          article(
            image = "https://i.imgur.com/dxSXzGb.jpg",
            title = "Hong Kong",
            content =
              "Once home to fishermen and farmers,
              modern Hong Kong is a teeming,
              commercially-vibrant metropolis where
              Chinese and Western influences fuse."
          ),
          article(
            image = "https://i.imgur.com/bJzVIrG.jpg",
            title = "Australia",
            content =
              "Australia ranks as one of the best
              places to live in the world by all
              indices of income, human development,
              healthcare, and civil rights."
          )
        )
      ),
    footer =
      blocks(
        block_text("Thanks for reading! Find us here:"),
        block_social_links(
          social_link(
            service = "pinterest",
            link = "https://www.pinterest.ca/TravelLeisure/",
            variant = "color"
          ),
          social_link(
            service = "tripadvisor",
            link = "https://www.tripadvisor.ca/TravelersChoice",
            variant = "color"
          )
        )
      )
  )

if (interactive()) email


[Package blastula version 0.3.5 Index]