Jay
Jay

Reputation: 3050

Sidebar on GitHub Pages

I have a simple site hosted on GitHub Pages. It is a public repository, just using the standard default template with default settings and such. It is being published directly from the root.

Essentially, everything is in the default state as per the official Github Pages tutorials. I just want to show a sidebar for my table of contents.

note : before you mark this duplicate, please note that I have spent a lot of time looking at other questions, but most of them talk about customising sidebar, hiding and showing. So, those questions already somehow got the sidebar working. Mine is about displaying the sidebar itself which seems to be not mentioned anywhere.

I am thinking, I am missing something very obvious line of code which should be added/enabled somewhere in my repository.

The repository is here - https://github.com/Jay-study-nildana/Tutorials

Upvotes: 11

Views: 8513

Answers (1)

johnml1135
johnml1135

Reputation: 4957

The default templates for Github Pages don't include sidebars - they are minimal by design. There are a few ways to go, and they all involve investing time into understanding Jekyll and themes:

  1. Use a Jekyll theme that already has sidebars (all themes work with Github Pages)
  2. Modify github-pages-minimal from the repo here - demo here
    • Set the theme to github-pages-minimal
    • Download the file _layouts/default.html from the forked repo and place in your repo in the same location.
    • Add more pages - as can be seen in the demo
    • Note: This will override the theme file, as per the Jekyll theme documenation
    • Note2: The index page will not appear in the list of files

Upvotes: 7

Related Questions