-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor TOC to support anchor specified in metadata #103
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
|
|
tocIndex = i; | ||
} | ||
|
||
[...ul.querySelectorAll('li')].forEach((li) => { |
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.
Could this also be implemented for the side TOC as well to maintain consistency?
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.
@dnbute Unfortunately I don't have this needs for current page. If you have we can do it, or we can do it in the future.
blocks/toc/toc.js
Outdated
li.innerText = ''; | ||
li.append(aLink); | ||
}); | ||
[...document.querySelectorAll('[data-toc]')].forEach((section) => { |
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.
Nit: Maybe I'd rename the property toc
to toc-anchor
to convey the meaning.
It'd be great if you can add an example for this in the block library. Please ignore if done already. |
|
All done |
Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):
Fixes #100
Test URLs:
Original: https://www.sunstar.com/brands/consumer-health-beauty/
Before: https://main--sunstar--hlxsites.hlx.live/brands/consumer-health-beauty
After: https://issue-100--sunstar--hlxsites.hlx.live/brands/consumer-health-beauty
If you are adding a new block or a variation to an existing block, please fill below:
Block library path: https://--sunstar--hlxsites.hlx.page/tools/sidekick/library.html?plugin=blocks&path=/sidekick/blocks/&index=0