-
Notifications
You must be signed in to change notification settings - Fork 35
Show sub-pages in sidebar navigation when top-level page is selected #428
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
Conversation
|
This bothered me too. I took a quick look and realized it was a bit more complicated to change than I thought because the hot links at the bottom are on a separate page somehow. How did you deal with them? |
|
Didn't touch the links at the bottom. Also not sure why they should be related to the nav bar, technically? |
|
Thanks for the PR @mlange-42 ! This is a clear improvement but it exposes a larger problem - apparently we are still using docsy theme code from v0.1.0 of docsy and should upgrade to the latest release, v0.4.0 which has numerous improvements and changes but also breaks some of the ways we were extending / modifying the theme. Here's what it looks like with the latest v0.4.0 sidebar-tree template: I think it might be worth the time to invest upgrading to the latest version of docsy to resolve this issue as well as the others and can continue to push those changes to this branch. Thoughts? |
alee
left a comment
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.
we should consider upgrading the theme code that's mostly been copy-pastaed from the docsy theme with the latest v0.4.0 e.g., https://github.com/google/docsy/blob/main/layouts/partials/sidebar-tree.html
This probably also affects page-meta-links.html and all the other customized files in layouts
|
I agree about updating to a better looking and more flexible web overlay. Any idea how much will break if we upgrade? With the recent papers, it would be a very good time for the site to be looking and working better--and at the same time not so good a time for it to be broken. |
|
Please don't care for this PR while updating. It is a very quick fix. Probably the functionality I added here is already there in v0.4.0. At least in another project using Docsy, I got it out of the box. Generally, I think updating it a good thing. The longer you wait, the more breaking changes. |
Should not be a problem to fix it on a branch, and merge into |
|
The PR already exists and explains the issue well so if you don't mind keeping the fork/branch open I'll add the changes here and lay the changes on top 😅
|
remove unnecessary shortcodes already provided by docsy
- include -> readfile
- imgproc already provided, no need to reimplement
replace npm package.json with tagged google/docsy github reference
TODO:
- use docsy as a hugo module instead of a git submodule
https://www.docsy.dev/docs/get-started/docsy-as-module/
- remove sidebar-tree, figure out how to customize the right sidebar as
it was rendered in the old site
base docsy layouts for the docs type are good enough, only need to customize layouts/partials/page-meta-links.html TODO: changes incoming to reflect latest version of docsy page-meta-links as well as shifting to using Docsy as a Hugo Module
docsy now recommends that it be used as a Hugo Module instead of as a git submodule: https://www.docsy.dev/docs/updating/convert-site-to-module/
- package.json and yarn.lock no longer needed due to hugo module change - Makefile no longer needs to update submodule - minor refinements to footer for responsiveness
hugo modules still need node + autoprefixer + postcss https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-postcss
in a vain effort to get the workflow check running again

It was bothering me a bit to have to scroll down to the list of sub-pages. Only when on a subpage, sibling pages appear in the sidebar navigation.
Modified the nav sidebar layout to include sub-pages when on a top-level page.
Screenshot of the sidebar when on the About page, before the change:
After the change: