Skip to content
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

Merged
merged 2 commits into from
Oct 6, 2023
Merged

Conversation

JiangLong2019
Copy link

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:

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 5, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 5, 2023

Page Scores Audits Google
/brands/consumer-health-beauty PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

tocIndex = i;
}

[...ul.querySelectorAll('li')].forEach((li) => {
Copy link

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?

Copy link
Author

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.

li.innerText = '';
li.append(aLink);
});
[...document.querySelectorAll('[data-toc]')].forEach((section) => {
Copy link

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.

@sdmcraft
Copy link

sdmcraft commented Oct 6, 2023

It'd be great if you can add an example for this in the block library. Please ignore if done already.

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 6, 2023

Page Scores Audits Google
/brands/consumer-health-beauty PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@JiangLong2019
Copy link
Author

All done

@JiangLong2019 JiangLong2019 merged commit 8f4703c into main Oct 6, 2023
4 checks passed
@JiangLong2019 JiangLong2019 deleted the issue-100 branch October 6, 2023 08:58
@sdmcraft sdmcraft added this to the Milestone-4 milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor TOC to support anchor specified in metadata
3 participants