Update build_home() docs
With what was changed in #2114
It'd also be useful to clarify that if the configuration for the sidebar does not contain "dev" as an element, the current logic means the badges won't be removed from the body. https://github.com/r-lib/pkgdown/blob/956f076f661eb2de9413f64ea24a580cf444466d/R/tweak-homepage.R#L52
I was surprised by this but it does not mean it isn't logical :sweat_smile:
To clarify if you have a customized sidebar configuration AND want the badges removed from the main README for the production website, you need to add "dev" to the sidebar configuration. There will be no "dev status" section in the sidebar and the badges will be removed.
https://community.rstudio.com/t/badges-stoped-being-visible-on-website-html-using-pkgdown/152056/4
Summary of what I understood
- Badges are not shown on released website. #2233
- This behavior can NOT be customized.
- Confusing behavior regarding badges removal from the main content. If you use a custom sidebar configuration, and want the badges removed from the main content, you need the sidebar configuration to include "dev" even if that does not mean the badges will appear in the sidebar configuration, since that does not happen for released websites.
The first two bullets make sense to me. I don't understand the last one.
Sorry. Here is a reprex https://github.com/maelle/badgey
In that package there is a custom sidebar configuration that does not include the "dev" section. https://github.com/maelle/badgey/blob/e100afa9cb285147f6d3e5340782b2ef96103c5c/_pkgdown.yml#L9
Because of that, the badges are not removed from the main content.

To remove the badges from the main content, one needs to add the "dev" section to the custom sidebar configuration.
It is a bit confusing because in the end, there is no dev section in the sidebar anyway for that released website.
I wonder
- whether it is a niche problem so should be ignored. :sweat_smile:
- whether the removal of badges from the main content should be controlled differently, independently from whether they are included or not in the sidebar.
Oh that seems like a bug, and we should just fix it.
I'll try to get to it soon-ish.
Is the expected behavior that pkgdown should always remove the badges from the main content (when it can detect it), and that one cannot prevent (customize) pkgdown from doing so?
Yes, that's the current expected behaviour. We could add a setting if needed.