gohugoio / gohugoioTheme

A [wip] theme for the gohugo.io home page, docs and theme sites.
MIT License
105 stars 63 forks source link

Add back-to-top button or fixed navigation #49

Open digitalcraftsman opened 7 years ago

digitalcraftsman commented 7 years ago

Pages with a lot of content, like the template primer, take users long to scroll back to the top. While I can click on the first headline in the TOC it doesn't take all the way up to the navigation. To reach the navigation I still a have to scroll once in order to reach it.

To simplify things I propose the addition of a back-to-top button that appears once the user surpasses a certain threshold of pixels in the viewport.

rdwatters commented 7 years ago

Not to muddy the issue, but I think fixed navigation(s) might be a better consideration.

bep commented 7 years ago

What do you mean by "fixed navigation"?

digitalcraftsman commented 7 years ago

Fixed in the sense that the navigation stays at the top for example while scrolling. This can simply be done by adding the position: fixed; property in CSS to a container. Hence the name.

Have a look at the navigation of this Bootstrap theme.

bep commented 7 years ago

Ah, OK, yes then I agree with @rdwatters -- it would be good to have the search box available at all times.

digitalcraftsman commented 7 years ago

A fixed navigation on the theme site would be a great addition as well since the homepage is quite long.

rdwatters commented 7 years ago

I should clarify: fixed for the sidebar nav and toc, at least on desktop, especially if we are going to (re)implement smooth scrolling with hash changes. (We already have fixed nav on mobile, and I like the accessibility consideration with the bottom:0px fixed positioning :smile:). The main thing for me is ease of navigation and to always have context readily available, both in terms of single pages with very long content and within site architecture, especially as we start adding nested sections.

But I also appreciate if @budparr doesn't want the repaints/jank or added JS management.

I don't have an opinion one way or the other on a fixed header.