https://github.com/cran/pkgdown
Tip revision: 734352c469f19cb270b01aa86f91117117e69d29 authored by Hadley Wickham on 12 September 2020, 04:50:26 UTC
version 1.6.1
version 1.6.1
Tip revision: 734352c
build-logo.R
build_logo <- function(pkg = ".") {
pkg <- as_pkgdown(pkg)
logo_path <- find_logo(pkg$src_path)
if (!is.null(logo_path)) {
file_copy_to(pkg, logo_path, from_dir = path_dir(logo_path))
}
}
find_logo <- function(path) {
logo_path <- path(path, "logo.svg")
if (file_exists(logo_path))
return(logo_path)
logo_path <- path(path, "man", "figures", "logo.svg")
if (file_exists(logo_path))
return(logo_path)
logo_path <- path(path, "logo.png")
if (file_exists(logo_path))
return(logo_path)
logo_path <- path(path, "man", "figures", "logo.png")
if (file_exists(logo_path))
return(logo_path)
NULL
}