Revision df465aa02367bc8bf2fa3f2e3827be5f8713569a authored by Hadley Wickham on 03 December 2021, 09:00:02 UTC, committed by cran-robot on 03 December 2021, 09:00:02 UTC
1 parent be39bf7
build-home-community.R
has_contributing <- function(path = ".") {
file_exists(path(path, 'CONTRIBUTING.md')) ||
file_exists(path(path, '.github', 'CONTRIBUTING.md'))
}
has_coc <- function(path = ".") {
file_exists(path(path, 'CODE_OF_CONDUCT.md')) ||
file_exists(path(path, '.github', 'CODE_OF_CONDUCT.md'))
}
data_home_sidebar_community <- function (pkg){
pkg <- as_pkgdown(pkg)
links <- NULL
if (has_contributing(pkg$src_path)) {
links <- c(links, a(tr_("Contributing guide"), "CONTRIBUTING.html"))
}
if (has_coc(pkg$src_path)) {
links <- c(links, a(tr_("Code of conduct"), "CODE_OF_CONDUCT.html"))
}
if (is.null(links)) {
return("")
}
sidebar_section(tr_("Community"), links)
}

Computing file changes ...