Maria Kalimeri
Maria Kalimeri

Reputation: 46

Add logo of copyright holder or funder in pkgdown index.html

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

Answers (2)

Amanyiraho Robinson
Amanyiraho Robinson

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

Upvotes: 0

Maria Kalimeri
Maria Kalimeri

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

Related Questions