Skip to content

Conversation

ShubhamOulkar
Copy link
Member

@ShubhamOulkar ShubhamOulkar commented Sep 9, 2025

New design

light dark
Screenshot 2025-09-14 084145 Screenshot 2025-09-14 084157

❌ design ❌
image

@ShubhamOulkar ShubhamOulkar requested a review from a team as a code owner September 9, 2025 15:02
Copy link

netlify bot commented Sep 9, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 2d3f972
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/68d36f9cb9117a000815e995
😎 Deploy Preview https://deploy-preview-2055--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ShubhamOulkar ShubhamOulkar changed the title feat: add docs header links feat: generate dynamic docs header links Sep 9, 2025
Copy link
Contributor

github-actions bot commented Sep 14, 2025

🚦 Lighthouse Results (Mobile & Desktop)

URL Device Perf A11y Best Practices
/ mobile 🔴 68 🟢 100 🟢 96
/en/blog/posts.html mobile 🟠 78 🟢 96 🟢 96
/en/5x/api.html mobile 🔴 66 🟢 95 🟢 96
/ desktop 🟢 100 🟢 100 🟢 96
/en/blog/posts.html desktop 🟢 99 🟢 96 🟢 93
/en/5x/api.html desktop 🟢 100 🟢 95 🟢 96

Copy link
Member

@jonchurch jonchurch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I thought we already had these, or had them in a PR, but I can't find any evidence for that.

Great idea.

Do note though, this will add these anchor links to h2, h3 on all pages of the site!

I didn't check all pages to see if it is messed up anywhere, but I caught some bugs on the docs page at least.

Is there a reason why this is living inside the copycode.js script file? it could move to the app.js file inside the jquery DOMContentLoaded callback at the top of the file

});

// add heading links
for (const heading of headers) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const heading of headers) {
for (const heading of headers) {
if (h.querySelector('.heading-link')) continue;

Nit: A little paranoid but this will guard against the script running twice somehow by accident or hot reloading or something, preventing us from adding the elements twice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want thinking of implementing lazy attach links using IntersectionObserver or MutationObserver. WDYT?

Is there a reason why this is living inside the copycode.js script file?

Copy code and header link share same logic and needs asynchronous implementation.

@ShubhamOulkar
Copy link
Member Author

I have addressed all reviews. Please take a look.

it could move to the app.js file inside the jquery

jQuery is migrated to web APIs

Do note though, this will add these anchor links to h2, h3 on all pages of the site!

Yes, this will add anchor on all pages. Here are some issues that are affecting this PR #2055 (comment) and #2056. First is fixed here itself, #2056 needs to be fixed.

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.

2 participants