Reputation: 46
I would like to add a logo of the copyright holder/funder in the static webpage of the R package I am maintaining. The webpage is created with pkgdown.
I see that, on their static webpages, all of the tidyverse packages have the RStudio logo at the end of the developers list, e.g. https://dplyr.tidyverse.org/. I browsed several yaml configuration files and skimmed through the source code of the pkgdown but couldn't seem to trace where this is specified although I can spot it in the pkgdown-generated html files; and I can tell it is being fetch from this url https://www.tidyverse.org/rstudio-logo.svg;
Then, I tried putting 'Rstudio' in the authors of my package and I saw the logo! So this is somehow hard coded in the pkgdown I suppose, i.e. when one of the authors in the description is 'RStudio' the logo is pulled from the above url.
How can I achieve something similar with my own logo, placed either locally or in a url?
Upvotes: 1
Views: 330
Reputation: 201
@maria-kalimeri, thanks for the answer; however, there are typing errors around the handling of quotes. Here is an updated version.
authors:
Funder_first_name Funder_last_name:
html: "<img src='man/figures/funderslogo.png' height='72' alt='Funder name'/>"
href: "https://fundersurl.com"
NOTE
_pkgdown.yml
Funder_first_name
and Funder_lastname
should be the same as the ones specified in person( "Funder_first_name", "Funder_last_name", role = c('fnd'))
in the DESCRIPTION file.Funder_name
Upvotes: 0
Reputation: 46
Ok, I hadn't really "skimmed through" (i.e. grepped) the pkgdown source code effectively. Indeed RStudio logo as well as personal webpage link for Hadley Wickham and the R Consortium are in the defaults and can be found in the build-home-authors.R. That helped me figure out that the yaml entry name I am looking for is html. My solution is below. I add an extra section 'authors' in the _pkgdown.yml to overwrite the default printout for the funder (or any other developer for that matter)
authors:
Funder’s Name:
html: "<img src='man/figures/funderslogo.png' height='24' alt='LogoFnd’/> "
href: https://fundersurl.com
Upvotes: 1