{% comment %} Partial for the textbook sidebar. Renders each chapter and its sections from _data/toc.yml . Much of the logic here is to add active classes to the currently active section. The currently active section / chapter should be highlighted in the sidebar. If a chapter or any of its sections are the current page, we should display the chapter's sections. Otherwise, we hide the sections to keep the sidebar short. We also prefix the sidebar entries with the chapter/section number. We assume a 1-level nesting; we will label 1.2, but not 1.2.1. {% endcomment %} {% assign chapter_num = 1 %}