Skip to content

Commit

Permalink
More tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Jun 4, 2024
1 parent 9549694 commit 800a721
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vignettes/articles/example_cards.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ card <- function(title, link, image, alt = NULL, text = NULL, footer = NULL, ...
alt <- alt %||% paste0("Preview image of ", title)

bslib::card(
bslib::card_image(file = NULL, src = image, href = link, alt = alt),
bslib::card_title(htmltools::a(href = link, title)),
if (!is.null(text)) htmltools::HTML(commonmark::markdown_html(text)),
bslib::card_header(htmltools::a(href = link, title)),
bslib::card_body(
bslib::card_image(file = NULL, src = image, href = link, alt = alt),
if (!is.null(text)) htmltools::HTML(commonmark::markdown_html(text)),
fillable = FALSE
),
if (!is.null(footer))
bslib::card_footer(htmltools::HTML(footer)),
)
Expand Down

0 comments on commit 800a721

Please sign in to comment.