Skip to content

Add unique IDs to section headings in Aliki template#1603

Open
st0012 wants to merge 1 commit intomasterfrom
fix-1598
Open

Add unique IDs to section headings in Aliki template#1603
st0012 wants to merge 1 commit intomasterfrom
fix-1598

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Feb 8, 2026

The Aliki TOC is generated by JavaScript that scans h1/h2/h3 elements with IDs. Section title h2 elements had no ID, so they were invisible to the TOC. Meanwhile, h3 IDs like "constants" and "public-instance-methods" were duplicated across sections.

Prefix all heading IDs with the section's aref to make them unique. Move the section ID from the <section> element to the <h2> so the TOC picks it up naturally.

Screenshot 2026-02-08 at 10 20 30

Fixes #1598

The Aliki TOC is generated by JavaScript that scans h1/h2/h3
elements with IDs. Section title h2 elements had no ID, so they
were invisible to the TOC. Meanwhile, h3 IDs like "constants" and
"public-instance-methods" were duplicated across sections.

Prefix all heading IDs with the section's aref to make them unique.
Move the section ID from the <section> element to the <h2> so the
TOC picks it up naturally.

Fixes #1598
@st0012 st0012 self-assigned this Feb 8, 2026
@st0012 st0012 added the bug label Feb 8, 2026
@matzbot
Copy link
Collaborator

matzbot commented Feb 8, 2026

🚀 Preview deployment available at: https://01b9805e.rdoc-6cd.pages.dev (commit: 156cd5f)

@st0012 st0012 mentioned this pull request Feb 8, 2026
@Earlopain
Copy link
Contributor

Do you want to keep sections in the left sidebar? It feels redundant with the TOC (which itself is also not present in the sidebar)

@st0012
Copy link
Member Author

st0012 commented Feb 8, 2026

ToC is currently hidden on mobile. So if we removed it from sidebar, the sections info would just be unavailable on mobile.
I wouldn't fight hard to keep it if users think the sections section don't provide much value, but IMO that should be a separate discussion and change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sections not part of TOC

3 participants