-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Tweak the CSS of the TOC sidebar #2037
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
base: gh-pages
Are you sure you want to change the base?
Conversation
Only put the navigation across other pages in the <nav> element.
Use semantic HTML to make the table of contents in the sidebar collapsible.
Make sidebar.scss the single-source-of-truth and put all the styling related to the sidebar in sidebar.scss.
Give the sidebar the same background as the main content and make the border wrap around the table of contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it is even possible to keep the table of contents sticky without it being in the <nav>
section...
{{ if (eq .Params.Sidebar "book") }} | ||
<hr class="sidebar"> | ||
{{- /* If this page displays a section of the ProGit book, map all the translations thereof */ -}} | ||
{{ with $.Page.Params.book }} | ||
{{ $cs_number := .section.cs_number }} | ||
{{ range $.Page.Site.Data.book }} | ||
{{ $language_code := .language_code }} | ||
{{ range .chapters }} | ||
{{ range .sections }} | ||
{{ if (eq .cs_number $cs_number) }} | ||
{{ $.Scratch.SetInMap "translations" $language_code .url }} | ||
{{ end }} | ||
{{ if (eq .Params.Sidebar "book") }} | ||
<hr class="sidebar"> | ||
{{- /* If this page displays a section of the ProGit book, map all the translations thereof */ -}} | ||
{{ with $.Page.Params.book }} | ||
{{ $cs_number := .section.cs_number }} | ||
{{ range $.Page.Site.Data.book }} | ||
{{ $language_code := .language_code }} | ||
{{ range .chapters }} | ||
{{ range .sections }} | ||
{{ if (eq .cs_number $cs_number) }} | ||
{{ $.Scratch.SetInMap "translations" $language_code .url }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ partial "translations.html" . }} | ||
{{ else if (and (ne $section "documentation") (ne $section "site")) }} | ||
<hr class="sidebar"> | ||
{{ partial "book.html" }} | ||
{{ end }} | ||
</nav> | ||
{{ partial "translations.html" . }} | ||
{{ else if (and (ne $section "documentation") (ne $section "site")) }} | ||
<hr class="sidebar"> | ||
{{ partial "book.html" }} | ||
{{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the translated books may want to stay in the <nav>
bar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the translated books may want to stay in the
bar?
@dscho Maybe, yes. I didn't check the book yet. I should have. Putting it on my list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dscho Why are book translations in the sidebar and man page translations at the top? I think they all should go in the top nav.
@dscho Yeah, that's something I wanted to figure out still. |
@dscho This is still work-in-progress to see if we like the design. Once we settle on the look, I will figure out how to make it all work. |
@dscho This is still work-in-progress to see if we like the design. Once we settle on the look, I will figure out how to make it all work. For example, would "on this page" on the top work better? ![]() |
I like that! @jvns what is your opinion? |
I like the way it connects to the page's content! It feels a little weird to push the main navigation down like that -- in a way it seems like the "table of contents" should actually be a sub-item of "Reference" somehow (like we're at Documentation -> Reference -> |
@jvns I kind a like that idea. I've been wanted to have more like a breadcrumbs style navigation and that's what you're suggesting with Documentation -> Reference -> Personally I think the whole navigation on this website is awkward. Maybe a bigger overhaul is needed. If we can find someone to put the work into that (not sure that one will be me, but I'll think about it). cc @dscho |
Changes
An attempt to make it look more pretty.
Context
Recently the TOC was added, in the sidebar. This PR attempts to make it integrate better into the aesthetic.
Deployed to https://to1ne.github.io/git-scm.com/docs/git-rebase
TODO