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

Default sort order of articles #2253

Closed
jennybc opened this issue Dec 16, 2022 · 0 comments · Fixed by #2254
Closed

Default sort order of articles #2253

jennybc opened this issue Dec 16, 2022 · 0 comments · Fixed by #2254

Comments

@jennybc
Copy link
Member

jennybc commented Dec 16, 2022

I've been playing with pkgdown to check that some of what I say in R Packages is actually correct.

I sat down to write about the article index and I wanted to say what its default is. For example, the reference index defaults to alphabetical. I assumed I would find the same is true for the articles, but I was wrong. Or, rather, it is alphabetical for some definition of alphabetical, but not the one I expected.

The toy package has 2 vignettes (alfa and bravo) and 1 non-vignette article (charlie).

$vignettes
# A tibble: 3 × 6
  name             file_in                        file_out              title   description depth
  <fs::path>       <fs::path>                     <fs::path>            <chr>   <chr>       <int>
1 alfa             vignettes/alfa.Rmd             articles/alfa.html    alfa    NA              1
2 articles/charlie vignettes/articles/charlie.Rmd articles/charlie.html charlie NA              1
3 bravo            vignettes/bravo.Rmd            articles/bravo.html   bravo   NA              1

Here's what the default article index looks like:

Screen Shot 2022-12-15 at 4 20 01 PM

So the default order appears to be based on file_in, with the leading vignettes stripped off. Which is going to insert any non-vignette articles in the articles subdirectory very early in the list. I think either of these orderings are a more expected default:

  • Alphabetical on basename(file_out)
  • Vignettes, then non-vignette articles, alphabetical within each category
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

Successfully merging a pull request may close this issue.

1 participant