6

I have thus far created 6 different pkgdown websites for my R packages (e.g., ggstatsplot, kittyR, etc.) and none of them ever had the following issue.

For the first time, running the following command

pkgdown::build_site(
  lazy = FALSE,
  run_dont_run = TRUE,
  seed = 123,
  devel = TRUE
)

is not rendering README badges and I am not sure why since the yaml I am using is similar to my other packages. I had raised issue on pkgdown GitHub repo, but it didn't help.

More explicitly, here is what my README looks like-

image

And here is what the pkgdown output looks like-

![image](https://user-images.githubusercontent.com/11330453/72661380-76ada780-39d9-11ea-8897-b7e991deabb8.png)

I get no warnings or errors while building the website., but as can be seen here, the badges are not rendered at all on the homepage. Any ideas on why this might be happening or how to resolve it?

Thanks in advance.

Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51
  • 2
    replicated this behavior on a different package using your README file with latest dev version of `pkgdown`. I noticed that adding something (anything) in backticks before the first heading made the badges re-appear. Have no idea why but may help pkgdown developers understand and be a workaround for you. Try adding the word "test" in backticks at line 16 of your README.Rmd file. – Stefan Avey Feb 12 '20 at 16:27
  • Thanks for the astute observation! That workaround indeed solves the issue :) Can you post the answer, I will accept it. – Indrajeet Patil Feb 19 '20 at 20:54

1 Answers1

2

I was able to replicate the issue with the README file you linked. I noticed that adding text (any characters) in backticks before the first heading made the badges re-appear. The reason has to do with how pkgdown parses the readme to look for badges. As a workaround, you could try adding the word "test" in backticks at line 16 of your README.Rmd file.

This seems to have now been resolved in the dev version of pkgdown. See the discussion of the issue for more details and consider using <!-- badges: start --> and <!-- badges: end --> around the badges section.

Stefan Avey
  • 1,148
  • 12
  • 23