eecs485staff / primer-spec

A Jekyll theme for sites with content-heavy pages
https://eecs485staff.github.io/primer-spec/
MIT License
22 stars 12 forks source link

Remove title from TOC if necessary #206

Closed seshrs closed 2 years ago

seshrs commented 2 years ago

Context

Closes #204.

If the page has only a single H1 heading, then that's likely the title of the page and doesn't need to be included in the Table of Contents in the Sidebar. This commit removes such a title if detected as a default behavior.

In conjunction with #205,

I didn't think it necessary to add an option to bypass this behavior. However, I'm happy to introduce such an option in future if needed.

Validation

I've updated the "Project 0" Demo to have a single H1 title (with all other headings being H2, etc.) The styling of headings in the Sidebar should match the Sidebar styles in eecs485staff.github.io/primer-spec.

Preview URL: PREVIEW#206

github-actions[bot] commented 2 years ago

The spec from this PR is available at https://preview.sesh.rs/previews/eecs485staff/primer-spec/206/.

(Available until Wed Oct 05 2022.)