Skip to content

feat(doc-kit): bump version#29

Merged
avivkeller merged 2 commits intomainfrom
doc-kit-improvements
Apr 6, 2026
Merged

feat(doc-kit): bump version#29
avivkeller merged 2 commits intomainfrom
doc-kit-improvements

Conversation

@avivkeller
Copy link
Copy Markdown
Member

@avivkeller avivkeller commented Apr 4, 2026

Updates doc-kit to the latest version, adding support for:

  1. Custom canonical links (<link rel="canonical" href="https://nodejs.org/learn{path}" />) (cc @MattIPv4)
  2. Absolute URLs
  3. Navigation JSON

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-learn Ready Ready Preview Apr 6, 2026 2:40pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Learn site’s doc-kit setup to the latest version and shifts navigation/canonical behavior to be driven by a shared template and virtual JSON imports, aligning Learn with nodejs.org site navigation data.

Changes:

  • Bump @node-core/doc-kit to 1.3.2 and configure templatePath + canonical link rendering.
  • Introduce build-time virtualImports for #site/navigation.json (from nodejs.org) and #learn/navigation.json (derived from local navigation.json + page titles).
  • Refactor Sidebar/Nav/Footer components to consume the virtual navigation JSON instead of hardcoded/static local data.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
utils/index.mjs Adds helpers to derive sidebar groupings + i18n population used by virtual imports.
template.html New HTML template including canonical link and updated head tags.
package.json Bumps doc-kit devDependency to 1.3.2.
package-lock.json Lockfile update for doc-kit 1.3.2.
navigation.json Adds local Learn sidebar grouping source (paths per category).
doc-kit.config.mjs Configures template and adds virtualImports for site + learn navigation.
components/Sidebar/index.jsx Switches sidebar groups to #learn/navigation.json virtual import.
components/Navigation/index.jsx Switches top nav items to #site/navigation.json virtual import.
components/Footer/index.jsx Switches footer links/social links to #site/navigation.json virtual import.
components/Footer/footer.json Removes now-redundant local footer navigation JSON.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Left a few comments.

Copy link
Copy Markdown
Member

@MattIPv4 MattIPv4 left a comment

Choose a reason for hiding this comment

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

👀 https://nodejs-learn-git-doc-kit-improvements-openjs.vercel.app/learn/ has a canonical of <link rel="canonical" href="https://nodejs.org/learn/index">, that isn't right.

@avivkeller
Copy link
Copy Markdown
Member Author

Okay, I need to fix doc-kit to strip the /index, reverting that change. I'm also going to add a useAbsoluteURLs config to doc-kit which will resolve all of our relative URLs hacks.

In the meantime, fixed Vercel config for more relative URL issues

@avivkeller
Copy link
Copy Markdown
Member Author

See: nodejs/doc-kit#751

@avivkeller avivkeller changed the title feat(doc-kit): bump version, use virtualImports feat(doc-kit): bump version Apr 6, 2026
@avivkeller avivkeller added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit 345bd7f Apr 6, 2026
6 checks passed
@avivkeller avivkeller deleted the doc-kit-improvements branch April 6, 2026 14:45
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.

4 participants