Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabsets fail if Header 1 used #2720

Closed
al-obrien opened this issue Jul 15, 2024 · 1 comment
Closed

Tabsets fail if Header 1 used #2720

al-obrien opened this issue Jul 15, 2024 · 1 comment

Comments

@al-obrien
Copy link

al-obrien commented Jul 15, 2024

When adding a Header 1, tabsets fail to render in the previewed/deployed pkgdown site. Maybe I am silly and have simply ignored advice never to use a Header 1 in pkgdown articles?

My session (excuse the old R, its legacy code)

  • R version: 3.6.3
  • pkgdown: 2.0.9

No header 1 - Tabs work

---
title: "test"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = FALSE,
  comment = "#>"
)
```

## THIS IS A HEADER 2

ASDFASDF


### Tabset with pills {.tabset .tabset-pills}

#### Tab 12

blablablabla

```r
1 + 1
```

Should be "cool" heading below

##### cool

Stuff

#### Tab 2

blop

image

Header 1 - Tabs fail

---
title: "test"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = FALSE,
  comment = "#>"
)
```

# THIS IS A HEADER 1

ASDFASDF


### Tabset with pills {.tabset .tabset-pills}

#### Tab 12

blablablabla

```r
1 + 1
```

Should be "cool" heading below

##### cool

Stuff

#### Tab 2

blop

image

@hadley
Copy link
Member

hadley commented Aug 2, 2024

It's probably because when you use a h1 in page, pkgdown automatically shifts it, and all other headings, down one level. I think that probably messes up something with the tabset code. But I think the fix is just not to use <h1> in pages :) (Because a page should only have a single <h1> and that's the page title).

@hadley hadley closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants