Create the content of a gallery page based on arbitrary page content and gallery configuration.

gallery_content(..., gallery_config = NULL, class = NULL)

Arguments

...

Unnamed items defining the main content of the page.

The gallery site configuration. Elements $include_before and $include_after (if present) are included before and after the main content. If character, their value is wrapped inside htmltools::HTML().

class

Character vector of custom classes, added to "gallery-container".

Value

The function constructs and returns the page content as a parent htmltools::div() HTML tag object with class "gallery-container" with three div() children.

  • One containing gallery_config$include_before (if present), with class "gallery-before".

  • One wrapping the main content items ... via htmltools::tagList() content, with class "gallery-main".

  • One containing gallery_config$include_after (if present), with class "gallery-after", and are wrapped in a parent <div> with class

The returned value can be rendered as HTML using as.character().

Examples

gallery_content(
  htmltools::h2("Hello world"),
  "Welcome to the gallery content world",
  gallery_config = list(
    include_before = "before<hr/>",
    include_after = htmltools::tagList(htmltools::hr(), "after")
  ),
  class = "hello-gallery"
)
#> <div class="gallery-container hello-gallery">
#>   <div class="gallery-before">before<hr/></div>
#>   <div class="gallery-main">
#>     <h2>Hello world</h2>
#>     Welcome to the gallery content world
#>   </div>
#>   <div class="gallery-after">
#>     <hr/>
#>     after
#>   </div>
#> </div>