Want to build a readthedocs style site

I am creating a site where the content is divided into various “books”, within each book the sidebar needs to list the pages in that particular book, in the correct order, possibly with 2 or 3 levels of indentation (sections, subsections…).

Next/previous within each book would be a bonus.

I did a similar thing in Hugo, never quite got it exactly as I wanted. I wondered if there was an example anyone has made in Jekyll that I could crib from to make sure I am doing it in a sensible way? Or any hints.

TIA

not sure if this fits your needs but have you seen:

http://idratherbewriting.com/documentation-theme-jekyll/

1 Like

My classic-jekyll-theme does something like this. When disabling the drop-down menu it will create a vertical menu that displays the selected main menu (book title?), with sub items (chapters?) and subsub items (Sections?) in it.

https://balancingrock.github.io/classic-jekyll-theme/

Though the example site at the link has the drop-down enabled, thus does not show the vertical menu.

Even when you don’t like the theme, I think it can easily be used as an example that you can modify yourself in order to create a special book-content widget.

Hi! Sorry, I made this theme too late

Thanks I’m interested too so I’ll check the theme.

I made a repo which let’s me list content any number of levels down and only the current folders and pages are shown as a menu so nesting doesn’t get crazy. There’s no sidebar though but maybe the dynamic menu that I’ve made can be turned into a sidebar this also dynamic if that suits you.

My proof of concept before that: https://github.com/michaelcurrin/nested-jekyll-menus

I am a Jekyll fan but for interest, here are some non-Jekyll solutions:

MkDocs is lighter on code I feel than Jekyll and provides much easier theming and sidebar and even search!
Without knowing ins and of each theme. You can make it look like Read The Docs specifically. It supports sidebar nesting up to 2 levels only and set by config YAML

See my quickstart

https://michaelcurrin.github.io/mkdocs-quickstart/

Also check out Docsify. Theming is mostly about changing colors rather than layout but you get a nested sidebar up to many levels from YAML. You can also configure how many levels should be shown. Another nice thing is that the subitems in the sidebar get compressed when you’re not on that section so it keeps it sane.

https://michaelcurrin.github.io/docsify-js-template/#/

Plus you can have multiple menu files to determine different sidebars. Then you use the header nav to get to sections of the site and each section has a sidebar of relevant content. Which means less nesting in the sidebar.