r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
713 stars 335 forks source link

TOC in articles not rendered properly with devel-`{pkgdown}` #1886

Closed IndrajeetPatil closed 2 years ago

IndrajeetPatil commented 2 years ago

Minimal reprex website: https://indrajeetpatil.github.io/minimalReprex/articles/test2.html

with default bootstrap version

For example, if my vignette TOC has the following structure:

image

It is rendered as:

image

with bootstrap: 5

The TOC is rendered as expected with defaults.

But if I specify bootswatch theme (e.g. to have dark background) as specified here), it leaves out section titles:

image

hadley commented 2 years ago

Probably because you've used multiple <h1>; pkgdown only expects one (generated by the article title).

IndrajeetPatil commented 2 years ago

pkgdown only expects one (generated by the article title)

Oh? Somehow missed this. It works with the CRAN version, but I guess that is serendipitous.

At any rate, I tried with <h2> and <h3>, and it looks good! Thanks.