-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open accordions using URL hashes #674
Conversation
modifies table-of-contents scroll behavior to exclude headings within accordions so as not to have headings within IDs within an accordion override the hash of the open accordion
I admit I'm not the best front end expert, but this seems reasonable to me. |
@IanLee1521 @hauten I just added a change to allow users to manually specify the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it does what it set out to do! This should resolve #671
I have included some nitpicky formatting suggestions. We've (unfortunately) yet to establish standards for JS the way we have for Python, but ideally a file should at least be consistent in itself.
Co-authored-by: Laura Weber <LRWeber@users.noreply.github.com>
Added Matomo tracking code for tracking accordion opens |
This change allows users to link directly to an opened accordion.
Page section tracking via URL hash is modified to exclude headings within page accordions, as those headings would override the open accordion's hash on-page.
The logic generates the URL hash from the accordion title (“How do I set up two-factor authentication (2FA)?” becomes “how-do-i-set-up-two-factor-authentication-2fa”). But the hash/ID can be overridden using the “slug” parameter when including the accordion component.
The hash is added/removed from the URL when users open/close the accordions.
Also adds a missing
js.map
file.