pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Update build_home() docs

Open maelle opened this issue 3 years ago • 2 comments

With what was changed in #2114

maelle avatar Sep 20 '22 09:09 maelle

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:

maelle avatar Sep 22 '22 14:09 maelle

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.

maelle avatar Sep 22 '22 14:09 maelle

https://community.rstudio.com/t/badges-stoped-being-visible-on-website-html-using-pkgdown/152056/4

maelle avatar Nov 08 '22 08:11 maelle

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.

maelle avatar Nov 14 '22 13:11 maelle

The first two bullets make sense to me. I don't understand the last one.

hadley avatar Nov 14 '22 13:11 hadley

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.

image

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.

maelle avatar Nov 14 '22 13:11 maelle

Oh that seems like a bug, and we should just fix it.

hadley avatar Nov 14 '22 14:11 hadley

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?

maelle avatar Nov 14 '22 14:11 maelle

Yes, that's the current expected behaviour. We could add a setting if needed.

hadley avatar Nov 23 '22 20:11 hadley