1

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?

2 Answers2

1

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
  • One more note. The above lines in the .yml file define a relative path to the root of the package source. The index.html will find the logo cause it's built from the README.md (or alternatives) found in the root dir. However, there is a bunch of other index.html files, one for each webpage tab, that also need the logo for the footer. Those are inside docs/ and can't see the relative path above. One solution - the one I used - is to substitute the above line with `img src='funderslogo.png` and place a copy of the png inside docs/ and the rest of its subdirs (not many, most likely 3 or 4). – Maria Kalimeri Mar 09 '19 at 09:10
0

@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