R/build-logo.R

Defines functions logo_path has_logo find_logo copy_logo

 <- function(pkg = ".") {
  pkg <- as_pkgdown(pkg)

  logo_path <- (pkg$src_path)
  if (!is.null(logo_path)) {
    file_copy_to(
      src_paths = logo_path,
      src_root = pkg$src_path,
      dst_paths = path(pkg$dst_path, path_file(logo_path)),
      dst_root = pkg$dst_path
    )
  }
}

 <- function(path) {
  path_first_existing(
    c(
      path(path, "logo.svg"),
      path(path, "man", "figures", "logo.svg"),
      path(path, "logo.png"),
      path(path, "man", "figures", "logo.png")
    )
  )
}

 <- function(pkg) {
  logo_path <- (pkg$src_path)
  !is.null(logo_path)
}

logo_path <- function(pkg, depth) {
  path <- (pkg$src_path)
  if (is.null(path)) {
    return()
  }

  paste0(up_path(depth), path_file(path))
}
hadley/staticdocs documentation built on June 13, 2025, 3:24 a.m.