social_link: Specify the components of a social link

Description Usage Arguments Details Examples

View source: R/block_social_links.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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

rich-iannone/blastula documentation built on Oct. 17, 2020, 8:59 p.m.