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

Better ways to organise news page #1610

Closed
dmurdoch opened this issue Apr 3, 2021 · 8 comments · Fixed by #1817
Closed

Better ways to organise news page #1610

dmurdoch opened this issue Apr 3, 2021 · 8 comments · Fixed by #1817
Labels
feature a feature request or enhancement news 📰

Comments

@dmurdoch
Copy link
Contributor

dmurdoch commented Apr 3, 2021

The rgl package Changelog page lists a lot of versions in the contents sidebar. However, that list doesn't scroll, so on my screen I can only see up to version 0.95.1158 unless I scroll the whole page to the bottom. The final 30 versions then come into view, but if I click on one of them that's not right near the bottom, I lose them again.

This is using Bootstrap 3 with the Github devel version of pkgdown, but the same issue occurs with CRAN pkgdown. For my first attempt with Bootstrap 4 I saw the same thing, but after updating all packages to devel versions, the contents listing has disappeared completely (at least with pkgdown::build_news()).

I think the solution would be to make the contents listing scrollable.

@hadley
Copy link
Member

hadley commented Apr 3, 2021

Getting the sidebar scrolling behaviour correct is surprisingly difficult, so I'd prefer not to have to revisit the current solution. One thing we could relatively easily do is group the versions using a heading hierarchy, so at least they wouldn't all attempt to show at the same time. Alternatively, you might try:

news:
  one_page: false

to see if that display is any better (but I suspect that it will just reveal a different problem).

@dmurdoch
Copy link
Contributor Author

dmurdoch commented Apr 3, 2021

You're right, the one_page: false display isn't really an improvement. A hierarchical grouping sounds better, especially if it could be done somewhat automatically, e.g. I'd just need a couple of lines like

news:
  group_by: year

(though there are versions with no release date, so that might be problematic).

@hadley
Copy link
Member

hadley commented Apr 3, 2021

Maybe there could be an option for manual grouping? That would be annoying to set up the first time, but would give maximum flexibility.

@dmurdoch
Copy link
Contributor Author

dmurdoch commented Apr 3, 2021

I imagine that would be easiest to implement, and it would get the job done.

@maelle

This comment has been minimized.

@cderv

This comment has been minimized.

@hadley

This comment has been minimized.

@hadley hadley changed the title Changelog contents should be scrollable Better ways to organise news page Sep 21, 2021
@hadley hadley added feature a feature request or enhancement news 📰 labels Sep 21, 2021
@hadley
Copy link
Member

hadley commented Oct 15, 2021

Hmmm, I think I have managed to come up with a tweak to make the sidebar independently scrollable:

#pkgdown-sidebar {
  position: sticky;
  top: calc(#{$pkgdown-nav-height} + 1rem);
  max-height: calc(100vh - #{$pkgdown-nav-height} - 2rem);
  overflow-y: scroll;
}

(And remove .sticky-top div)

There's at least one disadvantage, but I think it's pretty minor: if the sidebar content is longer than the main content (which probably would only happen on the home page, and only then if you had a short read me), you need to manually scroll the sidebar. OTOH maybe the sidebar on the home page should get a different treatment anyway, since it's not usually a table of contents.

Anyway, I'll work up PR with example later today.

hadley added a commit that referenced this issue Oct 15, 2021
New strategy for sidebar scrolling:

* Only apply to TOC, so doesn't affect home page 
 * Make TOC scrollable, and fix height to 100vw (minus margins)
* Remove negative margins treatment since the background is now cut off because `overflow-y: scroll` causes #TOC to get a new "block formatting context"

Fixes #1610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement news 📰
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants