Search code examples
rpkgdown

`README` badges not getting rendered properly in `pkgdown` website


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.


Solution

  • 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.