diff --git a/DESCRIPTION b/DESCRIPTION index d39fc60b9..5130bd666 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -74,5 +74,5 @@ Config/testthat/parallel: true Config/testthat/start-first: build-article, build-quarto-article, build-reference Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.2.9000 SystemRequirements: pandoc diff --git a/R/build-home-authors.R b/R/build-home-authors.R index 8a7100e52..4c83ac5f0 100644 --- a/R/build-home-authors.R +++ b/R/build-home-authors.R @@ -84,10 +84,10 @@ data_home_sidebar_authors <- function(pkg = ".", call = caller_env()) { ) data <- data_authors(pkg, roles) authors <- purrr::map_chr(data$main, author_desc, comment = FALSE) - + before <- config_pluck_markdown_inline(pkg, "authors.sidebar.before", call = call) after <- config_pluck_markdown_inline(pkg, "authors.sidebar.after", call = call) - + bullets <- c(before, authors, after) if (data$needs_page) { bullets <- c(bullets, a(tr_("More about authors..."), "authors.html")) @@ -136,11 +136,15 @@ author_list <- function(x, authors_info = NULL, comment = FALSE, pkg = ".") { orcid <- purrr::pluck(x$comment, "ORCID") x$comment <- remove_orcid(x$comment) + ror <- purrr::pluck(x$comment, "ROR") + x$comment <- remove_ror(x$comment) + list( name = name, roles = roles, comment = linkify(x$comment), - orcid = orcid_link(orcid) + # can't have both ORCID and ROR + uniqueid = orcid_link(orcid) %||% ror_link(ror) ) } @@ -151,6 +155,9 @@ author_desc <- function(x, comment = TRUE) { if (!is.null(x$orcid)) { x$orcid }, + if (!is.null(x$ror)) { + x$ror + }, if (comment && !is.null(x$comment) && length(x$comment) != 0) { paste0("
\n(", linkify(x$comment), ")") } @@ -168,6 +175,17 @@ orcid_link <- function(orcid) { ) } +ror_link <- function(ror) { + if (is.null(ror)) { + return(NULL) + } + + paste0( + "", + "ROR" + ) +} + # Derived from: # db <- utils:::MARC_relator_db # db <- db[db$usage != "",] @@ -300,3 +318,10 @@ remove_orcid <- function(x) { } out } +remove_ror <- function(x) { + out <- x[names2(x) != "ROR"] + if (all(names(out) == "")) { + names(out) <- NULL + } + out +} diff --git a/R/build-home.R b/R/build-home.R index 357e3ee8c..a5d1b5ca6 100644 --- a/R/build-home.R +++ b/R/build-home.R @@ -119,10 +119,11 @@ #' See `?build_home` and `?build_site` for details about changing the location #' of the authors information within the home sidebar and the site footer. #' -#' ## Authors ORCID and bio +#' ## Authors ORCID, ROR and bio #' #' Author ORCID identification numbers in the `DESCRIPTION` are linked using -#' the ORCID logo: +#' the ORCID logo, +#' author ROR identification numbers are linked using the ROR logo: #' #' ```r #' Authors@R: c( @@ -131,7 +132,9 @@ #' ), #' person("Jay", "Hesselberth", role = "aut", #' comment = c(ORCID = "0000-0002-6299-179X") -#' ) +#' ), +#' person("Posit Software, PBC", role = c("cph", "fnd"), +#' comment = c(ROR = "03wc8by49")) #' ) #' ``` #' diff --git a/inst/BS5/assets/pkgdown.scss b/inst/BS5/assets/pkgdown.scss index 498f3afa5..f16ec4dd7 100644 --- a/inst/BS5/assets/pkgdown.scss +++ b/inst/BS5/assets/pkgdown.scss @@ -51,7 +51,7 @@ $pkgdown-navbar-bg-dark: if($navbar-dark-bg, $navbar-dark-bg, null) !default; } // make both the active nav and the hovered nav more clear by mixing the -// background colour with the body and primary colours respectively +// background colour with the body and primary colours respectively .nav-item .nav-link { @include border-radius($border-radius); } @@ -312,6 +312,11 @@ dt:target + dd { color: #A6CE39; margin-right: 4px; } +// ror badge +.ror { + height: 16px; + margin-right: 4px; +} // activate font awesome .fab { font-family: "Font Awesome 5 Brands" !important; @@ -372,7 +377,7 @@ a[href='#main'] { } .lifecycle-stable { background-color: rgb(16, 128, 1); color: var(--bs-white);} .lifecycle-superseded { background-color: rgb(7, 64, 128); color: var(--bs-white);} -.lifecycle-experimental, +.lifecycle-experimental, .lifecycle-deprecated { background-color: rgb(253, 128, 8); color: var(--bs-black);} /* Footnotes ---------------------------------------------------------------- */ @@ -452,7 +457,7 @@ pre, pre code { // Default dark mode styling does not look good for code [data-bs-theme="dark"] { pre, code { - background-color: RGBA(var(--bs-body-color-rgb), 0.1); + background-color: RGBA(var(--bs-body-color-rgb), 0.1); } // don't double apply transparency pre code { @@ -594,7 +599,7 @@ span.smallcaps {font-variant: small-caps;} ul.task-list{list-style: none;} ul.task-list li input[type="checkbox"] { width: 0.8em; - margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ + margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ vertical-align: middle; } diff --git a/inst/BS5/templates/content-authors.html b/inst/BS5/templates/content-authors.html index b337f6e44..07b4d229e 100644 --- a/inst/BS5/templates/content-authors.html +++ b/inst/BS5/templates/content-authors.html @@ -10,7 +10,7 @@

{{{pagetitle}}}