Skip to contents

Overview

somatemplate provides a custom pkgdown template for R packages developed by SomaLogic Operating Co., Inc. This package is designed to provide a cohesive visual identity for packages developed by SomaLogic, and we kindly request that you do not use it for your own personal package.

somatemplate was inspired by tidytemplate and rotemplate.

Installation

somatemplate can be installed from GitHub as follows:

remotes::install_github("SomaLogic/somatemplate")

It can then be used by your package when building a pkgdown site.

Usage

To use somatemplate for a pkgdown site, ensure that the package is installed, and that the DESCRIPTION file contains the following line:

Config/Needs/website: SomaLogic/somatemplate

Then, insert the following code into the pkgdown config file, _pkgdown.yml (or create a new one, if it doesn’t exist already):

template:
  package: somatemplate
  bootstrap: 5

If you’re updating a previously made pkgdown config file to use somatemplate, use the following list to enable use of the template:

  • Run usethis::use_pkgdown_github_pages() (note: this step is only necessary for new repositories that do not have a previously made pkgdown site)
  • Update the DESCRIPTION file, as described in Usage above
  • Update _pkgdown.yml to reference somatemplate, as described in Usage above
  • Optional: Update the NEWS.md file to describe the new incorporation of somatemplate

Package Structure

This pkgdown template appears to be structured like a normal R package, but differs in a few key ways:

--- _pkgdown.yml           # Configuration YAML file for *this* repository only
--- inst
    |__pkgdown
       |__ _pkgdown.yml    # Configuration YAML file for pkgdown sites, including customized sidebar links
       |__templates        # Custom HTML templates that override pkgdown defaults
          |__footer.html
       |__extra.scss       # Extra SCSS code that will be copied into the rendered site
--- R
    |__test-function.R.    # Example R function for template testing purposes only
--- vignettes
    |__test-code.Rmd       # Example vignette for template testing purposes only
    |__test-formatting.Rmd # Example vignette for template testing purposes only