Skip to content

chore(docs): fix base url paths#130

Merged
coryrylan merged 1 commit into
mainfrom
topic-base-path-fix
Jun 23, 2026
Merged

chore(docs): fix base url paths#130
coryrylan merged 1 commit into
mainfrom
topic-base-path-fix

Conversation

@coryrylan

@coryrylan coryrylan commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator
  • Changed internal links in documentation to use root-relative paths for consistency.
  • Added a new transform for site URLs to ensure correct linking in different environments.
  • Updated various files to reflect these changes, including configuration and layout files.
  • Added tests to verify that all internal links are correctly formatted.

Summary by CodeRabbit

  • Bug Fixes
    • Updated docs, navigation, and examples links to consistently use root-relative, absolute URLs so they resolve correctly from nested pages.
    • Improved site output consistency for sitemap URLs and llms.txt/context links, aligning with deployed/base URL behavior.
  • New Features
    • Added automatic rewriting of rendered HTML href/src (and module script URLs) to ensure links point to the correct site location.
  • Tests
    • Expanded coverage for URL rewriting, sitemap eligibility, metadata/SEO rules, llms.txt output, and internal-link pattern scanning.

@coryrylan coryrylan requested a review from jareddlc June 9, 2026 23:41
@coryrylan coryrylan self-assigned this Jun 9, 2026
@github-actions github-actions Bot added scope(core) scope(ci) scope(docs) dependencies Pull requests that update a dependency file labels Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR systematically normalizes internal site URLs by introducing centralized URL utilities exported from a new site-url.js module, wiring an HTML transform into Eleventy's build pipeline to automatically rewrite relative URLs in generated content, updating all code and documentation to use absolute root-relative paths, and adding comprehensive test validation to enforce the new URL convention.

Changes

Site URL Normalization Infrastructure and Implementation

Layer / File(s) Summary
Shared URL utilities and contracts
projects/site/src/_11ty/utils/site-url.js
New module exports BASE_URL, DEPLOYED_SITE_URL, ELEMENTS_SITE_ORIGIN, and utility functions including getSiteHref(), getSitePath(), and getSiteUrl(). These utilities normalize paths, handle base-path insertion/removal, and compute absolute or base-path-relative URLs depending on Eleventy's build vs. serve mode and preview configuration.
HTML URL rewriting transform and tests
projects/site/src/_11ty/transforms/site-urls.js, projects/site/src/_11ty/transforms/site-urls.test.ts
New transform siteUrlsTransform parses HTML output with parse5, walks the DOM to detect and rewrite same-site relative URLs using centralized utilities, and preserves external URLs, fragments, and template content. Comprehensive test suite validates build-mode qualification, serve-mode preservation, local preview handling, module source URLs, external schemes, and non-HTML output.
Eleventy configuration and plugin registration
projects/site/eleventy.config.js
Sets pathPrefix to BASE_URL early, registers HtmlBasePlugin with environment-dependent baseHref (build: ELEMENTS_SITE_ORIGIN, serve: /), registers the site-urls transform in the pipeline, removes prior dev-server redirect, and filters the componentDocs collection to require page.data.tag presence.
Metadata imports, build environment, and test expansion
projects/site/src/_11ty/layouts/metadata.js, projects/site/package.json, projects/site/src/_11ty/layouts/metadata.test.ts
Metadata module imports and re-exports URL constants instead of computing locally. Adds special handling for /docs/elements/ route (title, section, JSON-LD CollectionPage schema). Build configuration adds ELEMENTS_SITE_URL environment variable and expands Vitest test coverage to include layout/transform/shortcode/plugin modules. Extended metadata tests validate title/description quality for priority docs routes.
Plugin and template integration with URL utilities
projects/site/src/_11ty/plugins/llms-txt.js, projects/site/src/_11ty/plugins/sitemap-xml.js, projects/site/src/_11ty/transforms/anchor-generator.js, projects/site/src/_11ty/templates/api.js, projects/site/src/_11ty/shortcodes/index.js, projects/site/src/_11ty/plugins/llms-txt.test.ts, projects/site/src/_11ty/plugins/sitemap-xml.test.ts
Plugins and templates now use centralized URL utilities: llms-txt.js applies HTML transform to generated context pages and exports createLlmsTxtContent with optional base parameter, sitemap-xml.js uses getSiteUrl() for sitemap entries and exports isSitemapPageUrl() for eligibility filtering, anchor-generator.js uses getSiteHref() for heading anchors, and api.js/shortcodes update badge links and installation instructions to absolute paths. Test suites validate llms-txt content generation and sitemap URL eligibility.
Layout and navigation template link updates
projects/site/src/_11ty/layouts/common.js, projects/site/src/_11ty/layouts/page.11ty.js, projects/site/src/_11ty/layouts/docs.11ty.js
Sidebar navigation, header buttons, and documentation tabs updated to use absolute / and /docs/... paths instead of relative ., docs/..., or ./docs/... equivalents. Navigation highlighting and selection logic remains driven by page URL comparisons. Common layout now includes llms.txt alternate link in head.
Components catalog page and data
projects/site/src/docs/elements/index.11ty.js
New page that indexes all component documentation by matching siteData.elements entries to component docs by data.tag, partitions into Elements vs. library components, derives catalog card metadata (description, version, title), and renders an HTML grid display with component cards.
Documentation content link migration across all doc sections
projects/site/src/docs/... (80+ files), projects/core/src/tabs/tabs.examples.ts, projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
Updates markdown files and 11ty template pages across foundations, elements, integrations, patterns, metrics, and internal guidelines to use absolute /docs/..., /examples/..., and /starters/... paths. Includes component examples, metrics carousel hrefs, and site-wide documentation navigation.
Homepage and site-level navigation link updates
projects/site/src/index.md
Updates hero CTAs, resource buttons ("Install", "CLI", "MCP", "Cursor", "Codex", "Claude"), and framework integration button list (TypeScript through Nuxt) to use absolute /docs/... and /docs/integrations/... paths. Normalizes responsive grid attribute syntax from `@md
Link validation and test coverage expansion
projects/site/src/_11ty/layouts/links.test.ts
New Vitest test suite scans all authored content files for forbidden relative internal-link patterns (docs/..., examples/..., starters/... in both HTML href= and JS href: forms) and asserts none are present, enforcing the absolute-path convention.
Workspace cleanup and minor formatting updates
pnpm-workspace.yaml, projects/starters/nextjs/package.json, projects/site/src/docs/internal/guidelines/agent-harness.md, projects/site/src/docs/internal/guidelines/agent-ownership.md
Removes projects/snippets from workspace packages. Adds @types/node to nextjs starter and reorders dependencies. Updates SVG layout sizing in agent harness documentation to responsive style (viewBox with inline style and max-width) instead of fixed dimensions. Normalizes responsive layout attribute syntax from `@lg

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Suggested labels

scope(starters)

Suggested reviewers

  • jareddlc
  • johnyanarella
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(docs): fix base url paths' accurately summarizes the main change: updating documentation links to use root-relative paths for consistent base URL handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch topic-base-path-fix

Comment @coderabbitai help to get the list of available commands.

Comment thread projects/site/src/_11ty/transforms/site-urls.js Fixed
@coryrylan coryrylan requested a review from johnyanarella June 9, 2026 23:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
projects/site/src/_11ty/layouts/docs.11ty.js (1)

50-54: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider simplifying the baseTabUrl construction.

The baseTabUrl removes the leading / on line 51 (.replace('/', '')), then lines 91, 94, and 99 add it back (href="/${baseTabUrl}"). This could be simplified by keeping the leading / in baseTabUrl:

 const baseTabUrl = `${data.page.url
-  .replace('/', '')
   .replace('/api/', '/')
   .replace('/examples/', '/')
   .replace(/(.*\/data-grid\/).+/, '$1')}`;

Then use it directly:

-<a href="/${baseTabUrl}">Overview</a>
+<a href="${baseTabUrl}">Overview</a>

This would be clearer and avoid the remove-then-add pattern.

Also applies to: 91-99

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/docs.11ty.js` around lines 50 - 54, The code
builds baseTabUrl by stripping the leading '/' from data.page.url then later
prepends '/' again when creating hrefs; to simplify, stop removing the leading
slash: remove the initial .replace('/', '') from the baseTabUrl expression
(leave data.page.url as-is when applying the subsequent .replace('/api/', '/'),
.replace('/examples/', '/'), and .replace(/(.*\/data-grid\/).+/, '$1')), and
update all call sites that currently do href="/${baseTabUrl}" to use
href="${baseTabUrl}" (references: the baseTabUrl variable and the href usages
that add '/').
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/site/package.json`:
- Around line 204-211: The current package.json test task watches all source
files via the "files" array which causes tests defined in the "command" (e.g.,
metadata.test.ts, links.test.ts, site-urls.test.ts, api.test.ts) to re-run on
any src change; update the "files" array to only match test files (for example
restrict to patterns like src/**/*.{test,spec}.ts or src/**/*.test.ts and
include matching .js/.md if you have test variants) so that vitest only reruns
when test files change, leaving the "command" unchanged.

In `@projects/site/src/_11ty/layouts/links.test.ts`:
- Around line 6-9: The four regex constants RELATIVE_INTERNAL_LINK_PATTERN,
BASE_PREFIXED_INTERNAL_LINK_PATTERN, JS_RELATIVE_INTERNAL_LINK_PATTERN, and
JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN only account for "./" relative paths;
update each pattern to also match one or more "../" segments so "../docs/...",
"../examples/...", and "../starters/..." are caught too — modify the group that
currently matches (?:\.\/)? to allow sequences like (?:\.\.\/|\.\/)+ or a more
concise (?:\.\.\/)*\.\/? depending on desired strictness so both single and
multi-level parent traversals are rejected for both HTML and JS forms.

In `@projects/site/src/docs/metrics/testing-and-performance.11ty.js`:
- Around line 29-32: Remove the duplicate selected attribute from the wrong tab:
the first <nve-tabs-item> that links to "/docs/metrics/" currently has selected
but the page's correct active tab is the <nve-tabs-item> for "Testing &
Performance" (the one linking to "/docs/metrics/testing-and-performance/");
remove the selected attribute from the Metrics tab so only the Testing &
Performance <nve-tabs-item> remains selected to prevent conflicting active-state
behavior.

In `@projects/site/src/docs/metrics/wireit.11ty.js`:
- Line 59: Duplicate selected attribute: remove the extra selected on the
Metrics tab so only the Wireit Explorer tab remains selected. Locate the
<nve-tabs-item> element that renders the "Metrics" tab (the tag containing "<a
href=\"/docs/metrics/\">Metrics</a>") and delete the selected attribute from
that element, leaving the selected attribute only on the "Wireit Explorer"
<nve-tabs-item>.

---

Outside diff comments:
In `@projects/site/src/_11ty/layouts/docs.11ty.js`:
- Around line 50-54: The code builds baseTabUrl by stripping the leading '/'
from data.page.url then later prepends '/' again when creating hrefs; to
simplify, stop removing the leading slash: remove the initial .replace('/', '')
from the baseTabUrl expression (leave data.page.url as-is when applying the
subsequent .replace('/api/', '/'), .replace('/examples/', '/'), and
.replace(/(.*\/data-grid\/).+/, '$1')), and update all call sites that currently
do href="/${baseTabUrl}" to use href="${baseTabUrl}" (references: the baseTabUrl
variable and the href usages that add '/').
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ce99f9ec-a08b-4139-a9d2-571dfc979998

📥 Commits

Reviewing files that changed from the base of the PR and between 686ff96 and da90867.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (69)
  • projects/core/src/tabs/tabs.examples.ts
  • projects/site/eleventy.config.js
  • projects/site/package.json
  • projects/site/src/_11ty/layouts/common.js
  • projects/site/src/_11ty/layouts/docs.11ty.js
  • projects/site/src/_11ty/layouts/links.test.ts
  • projects/site/src/_11ty/layouts/metadata.js
  • projects/site/src/_11ty/layouts/page.11ty.js
  • projects/site/src/_11ty/plugins/llms-txt.js
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/shortcodes/index.js
  • projects/site/src/_11ty/templates/api.js
  • projects/site/src/_11ty/transforms/anchor-generator.js
  • projects/site/src/_11ty/transforms/site-urls.js
  • projects/site/src/_11ty/transforms/site-urls.test.ts
  • projects/site/src/_11ty/utils/site-url.js
  • projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
  • projects/site/src/docs/about/contributions.md
  • projects/site/src/docs/about/migration.md
  • projects/site/src/docs/about/support.md
  • projects/site/src/docs/api-design/logs.md
  • projects/site/src/docs/api-design/packaging.md
  • projects/site/src/docs/changelog/changelog.11ty.js
  • projects/site/src/docs/changelog/index.11ty.js
  • projects/site/src/docs/elements/dialog.md
  • projects/site/src/docs/elements/drawer.md
  • projects/site/src/docs/elements/dropdown.md
  • projects/site/src/docs/elements/forms/index.md
  • projects/site/src/docs/elements/icon.md
  • projects/site/src/docs/elements/notification.md
  • projects/site/src/docs/elements/page.md
  • projects/site/src/docs/elements/toast.md
  • projects/site/src/docs/elements/toggletip.md
  • projects/site/src/docs/elements/tooltip.md
  • projects/site/src/docs/foundations/iconography.md
  • projects/site/src/docs/foundations/index.md
  • projects/site/src/docs/foundations/layout/grid.md
  • projects/site/src/docs/foundations/layout/horizontal.md
  • projects/site/src/docs/foundations/layout/index.md
  • projects/site/src/docs/foundations/layout/responsive/container.md
  • projects/site/src/docs/foundations/layout/responsive/index.md
  • projects/site/src/docs/foundations/layout/responsive/viewport.md
  • projects/site/src/docs/foundations/layout/vertical.md
  • projects/site/src/docs/foundations/popovers.md
  • projects/site/src/docs/foundations/themes/index.11ty.js
  • projects/site/src/docs/foundations/typography.md
  • projects/site/src/docs/foundations/view-transitions.md
  • projects/site/src/docs/integrations/angular.md
  • projects/site/src/docs/integrations/index.11ty.js
  • projects/site/src/docs/integrations/lit.md
  • projects/site/src/docs/integrations/mcp-apps.md
  • projects/site/src/docs/integrations/shortcodes.js
  • projects/site/src/docs/internal/guidelines/component-creation.md
  • projects/site/src/docs/internal/guidelines/testing.md
  • projects/site/src/docs/metrics/api-status.11ty.js
  • projects/site/src/docs/metrics/bundle-explorer.11ty.js
  • projects/site/src/docs/metrics/index.11ty.js
  • projects/site/src/docs/metrics/metadata.11ty.js
  • projects/site/src/docs/metrics/testing-and-performance.11ty.js
  • projects/site/src/docs/metrics/wireit.11ty.js
  • projects/site/src/docs/monaco/diff-editor.md
  • projects/site/src/docs/monaco/editor.md
  • projects/site/src/docs/patterns/editor.md
  • projects/site/src/docs/patterns/index.md
  • projects/site/src/docs/patterns/panel.md
  • projects/site/src/docs/skills/index.md
  • projects/site/src/examples/examples.11ty.js
  • projects/site/src/examples/index.11ty.js
  • projects/site/src/index.md

Comment thread projects/site/package.json Outdated
Comment on lines 204 to 211
"command": "vitest run src/_11ty/layouts/metadata.test.ts src/_11ty/layouts/links.test.ts src/_11ty/transforms/site-urls.test.ts src/_11ty/shortcodes/api.test.ts",
"files": [
"src/docs/**/*.md",
"src/_11ty/layouts/common.js",
"src/_11ty/layouts/metadata.js",
"src/_11ty/layouts/metadata.test.ts",
"src/_11ty/shortcodes/api.js",
"src/_11ty/shortcodes/api.test.ts",
"src/**/*.js",
"src/**/*.md",
"src/**/*.ts",
"vitest.config.ts"
],
"output": []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Consider narrowing the test watch patterns to test files only.

The files array now watches all source files (src/**/*.js, src/**/*.md, src/**/*.ts) rather than just test files. This means tests will re-run whenever any source file changes, not just when test files change. While this ensures tests stay fresh, it may cause unnecessary test runs during development.

If tests should only re-run when test files change, consider:

 "files": [
-  "src/**/*.js",
-  "src/**/*.md",
-  "src/**/*.ts",
+  "src/**/*.test.ts",
+  "src/**/*.test.js",
   "vitest.config.ts"
 ],

Otherwise, if the current behavior is intentional (to ensure tests run on any source change), this is fine.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"command": "vitest run src/_11ty/layouts/metadata.test.ts src/_11ty/layouts/links.test.ts src/_11ty/transforms/site-urls.test.ts src/_11ty/shortcodes/api.test.ts",
"files": [
"src/docs/**/*.md",
"src/_11ty/layouts/common.js",
"src/_11ty/layouts/metadata.js",
"src/_11ty/layouts/metadata.test.ts",
"src/_11ty/shortcodes/api.js",
"src/_11ty/shortcodes/api.test.ts",
"src/**/*.js",
"src/**/*.md",
"src/**/*.ts",
"vitest.config.ts"
],
"output": []
"command": "vitest run src/_11ty/layouts/metadata.test.ts src/_11ty/layouts/links.test.ts src/_11ty/transforms/site-urls.test.ts src/_11ty/shortcodes/api.test.ts",
"files": [
"src/**/*.test.ts",
"src/**/*.test.js",
"vitest.config.ts"
],
"output": []
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/package.json` around lines 204 - 211, The current package.json
test task watches all source files via the "files" array which causes tests
defined in the "command" (e.g., metadata.test.ts, links.test.ts,
site-urls.test.ts, api.test.ts) to re-run on any src change; update the "files"
array to only match test files (for example restrict to patterns like
src/**/*.{test,spec}.ts or src/**/*.test.ts and include matching .js/.md if you
have test variants) so that vitest only reruns when test files change, leaving
the "command" unchanged.

Comment on lines +6 to +9
const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:\.\/)?(?:docs|examples|starters)\//;
const BASE_PREFIXED_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()\/elements\/(?:docs|examples|starters)\//;
const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:\.\/)?(?:docs|examples|starters)\//;
const JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN = /\bhref:\s*['"]\/elements\/(?:docs|examples|starters)\//;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Expand invalid-link regexes to catch ../ relative paths.

Line 6 and Line 8 only reject ./... relative links. ../docs/..., ../examples/..., and ../starters/... are still relative and currently bypass this test.

Suggested patch
-const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:\.\/)?(?:docs|examples|starters)\//;
+const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
 ...
-const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:\.\/)?(?:docs|examples|starters)\//;
+const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;

As per coding guidelines, “**/*.test.ts: Follow unit testing patterns ... including ... patterns” and this test should fully enforce the intended invalid-link patterns.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:\.\/)?(?:docs|examples|starters)\//;
const BASE_PREFIXED_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()\/elements\/(?:docs|examples|starters)\//;
const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:\.\/)?(?:docs|examples|starters)\//;
const JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN = /\bhref:\s*['"]\/elements\/(?:docs|examples|starters)\//;
const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
const BASE_PREFIXED_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()\/elements\/(?:docs|examples|starters)\//;
const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
const JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN = /\bhref:\s*['"]\/elements\/(?:docs|examples|starters)\//;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/links.test.ts` around lines 6 - 9, The four
regex constants RELATIVE_INTERNAL_LINK_PATTERN,
BASE_PREFIXED_INTERNAL_LINK_PATTERN, JS_RELATIVE_INTERNAL_LINK_PATTERN, and
JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN only account for "./" relative paths;
update each pattern to also match one or more "../" segments so "../docs/...",
"../examples/...", and "../starters/..." are caught too — modify the group that
currently matches (?:\.\/)? to allow sequences like (?:\.\.\/|\.\/)+ or a more
concise (?:\.\.\/)*\.\/? depending on desired strictness so both single and
multi-level parent traversals are rejected for both HTML and JS forms.

Source: Coding guidelines

Comment thread projects/site/src/docs/metrics/testing-and-performance.11ty.js Outdated
Comment thread projects/site/src/docs/metrics/wireit.11ty.js Outdated
@coryrylan coryrylan force-pushed the topic-base-path-fix branch from da90867 to 1339f0f Compare June 22, 2026 16:36
Comment thread projects/site/src/_11ty/transforms/site-urls.js Fixed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (1)
projects/site/src/docs/metrics/testing-and-performance.11ty.js (1)

29-34: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Duplicate selected attribute remains unresolved from prior review.

This issue was already flagged in a previous review comment on this file: two <nve-tabs-item> elements (lines 29 and 31) are both marked selected. Only the current page's tab (line 31, "Testing & Performance") should have the selected attribute. Remove the selected attribute from line 29 (Metrics tab).

The URL path updates from relative to absolute root-relative are correct and properly applied.

Proposed fix
-    <nve-tabs-item selected><a href="/docs/metrics/">Metrics</a></nve-tabs-item>
+    <nve-tabs-item><a href="/docs/metrics/">Metrics</a></nve-tabs-item>
       <nve-tabs-item><a href="/docs/metrics/api-status/">API Status</a></nve-tabs-item>
       <nve-tabs-item selected><a href="/docs/metrics/testing-and-performance/">Testing &amp; Performance</a></nve-tabs-item>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/metrics/testing-and-performance.11ty.js` around lines
29 - 34, The first nve-tabs-item element with href="/docs/metrics/" has a
duplicate selected attribute that should not be there. Remove the selected
attribute from the first nve-tabs-item element (Metrics tab) so that only the
third nve-tabs-item element with href="/docs/metrics/testing-and-performance/"
(Testing & Performance tab) retains the selected attribute, ensuring only the
current page's tab is marked as selected.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/site/src/_11ty/layouts/common.js`:
- Around line 132-396: In the renderDocsNav function, there are two issues to
fix. First, remove the dead code pattern in the first nve-tree-node where the
expanded attribute checks include a redundant `/./` pattern that never occurs
naturally in URLs. The check `data.page.url.includes('/./') || data.page.url ===
'/'` should be simplified to just `data.page.url === '/'` since the OR condition
with the root path already handles all necessary cases. Second, fix the path
inconsistency in the final nve-tree-node for the Internal Examples section where
the URL checks use `'examples/'` without a leading slash, but the href attribute
uses `'/examples/'` with a leading slash. Update all the URL check patterns in
this section to use `'/examples/'` with a leading slash to be consistent with
how all other navigation sections check their paths (e.g.,
`includes('/docs/...')`).

In `@projects/site/src/_11ty/transforms/site-urls.test.ts`:
- Around line 94-121: The test cases for siteUrlsTransform in the test file
currently only cover module scripts with type="module" attributes, leaving
non-module script URL rewriting behavior untested. Add test assertions within
one or both of the existing test cases (the production output test and the local
preview test) that verify the expected behavior when a regular non-module script
tag with a src attribute is processed by siteUrlsTransform. Include an assertion
that confirms the URL transformation for a non-module script follows the same
transformation rules as the other assets being tested.

In `@projects/site/src/docs/about/support.md`:
- Line 31: The Lit button on line 31 has a closing `</a>` tag without a
corresponding opening `<a>` tag, breaking the link functionality. Add an opening
`<a>` tag with href="/docs/integrations/lit/" before the svg-logo template tag
in the Lit button element to properly pair with the existing closing `</a>` tag
and match the structure of the other framework buttons (TypeScript, Angular,
Vue, Preact) which all have properly formed anchor links.

In `@projects/site/src/docs/foundations/layout/index.md`:
- Around line 102-104: The anchor reference in the link pointing to
`/docs/api-design/styles/#internal-host` is incorrect because the actual heading
in the styles documentation is `## **_REMOVED_** Host`, not `## Internal Host`.
Update the anchor portion of this link to match the actual heading structure in
the styles documentation so it resolves correctly. Verify what the actual anchor
should be based on the current heading in that document and correct the
reference accordingly.

In `@projects/site/src/docs/foundations/popovers.md`:
- Line 15: Fix the hyphenation in two compound adjectives in the popovers.md
documentation. In the tooltip link description, change "contextual text only
hints" to "contextual text-only hints" by adding a hyphen between "text" and
"only". Additionally, in the notification-related text, change "async non
contextual notification" to "async non-contextual notification" by adding a
hyphen between "non" and "contextual". These hyphens are necessary because the
adjectives modify the nouns that follow them as compound modifiers.

In `@projects/site/src/docs/internal/guidelines/testing.md`:
- Line 44: All the markdown links in the test type list (lines 41-45) are using
incorrect paths pointing to `/docs/internal/testing/*/` which doesn't exist.
Update all five links to use the correct path structure
`/docs/internal/guidelines/testing-*/` instead. Specifically, ensure line 44
updates the Visual Regression Tests link from `/docs/internal/testing/ssr/` to
`/docs/internal/guidelines/testing-visual/`, and apply similar corrections to
the other test type links on lines 41, 42, 43, and 45 by replacing the
`/docs/internal/testing/` portion with `/docs/internal/guidelines/testing-` in
each link.

---

Duplicate comments:
In `@projects/site/src/docs/metrics/testing-and-performance.11ty.js`:
- Around line 29-34: The first nve-tabs-item element with href="/docs/metrics/"
has a duplicate selected attribute that should not be there. Remove the selected
attribute from the first nve-tabs-item element (Metrics tab) so that only the
third nve-tabs-item element with href="/docs/metrics/testing-and-performance/"
(Testing & Performance tab) retains the selected attribute, ensuring only the
current page's tab is marked as selected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 457a32c4-6b74-4aa0-9cd2-6c2b9f78ef7d

📥 Commits

Reviewing files that changed from the base of the PR and between da90867 and 1339f0f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (69)
  • projects/core/src/tabs/tabs.examples.ts
  • projects/site/eleventy.config.js
  • projects/site/package.json
  • projects/site/src/_11ty/layouts/common.js
  • projects/site/src/_11ty/layouts/docs.11ty.js
  • projects/site/src/_11ty/layouts/links.test.ts
  • projects/site/src/_11ty/layouts/metadata.js
  • projects/site/src/_11ty/layouts/page.11ty.js
  • projects/site/src/_11ty/plugins/llms-txt.js
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/shortcodes/index.js
  • projects/site/src/_11ty/templates/api.js
  • projects/site/src/_11ty/transforms/anchor-generator.js
  • projects/site/src/_11ty/transforms/site-urls.js
  • projects/site/src/_11ty/transforms/site-urls.test.ts
  • projects/site/src/_11ty/utils/site-url.js
  • projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
  • projects/site/src/docs/about/contributions.md
  • projects/site/src/docs/about/migration.md
  • projects/site/src/docs/about/support.md
  • projects/site/src/docs/api-design/logs.md
  • projects/site/src/docs/api-design/packaging.md
  • projects/site/src/docs/changelog/changelog.11ty.js
  • projects/site/src/docs/changelog/index.11ty.js
  • projects/site/src/docs/elements/dialog.md
  • projects/site/src/docs/elements/drawer.md
  • projects/site/src/docs/elements/dropdown.md
  • projects/site/src/docs/elements/forms/index.md
  • projects/site/src/docs/elements/icon.md
  • projects/site/src/docs/elements/notification.md
  • projects/site/src/docs/elements/page.md
  • projects/site/src/docs/elements/toast.md
  • projects/site/src/docs/elements/toggletip.md
  • projects/site/src/docs/elements/tooltip.md
  • projects/site/src/docs/foundations/iconography.md
  • projects/site/src/docs/foundations/index.md
  • projects/site/src/docs/foundations/layout/grid.md
  • projects/site/src/docs/foundations/layout/horizontal.md
  • projects/site/src/docs/foundations/layout/index.md
  • projects/site/src/docs/foundations/layout/responsive/container.md
  • projects/site/src/docs/foundations/layout/responsive/index.md
  • projects/site/src/docs/foundations/layout/responsive/viewport.md
  • projects/site/src/docs/foundations/layout/vertical.md
  • projects/site/src/docs/foundations/popovers.md
  • projects/site/src/docs/foundations/themes/index.11ty.js
  • projects/site/src/docs/foundations/typography.md
  • projects/site/src/docs/foundations/view-transitions.md
  • projects/site/src/docs/integrations/angular.md
  • projects/site/src/docs/integrations/index.11ty.js
  • projects/site/src/docs/integrations/lit.md
  • projects/site/src/docs/integrations/mcp-apps.md
  • projects/site/src/docs/integrations/shortcodes.js
  • projects/site/src/docs/internal/guidelines/component-creation.md
  • projects/site/src/docs/internal/guidelines/testing.md
  • projects/site/src/docs/metrics/api-status.11ty.js
  • projects/site/src/docs/metrics/bundle-explorer.11ty.js
  • projects/site/src/docs/metrics/index.11ty.js
  • projects/site/src/docs/metrics/metadata.11ty.js
  • projects/site/src/docs/metrics/testing-and-performance.11ty.js
  • projects/site/src/docs/metrics/wireit.11ty.js
  • projects/site/src/docs/monaco/diff-editor.md
  • projects/site/src/docs/monaco/editor.md
  • projects/site/src/docs/patterns/editor.md
  • projects/site/src/docs/patterns/index.md
  • projects/site/src/docs/patterns/panel.md
  • projects/site/src/docs/skills/index.md
  • projects/site/src/examples/examples.11ty.js
  • projects/site/src/examples/index.11ty.js
  • projects/site/src/index.md

Comment thread projects/site/src/_11ty/layouts/common.js Outdated
Comment on lines +94 to +121
it('should preserve source module urls when building production output', async () => {
const { siteUrlsTransform } = await importTransform('build');
const html = `
<script type="module" src="https://nvidia.github.io/elements/404/index.ts"></script>
<img src="/static/images/integrations/angular.svg" alt="Angular logo">
`;

const result = await siteUrlsTransform.call(createContext(), html, 'index.html');

expect(result).toContain('src="/404/index.ts"');
expect(result).toContain('src="https://nvidia.github.io/elements/static/images/integrations/angular.svg"');
});

it('should preserve source module urls when building for local preview', async () => {
const { siteUrlsTransform } = await importTransform('build', {
localPreview: true,
pagesBaseUrl: '/elements/preview/'
});
const html = `
<script type="module" src="https://nvidia.github.io/elements/preview/404/index.ts"></script>
<img src="/static/images/integrations/angular.svg" alt="Angular logo">
`;

const result = await siteUrlsTransform.call(createContext(), html, 'index.html');

expect(result).toContain('src="/404/index.ts"');
expect(result).toContain('src="/elements/preview/static/images/integrations/angular.svg"');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add an explicit non-module <script src> case.

Current assertions cover module scripts only. Add one non-module script test to lock expected behavior around script URL rewriting.

Suggested test addition
   it('should preserve source module urls when building for local preview', async () => {
@@
     expect(result).toContain('src="/404/index.ts"');
     expect(result).toContain('src="/elements/preview/static/images/integrations/angular.svg"');
   });
+
+  it('should define behavior for non-module script src urls', async () => {
+    const { siteUrlsTransform } = await importTransform('build');
+    const html = '<script src="/docs/runtime.js"></script>';
+    const result = await siteUrlsTransform.call(createContext(), html, 'index.html');
+    expect(result).toContain('<script src="/docs/runtime.js"></script>');
+  });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/transforms/site-urls.test.ts` around lines 94 - 121,
The test cases for siteUrlsTransform in the test file currently only cover
module scripts with type="module" attributes, leaving non-module script URL
rewriting behavior untested. Add test assertions within one or both of the
existing test cases (the production output test and the local preview test) that
verify the expected behavior when a regular non-module script tag with a src
attribute is processed by siteUrlsTransform. Include an assertion that confirms
the URL transformation for a non-module script follows the same transformation
rules as the other assets being tested.

Comment thread projects/site/src/docs/about/support.md Outdated
Comment thread projects/site/src/docs/foundations/layout/index.md Outdated
- [toast](./docs/elements/toast/): contextual notification
- [notification](./docs/elements/notification/): async non contextual notification
- [drawer](./docs/elements/drawer/): interactive navigation or extra contextual content
- [tooltip](/docs/elements/tooltip/): contextual text only hints

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix hyphenation in compound adjectives.

Two lines contain compound adjectives that should be hyphenated:

  • Line 15: "contextual text only hints" → "contextual text-only hints"
  • Line 20: "async non contextual notification" → "async non-contextual notification"

When adjectives modify nouns, they should be hyphenated for clarity.

Grammar fixes
- [tooltip](/docs/elements/tooltip/): contextual text only hints
+ [tooltip](/docs/elements/tooltip/): contextual text-only hints

- [notification](/docs/elements/notification/): async non contextual notification
+ [notification](/docs/elements/notification/): async non-contextual notification

Also applies to: 20-20

🧰 Tools
🪛 LanguageTool

[grammar] ~15-~15: Use a hyphen to join words.
Context: ...docs/elements/tooltip/): contextual text only hints - [toggletip](/docs/elements/...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/foundations/popovers.md` at line 15, Fix the
hyphenation in two compound adjectives in the popovers.md documentation. In the
tooltip link description, change "contextual text only hints" to "contextual
text-only hints" by adding a hyphen between "text" and "only". Additionally, in
the notification-related text, change "async non contextual notification" to
"async non-contextual notification" by adding a hyphen between "non" and
"contextual". These hyphens are necessary because the adjectives modify the
nouns that follow them as compound modifiers.

Source: Linters/SAST tools

Comment thread projects/site/src/docs/internal/guidelines/testing.md Outdated
@coryrylan coryrylan force-pushed the topic-base-path-fix branch from 1339f0f to b908544 Compare June 23, 2026 15:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
projects/site/src/docs/metrics/bundle-explorer.11ty.js (1)

26-26: 🎯 Functional Correctness | 🟡 Minor

Normalize iframe src to absolute path for consistency with navigation updates.

The navigation anchors on lines 17–22 use absolute paths (/docs/metrics/...), but the iframe src on line 26 remains relative (docs/metrics/bundle-explorer-report/). Given the PR's path normalization strategy, update the iframe path to /docs/metrics/bundle-explorer-report/ for consistency.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/metrics/bundle-explorer.11ty.js` at line 26, The
iframe element with id="bundle" uses a relative path in its src attribute
("docs/metrics/bundle-explorer-report/") while the navigation anchors use
absolute paths ("/docs/metrics/..."). Update the iframe's src attribute to use
the absolute path "/docs/metrics/bundle-explorer-report/" instead of the
relative path to maintain consistency with the navigation path normalization
strategy used in the rest of the file.
♻️ Duplicate comments (5)
projects/site/src/_11ty/layouts/common.js (1)

138-138: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove dead root matcher and normalize examples path checks.

Line 138 has dead logic (includes('/./')) and Lines 396-398 use examples/ predicates without a leading slash, which can miss matching /examples/ for nav expanded/selected state.

Suggested patch
-    <nve-tree-node ${data.page.url.includes('/./') || data.page.url === '/' ? 'highlighted selected' : ''}><a href="/">Getting Started</a></nve-tree-node>
+    <nve-tree-node ${data.page.url === '/' ? 'highlighted selected' : ''}><a href="/">Getting Started</a></nve-tree-node>
...
-  <nve-tree-node ${data.page.url.includes('examples/') ? 'expanded' : ''} ${data.page.url === 'examples/' ? 'highlighted' : ''}>
+  <nve-tree-node ${data.page.url.includes('/examples/') ? 'expanded' : ''} ${data.page.url === '/examples/' ? 'highlighted' : ''}>
     <a href="/examples/">Internal Examples</a>
-    <nve-tree-node ${data.page.url.includes('examples/') ? 'highlighted selected' : ''}><a href="/examples/">All Examples</a></nve-tree-node>
+    <nve-tree-node ${data.page.url.includes('/examples/') ? 'highlighted selected' : ''}><a href="/examples/">All Examples</a></nve-tree-node>
   </nve-tree-node>

Also applies to: 396-398

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/common.js` at line 138, Remove the dead logic
`includes('/./')` from the nve-tree-node condition on line 138 in the common.js
file, as this pattern will never match valid URLs. Additionally, update the path
predicates at lines 396-398 to include leading slashes when checking for
`examples/` paths, changing them from `examples/` to `/examples/` to ensure the
navigation expanded and selected states are properly matched for paths under the
examples directory.
projects/site/src/_11ty/layouts/links.test.ts (1)

6-9: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Expand relative-link regexes to also reject ../ paths.

Line 6 and Line 8 currently catch only ./-style links, so ../docs/... and similar paths bypass this test.

Suggested patch
-const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:\.\/)?(?:docs|examples|starters)\//;
+const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
...
-const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:\.\/)?(?:docs|examples|starters)\//;
+const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;

As per coding guidelines, "**/*.test.ts: Follow unit testing patterns ... including ... patterns" and this guard should fully enforce invalid internal-link patterns.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/links.test.ts` around lines 6 - 9, The regex
patterns RELATIVE_INTERNAL_LINK_PATTERN and JS_RELATIVE_INTERNAL_LINK_PATTERN
currently only match optional `./` paths using `(?:\.\/)?` but fail to catch
parent directory `../` paths. Update both patterns to expand the relative path
matching group to include both `./` and `../` patterns, ensuring all relative
path variants that bypass the internal link validation are properly rejected.

Source: Coding guidelines

projects/site/src/docs/about/support.md (1)

31-31: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

** Unresolved: Missing opening <a> tag on Lit button.**

This issue was flagged in a prior review but remains unfixed. Line 31 has a closing </a> tag without a corresponding opening <a href="..."> tag, which breaks HTML structure and removes link functionality. All other framework buttons (TypeScript, Angular, Vue, Preact, NextJS, React, SolidJS, JavaScript) have properly paired anchor tags.

Add the opening anchor tag with href to /docs/integrations/lit/ to match the other framework button patterns.

🔧 Proposed fix
   <nve-button>
-    {% svg-logo 'lit' '20' %} Lit</a>
+    <a href="/docs/integrations/lit/">{% svg-logo 'lit' '20' %} Lit</a>
   </nve-button>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/about/support.md` at line 31, The Lit button on line
31 of the support.md file is missing its opening anchor tag. Add an opening
`<a>` tag with the href attribute pointing to `/docs/integrations/lit/` before
the SVG logo element (before the svg-logo 'lit' reference) to properly pair with
the existing closing `</a>` tag, matching the structure of the other framework
buttons like TypeScript, Angular, Vue, Preact, NextJS, React, SolidJS, and
JavaScript.
projects/site/src/docs/foundations/layout/index.md (1)

102-104: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Verify or fix the broken anchor reference from the prior review.

This comment duplicates a finding from a previous review: the link /docs/api-design/styles/#internal-host is broken because the styles documentation does not define an #internal-host anchor. The actual heading in that document uses a different format.

The PR converted the link to root-relative form (which is correct), but the underlying anchor reference issue was not resolved. Either correct the anchor to match the actual heading in the styles documentation, or change the link destination to reference a page that documents the internal-host pattern correctly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/foundations/layout/index.md` around lines 102 - 104,
The anchor reference in the link `/docs/api-design/styles/#internal-host` is
broken because the styles documentation does not contain a matching anchor with
that exact name. Locate the correct anchor name for the internal-host pattern in
the styles documentation file by checking the actual heading format used there,
and update the link in the layout documentation to match the correct anchor.
Alternatively, if the internal-host pattern is not documented in the styles
file, identify the correct page that documents this pattern and update the link
destination accordingly.
projects/site/src/_11ty/transforms/site-urls.test.ts (1)

94-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add test coverage for non-module script src attributes.

The current test cases only verify module script behavior (type="module"). Consider adding a test case for regular <script src> tags without the type="module" attribute to confirm they follow the standard URL transformation rules.

Suggested test addition
   it('should preserve source module urls when building for local preview', async () => {
     // ... existing test
   });
+
+  it('should transform non-module script src urls consistently', async () => {
+    const { siteUrlsTransform } = await importTransform('build');
+    const html = '<script src="/docs/runtime.js"></script>';
+    const result = await siteUrlsTransform.call(createContext(), html, 'index.html');
+    expect(result).toContain('<script src="https://nvidia.github.io/elements/docs/runtime.js"></script>');
+  });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/transforms/site-urls.test.ts` around lines 94 - 121,
The test cases for siteUrlsTransform only verify module script behavior with
type="module" attributes but lack coverage for regular script tags without the
module type. Add new test cases that include regular <script src> tags (without
type="module") in the HTML input for both the production build test and the
local preview test, and verify that these regular script src attributes are
transformed correctly according to the standard URL transformation rules,
similar to how img src attributes are currently being tested.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/src/tabs/tabs.examples.ts`:
- Around line 148-154: The `@summary` documentation for this tabs example in
projects/core/src/tabs/tabs.examples.ts is inaccurate—it claims to demonstrate
routing-based tab switching and page navigation, but the code only uses
hash-only anchors (href="`#links`") which enable same-page fragment scrolling, not
routing or page navigation. Update the `@summary` tag that precedes this example
to correctly state "Tabs with hash-only anchor links for same-page navigation
and fragment scrolling within a single page" to accurately reflect the actual
functionality and prevent users from misapplying this pattern.

In `@projects/site/eleventy.config.js`:
- Around line 227-236: The `.filter(page => page.data.tag)` condition in the
componentDocs collection is filtering out all component documentation pages
since none of the files in the src/docs directories have a tag property in their
frontmatter, resulting in an empty collection that breaks API documentation
generation. Either remove the entire .filter(page => page.data.tag) filter from
the chain after getFilteredByGlob to restore all documentation files to the
collection, or systematically add a tag property to the frontmatter of all
component documentation files across the src/docs/elements/, src/docs/code/,
src/docs/monaco/, and src/docs/markdown/ directories.

In `@projects/site/src/_11ty/plugins/llms-txt.js`:
- Around line 52-69: In the createLlmsTxtContent function, the MCP entry on the
line containing [MCP] is incorrectly pointing to the CLI documentation path
instead of a dedicated MCP context file. Fix this by changing the link target
from `${base}/context/cli.md` to `${base}/context/mcp.md` to ensure the MCP
entry links to its own documentation. Alternatively, if a separate MCP
documentation file does not exist or is not planned, remove the separate MCP
entry line entirely and integrate MCP information as part of the CLI entry
description instead.

In `@projects/site/src/_11ty/transforms/site-urls.js`:
- Line 48: The URL.canParse method used in the site-urls.js file requires
Node.js 19.0.0+ but this minimum version requirement is not enforced in the
project. Either add an engines field to package.json specifying node version
19.0.0 or higher, or implement a fallback/polyfill that checks the Node.js
version and provides an alternative method to validate URLs for versions below
19.0.0 when calling URL.canParse.

In `@projects/site/src/docs/elements/index.11ty.js`:
- Around line 29-30: The docsByTag Map is overwriting multiple components that
share the same tag, keeping only the last one and making href/title selection
order-dependent. Instead of mapping each tag to a single component, modify the
Map creation to store an array of components for each tag. For each component in
the filter/map operation, check if the tag already exists in the docsByTag Map -
if it does, push the component to the existing array; if not, create a new array
with the component. Then update all references to docsByTag throughout the file
(including the logic around lines 34-43) to iterate over the component arrays
instead of expecting a single component per tag.
- Line 71: The createComponentCatalog function call on line 71 accesses
data.collections.componentDocs without validating that it exists or is defined.
Add a defensive check by using the nullish coalescing operator to provide an
empty array as a safe default fallback, ensuring the code is robust even if the
componentDocs collection is undefined or missing. Update the call to
createComponentCatalog to pass data.collections.componentDocs with the null
coalescing operator and an empty array as the fallback value.

In `@projects/site/src/docs/internal/guidelines/testing.md`:
- Around line 41-45: The Visual Regression Tests entry in the testing guidelines
list has an incorrect link destination. Locate the line that defines Visual
Regression Tests (`.test.visual.ts`) and change its link from
`/docs/internal/testing/ssr/` to `/docs/internal/testing/visual/` to correctly
point to the visual testing documentation. This will prevent the duplication
where both Visual Regression Tests and SSR Tests link to the same
`/docs/internal/testing/ssr/` path.

---

Outside diff comments:
In `@projects/site/src/docs/metrics/bundle-explorer.11ty.js`:
- Line 26: The iframe element with id="bundle" uses a relative path in its src
attribute ("docs/metrics/bundle-explorer-report/") while the navigation anchors
use absolute paths ("/docs/metrics/..."). Update the iframe's src attribute to
use the absolute path "/docs/metrics/bundle-explorer-report/" instead of the
relative path to maintain consistency with the navigation path normalization
strategy used in the rest of the file.

---

Duplicate comments:
In `@projects/site/src/_11ty/layouts/common.js`:
- Line 138: Remove the dead logic `includes('/./')` from the nve-tree-node
condition on line 138 in the common.js file, as this pattern will never match
valid URLs. Additionally, update the path predicates at lines 396-398 to include
leading slashes when checking for `examples/` paths, changing them from
`examples/` to `/examples/` to ensure the navigation expanded and selected
states are properly matched for paths under the examples directory.

In `@projects/site/src/_11ty/layouts/links.test.ts`:
- Around line 6-9: The regex patterns RELATIVE_INTERNAL_LINK_PATTERN and
JS_RELATIVE_INTERNAL_LINK_PATTERN currently only match optional `./` paths using
`(?:\.\/)?` but fail to catch parent directory `../` paths. Update both patterns
to expand the relative path matching group to include both `./` and `../`
patterns, ensuring all relative path variants that bypass the internal link
validation are properly rejected.

In `@projects/site/src/_11ty/transforms/site-urls.test.ts`:
- Around line 94-121: The test cases for siteUrlsTransform only verify module
script behavior with type="module" attributes but lack coverage for regular
script tags without the module type. Add new test cases that include regular
<script src> tags (without type="module") in the HTML input for both the
production build test and the local preview test, and verify that these regular
script src attributes are transformed correctly according to the standard URL
transformation rules, similar to how img src attributes are currently being
tested.

In `@projects/site/src/docs/about/support.md`:
- Line 31: The Lit button on line 31 of the support.md file is missing its
opening anchor tag. Add an opening `<a>` tag with the href attribute pointing to
`/docs/integrations/lit/` before the SVG logo element (before the svg-logo 'lit'
reference) to properly pair with the existing closing `</a>` tag, matching the
structure of the other framework buttons like TypeScript, Angular, Vue, Preact,
NextJS, React, SolidJS, and JavaScript.

In `@projects/site/src/docs/foundations/layout/index.md`:
- Around line 102-104: The anchor reference in the link
`/docs/api-design/styles/#internal-host` is broken because the styles
documentation does not contain a matching anchor with that exact name. Locate
the correct anchor name for the internal-host pattern in the styles
documentation file by checking the actual heading format used there, and update
the link in the layout documentation to match the correct anchor. Alternatively,
if the internal-host pattern is not documented in the styles file, identify the
correct page that documents this pattern and update the link destination
accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: bbb8e293-c137-4ddb-8b60-4a955b07f613

📥 Commits

Reviewing files that changed from the base of the PR and between 1339f0f and b908544.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (76)
  • pnpm-workspace.yaml
  • projects/core/src/tabs/tabs.examples.ts
  • projects/site/eleventy.config.js
  • projects/site/package.json
  • projects/site/src/_11ty/layouts/common.js
  • projects/site/src/_11ty/layouts/docs.11ty.js
  • projects/site/src/_11ty/layouts/links.test.ts
  • projects/site/src/_11ty/layouts/metadata.js
  • projects/site/src/_11ty/layouts/metadata.test.ts
  • projects/site/src/_11ty/layouts/page.11ty.js
  • projects/site/src/_11ty/plugins/llms-txt.js
  • projects/site/src/_11ty/plugins/llms-txt.test.ts
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts
  • projects/site/src/_11ty/shortcodes/index.js
  • projects/site/src/_11ty/templates/api.js
  • projects/site/src/_11ty/transforms/anchor-generator.js
  • projects/site/src/_11ty/transforms/site-urls.js
  • projects/site/src/_11ty/transforms/site-urls.test.ts
  • projects/site/src/_11ty/utils/site-url.js
  • projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
  • projects/site/src/docs/about/contributions.md
  • projects/site/src/docs/about/migration.md
  • projects/site/src/docs/about/support.md
  • projects/site/src/docs/api-design/logs.md
  • projects/site/src/docs/api-design/packaging.md
  • projects/site/src/docs/changelog/changelog.11ty.js
  • projects/site/src/docs/changelog/index.11ty.js
  • projects/site/src/docs/elements/dialog.md
  • projects/site/src/docs/elements/drawer.md
  • projects/site/src/docs/elements/dropdown.md
  • projects/site/src/docs/elements/forms/index.md
  • projects/site/src/docs/elements/icon.md
  • projects/site/src/docs/elements/index.11ty.js
  • projects/site/src/docs/elements/notification.md
  • projects/site/src/docs/elements/page.md
  • projects/site/src/docs/elements/toast.md
  • projects/site/src/docs/elements/toggletip.md
  • projects/site/src/docs/elements/tooltip.md
  • projects/site/src/docs/foundations/iconography.md
  • projects/site/src/docs/foundations/index.md
  • projects/site/src/docs/foundations/layout/grid.md
  • projects/site/src/docs/foundations/layout/horizontal.md
  • projects/site/src/docs/foundations/layout/index.md
  • projects/site/src/docs/foundations/layout/responsive/container.md
  • projects/site/src/docs/foundations/layout/responsive/index.md
  • projects/site/src/docs/foundations/layout/responsive/viewport.md
  • projects/site/src/docs/foundations/layout/vertical.md
  • projects/site/src/docs/foundations/popovers.md
  • projects/site/src/docs/foundations/themes/index.11ty.js
  • projects/site/src/docs/foundations/typography.md
  • projects/site/src/docs/foundations/view-transitions.md
  • projects/site/src/docs/integrations/angular.md
  • projects/site/src/docs/integrations/index.11ty.js
  • projects/site/src/docs/integrations/lit.md
  • projects/site/src/docs/integrations/mcp-apps.md
  • projects/site/src/docs/integrations/shortcodes.js
  • projects/site/src/docs/internal/guidelines/agent-harness.md
  • projects/site/src/docs/internal/guidelines/agent-ownership.md
  • projects/site/src/docs/internal/guidelines/component-creation.md
  • projects/site/src/docs/internal/guidelines/testing.md
  • projects/site/src/docs/metrics/api-status.11ty.js
  • projects/site/src/docs/metrics/bundle-explorer.11ty.js
  • projects/site/src/docs/metrics/index.11ty.js
  • projects/site/src/docs/metrics/metadata.11ty.js
  • projects/site/src/docs/metrics/testing-and-performance.11ty.js
  • projects/site/src/docs/metrics/wireit.11ty.js
  • projects/site/src/docs/monaco/diff-editor.md
  • projects/site/src/docs/monaco/editor.md
  • projects/site/src/docs/patterns/editor.md
  • projects/site/src/docs/patterns/index.md
  • projects/site/src/docs/patterns/panel.md
  • projects/site/src/docs/skills/index.md
  • projects/site/src/examples/examples.11ty.js
  • projects/site/src/examples/index.11ty.js
  • projects/site/src/index.md

Comment on lines +227 to +236
return collection
.getFilteredByGlob([
'src/docs/elements/*.md',
'src/docs/elements/data-grid/index.md',
'src/docs/code/*.md',
'src/docs/monaco/*.md',
'src/docs/media/*.md',
'src/docs/markdown/index.md'
])
.filter(page => page.data.tag);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find component docs pages that might be missing the tag property

# Find all files matching the componentDocs glob patterns
fd -e md . projects/site/src/docs/elements projects/site/src/docs/data-grid projects/site/src/docs/code projects/site/src/docs/monaco projects/site/src/docs/media projects/site/src/docs/markdown -x sh -c '
  # Extract frontmatter and check for tag property
  file="$1"
  if ! grep -q "^tag:" "$file"; then
    echo "Missing tag: $file"
  fi
' _ {}

Repository: NVIDIA/elements

Length of output: 6414


🏁 Script executed:

# First, let's look at the eleventy.config.js file around the componentDocs collection
cat -n projects/site/eleventy.config.js | sed -n '220,245p'

Repository: NVIDIA/elements

Length of output: 1460


🏁 Script executed:

# Check how many markdown files have tags vs don't have tags
echo "=== Files WITH tag property ==="
find projects/site/src/docs -name "*.md" -exec grep -l "^tag:" {} \; | wc -l

echo ""
echo "=== Files WITHOUT tag property ==="
find projects/site/src/docs -name "*.md" ! -exec grep -q "^tag:" {} \; -print | wc -l

echo ""
echo "=== Sample of files WITH tags ==="
find projects/site/src/docs -name "*.md" -exec grep -l "^tag:" {} \; | head -10

Repository: NVIDIA/elements

Length of output: 262


🏁 Script executed:

# Let's check the git history for this change to understand the intent
cd projects/site && git log --oneline -n 30 -- eleventy.config.js 2>/dev/null || echo "Git history unavailable"

Repository: NVIDIA/elements

Length of output: 1654


Remove the .filter(page => page.data.tag) filter or add tag properties to all component documentation files.

The filter on line 236 excludes all component documentation pages from the componentDocs collection. Currently, 0 out of 200 component documentation files have a tag property in their frontmatter, resulting in an empty collection. This breaks the API documentation generation that depends on this collection (as noted in the comment on line 223).

Either remove the filter to restore the original behavior, or systematically add the tag property to all component documentation files across src/docs/elements/, src/docs/code/, src/docs/monaco/, and src/docs/markdown/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/eleventy.config.js` around lines 227 - 236, The `.filter(page
=> page.data.tag)` condition in the componentDocs collection is filtering out
all component documentation pages since none of the files in the src/docs
directories have a tag property in their frontmatter, resulting in an empty
collection that breaks API documentation generation. Either remove the entire
.filter(page => page.data.tag) filter from the chain after getFilteredByGlob to
restore all documentation files to the collection, or systematically add a tag
property to the frontmatter of all component documentation files across the
src/docs/elements/, src/docs/code/, src/docs/monaco/, and src/docs/markdown/
directories.

Comment thread projects/site/src/_11ty/plugins/llms-txt.js
Comment thread projects/site/src/_11ty/transforms/site-urls.js
Comment on lines +29 to +30
const docsByTag = new Map(componentDocs.filter(hasComponentTag).map(component => [component.data.tag, component]));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

docsByTag collapses multi-page docs and can point cards to the wrong page.

Using Map(component.data.tag -> component) keeps only one doc per tag. Since docs pages can share the same tag (overview/API/examples), the selected href/title becomes order-dependent and may resolve to /api/ or /examples/ instead of the component overview.

Suggested fix
 const createComponentCatalog = componentDocs => {
-  const docsByTag = new Map(componentDocs.filter(hasComponentTag).map(component => [component.data.tag, component]));
+  const docsByTag = componentDocs
+    .filter(hasComponentTag)
+    .reduce((map, component) => {
+      const tag = component.data.tag;
+      const existing = map.get(tag);
+      const isOverview = !/\/(api|examples)\/?$/.test(component.url ?? '');
+      const shouldReplace =
+        !existing ||
+        (isOverview && /\/(api|examples)\/?$/.test(existing.url ?? ''));
+
+      if (shouldReplace) map.set(tag, component);
+      return map;
+    }, new Map());

Also applies to: 34-43

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/elements/index.11ty.js` around lines 29 - 30, The
docsByTag Map is overwriting multiple components that share the same tag,
keeping only the last one and making href/title selection order-dependent.
Instead of mapping each tag to a single component, modify the Map creation to
store an array of components for each tag. For each component in the filter/map
operation, check if the tag already exists in the docsByTag Map - if it does,
push the component to the existing array; if not, create a new array with the
component. Then update all references to docsByTag throughout the file
(including the logic around lines 34-43) to iterate over the component arrays
instead of expecting a single component per tag.

</a>`;

export function render(data) {
const components = createComponentCatalog(data.collections.componentDocs);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate where componentDocs collection is defined/registered and where this page is invoked.
fd -i 'eleventy.config.js|*.11tydata.js|*.11ty.js|*collections*' projects/site | sed -n '1,200p'

# Show collection registrations and references with context
rg -n -C3 'addCollection\(|componentDocs|collections\.' projects/site

# Inspect this file in context
nl -ba projects/site/src/docs/elements/index.11ty.js | sed -n '1,140p'

Repository: NVIDIA/elements

Length of output: 3494


🏁 Script executed:

# Read the full collection registration in eleventy.config.js
cat -n projects/site/eleventy.config.js | sed -n '220,250p'

Repository: NVIDIA/elements

Length of output: 1680


🏁 Script executed:

# Read the full render function and surrounding context in index.11ty.js
cat -n projects/site/src/docs/elements/index.11ty.js | sed -n '1,100p'

Repository: NVIDIA/elements

Length of output: 4013


🏁 Script executed:

# Check if there's a data export or pagination config in index.11ty.js
rg -n 'export const data|export default' projects/site/src/docs/elements/index.11ty.js

Repository: NVIDIA/elements

Length of output: 177


Add defensive check for missing componentDocs collection.

The componentDocs collection is registered unconditionally in eleventy.config.js (line 225), but the code at line 71 accesses data.collections.componentDocs without validation. While the collection should exist during normal builds, the code should still include a safe default for robustness: use data.collections.componentDocs ?? [] to guard against the case where the collection is undefined or empty.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/elements/index.11ty.js` at line 71, The
createComponentCatalog function call on line 71 accesses
data.collections.componentDocs without validating that it exists or is defined.
Add a defensive check by using the nullish coalescing operator to provide an
empty array as a safe default fallback, ensuring the code is robust even if the
componentDocs collection is undefined or missing. Update the call to
createComponentCatalog to pass data.collections.componentDocs with the null
coalescing operator and an empty array as the fallback value.

Comment thread projects/site/src/docs/internal/guidelines/testing.md Outdated
@coryrylan coryrylan force-pushed the topic-base-path-fix branch from b908544 to 4246c8c Compare June 23, 2026 16:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/site/src/_11ty/layouts/page.11ty.js`:
- Line 25: The nve-button element with the "Starters" link in page.11ty.js has
an href of /starters/ which causes an unnecessary redirect to
/docs/integrations/. Change the href attribute from /starters/ to
/docs/integrations/ to match the consistent navigation target used in common.js
and eliminate the redirect overhead.

In `@projects/site/src/_11ty/transforms/site-urls.js`:
- Around line 27-29: The isSameSiteUrl function currently checks only the origin
of a URL, which is too broad and can incorrectly identify URLs from other
projects on shared origins as internal links. Modify the isSameSiteUrl function
to also validate that the URL pathname is within the same project path, not just
that the origin matches ELEMENTS_SITE_ORIGIN or DEPLOYED_SITE_ORIGIN. This will
prevent the link rewriting logic at lines 53 and 65 from incorrectly rewriting
links to other projects that share the same origin.

In `@projects/site/src/docs/elements/index.11ty.js`:
- Around line 15-17: The isLibraryComponentDoc function filter at line 16 is
incomplete and only checks for two paths in the array passed to some(), but the
componentDocs collection includes additional valid paths. Add the missing
'/docs/code/' and '/docs/media/' paths to the array of paths being checked by
the some() method in isLibraryComponentDoc to ensure all component documentation
routes are properly included in the catalog output.

In `@projects/site/src/docs/foundations/layout/responsive/container.md`:
- Line 42: The anchor fragment references in the container.md file are using
incorrect paths that don't match the actual anchor definitions in grid.md.
Update the three anchor links (at the specified line numbers) by removing the
"layout-" prefix from the fragment identifiers: change `#layout-gap-spacing` to
`#gap-spacing` and change `#layout-padding` to `#padding` so that the links correctly
target the actual anchor sections defined in the grid.md documentation file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 86485038-bef7-49b8-9f1f-c8f5aae75082

📥 Commits

Reviewing files that changed from the base of the PR and between b908544 and 4246c8c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (76)
  • pnpm-workspace.yaml
  • projects/core/src/tabs/tabs.examples.ts
  • projects/site/eleventy.config.js
  • projects/site/package.json
  • projects/site/src/_11ty/layouts/common.js
  • projects/site/src/_11ty/layouts/docs.11ty.js
  • projects/site/src/_11ty/layouts/links.test.ts
  • projects/site/src/_11ty/layouts/metadata.js
  • projects/site/src/_11ty/layouts/metadata.test.ts
  • projects/site/src/_11ty/layouts/page.11ty.js
  • projects/site/src/_11ty/plugins/llms-txt.js
  • projects/site/src/_11ty/plugins/llms-txt.test.ts
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts
  • projects/site/src/_11ty/shortcodes/index.js
  • projects/site/src/_11ty/templates/api.js
  • projects/site/src/_11ty/transforms/anchor-generator.js
  • projects/site/src/_11ty/transforms/site-urls.js
  • projects/site/src/_11ty/transforms/site-urls.test.ts
  • projects/site/src/_11ty/utils/site-url.js
  • projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
  • projects/site/src/docs/about/contributions.md
  • projects/site/src/docs/about/migration.md
  • projects/site/src/docs/about/support.md
  • projects/site/src/docs/api-design/logs.md
  • projects/site/src/docs/api-design/packaging.md
  • projects/site/src/docs/changelog/changelog.11ty.js
  • projects/site/src/docs/changelog/index.11ty.js
  • projects/site/src/docs/elements/dialog.md
  • projects/site/src/docs/elements/drawer.md
  • projects/site/src/docs/elements/dropdown.md
  • projects/site/src/docs/elements/forms/index.md
  • projects/site/src/docs/elements/icon.md
  • projects/site/src/docs/elements/index.11ty.js
  • projects/site/src/docs/elements/notification.md
  • projects/site/src/docs/elements/page.md
  • projects/site/src/docs/elements/toast.md
  • projects/site/src/docs/elements/toggletip.md
  • projects/site/src/docs/elements/tooltip.md
  • projects/site/src/docs/foundations/iconography.md
  • projects/site/src/docs/foundations/index.md
  • projects/site/src/docs/foundations/layout/grid.md
  • projects/site/src/docs/foundations/layout/horizontal.md
  • projects/site/src/docs/foundations/layout/index.md
  • projects/site/src/docs/foundations/layout/responsive/container.md
  • projects/site/src/docs/foundations/layout/responsive/index.md
  • projects/site/src/docs/foundations/layout/responsive/viewport.md
  • projects/site/src/docs/foundations/layout/vertical.md
  • projects/site/src/docs/foundations/popovers.md
  • projects/site/src/docs/foundations/themes/index.11ty.js
  • projects/site/src/docs/foundations/typography.md
  • projects/site/src/docs/foundations/view-transitions.md
  • projects/site/src/docs/integrations/angular.md
  • projects/site/src/docs/integrations/index.11ty.js
  • projects/site/src/docs/integrations/lit.md
  • projects/site/src/docs/integrations/mcp-apps.md
  • projects/site/src/docs/integrations/shortcodes.js
  • projects/site/src/docs/internal/guidelines/agent-harness.md
  • projects/site/src/docs/internal/guidelines/agent-ownership.md
  • projects/site/src/docs/internal/guidelines/component-creation.md
  • projects/site/src/docs/internal/guidelines/testing.md
  • projects/site/src/docs/metrics/api-status.11ty.js
  • projects/site/src/docs/metrics/bundle-explorer.11ty.js
  • projects/site/src/docs/metrics/index.11ty.js
  • projects/site/src/docs/metrics/metadata.11ty.js
  • projects/site/src/docs/metrics/testing-and-performance.11ty.js
  • projects/site/src/docs/metrics/wireit.11ty.js
  • projects/site/src/docs/monaco/diff-editor.md
  • projects/site/src/docs/monaco/editor.md
  • projects/site/src/docs/patterns/editor.md
  • projects/site/src/docs/patterns/index.md
  • projects/site/src/docs/patterns/panel.md
  • projects/site/src/docs/skills/index.md
  • projects/site/src/examples/examples.11ty.js
  • projects/site/src/examples/index.11ty.js
  • projects/site/src/index.md
💤 Files with no reviewable changes (1)
  • pnpm-workspace.yaml

Comment thread projects/site/src/_11ty/layouts/page.11ty.js Outdated
Comment thread projects/site/src/_11ty/transforms/site-urls.js
Comment thread projects/site/src/docs/elements/index.11ty.js
Comment thread projects/site/src/docs/foundations/layout/responsive/container.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (3)
projects/site/src/_11ty/layouts/page.11ty.js (1)

25-25: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Align the Starters target with the docs layout to avoid redirect hops.

Line 25 still points to /starters/, while the shared docs header now points to /docs/integrations/. This keeps an unnecessary redirect in one layout and makes nav behavior inconsistent.

Suggested fix
-            <nve-button container="flat"><a href="/starters/">Starters</a></nve-button>
+            <nve-button container="flat"><a href="/docs/integrations/">Starters</a></nve-button>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/page.11ty.js` at line 25, The nve-button
element containing the "Starters" link currently points to "/starters/" which
creates an unnecessary redirect. Update the href attribute on this nve-button
from "/starters/" to "/docs/integrations/" to align with the navigation target
used in the shared docs header, ensuring consistent navigation behavior across
layouts and eliminating the redirect hop.
projects/site/src/docs/elements/index.11ty.js (1)

29-30: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

docsByTag is order-dependent and can link cards to non-overview docs.

Line 29 collapses multiple pages with the same tag into a single entry, so whichever page is last wins (including /api/ or /examples/). That can produce incorrect catalog card href/title.

Suggested fix
-  const docsByTag = new Map(componentDocs.filter(hasComponentTag).map(component => [component.data.tag, component]));
+  const docsByTag = componentDocs
+    .filter(hasComponentTag)
+    .reduce((map, component) => {
+      const tag = component.data.tag;
+      const existing = map.get(tag);
+      const isOverview = !/\/(api|examples)\/?$/.test(component.url ?? '');
+      const existingIsOverview = existing ? !/\/(api|examples)\/?$/.test(existing.url ?? '') : false;
+
+      if (!existing || (isOverview && !existingIsOverview)) {
+        map.set(tag, component);
+      }
+
+      return map;
+    }, new Map());

Also applies to: 34-47

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/docs/elements/index.11ty.js` around lines 29 - 30, The
docsByTag Map on line 29 overwrites entries when multiple components share the
same tag, causing the wrong document (such as API or examples pages) to be used
for catalog card links instead of overview docs. Modify the Map creation logic
to check if a tag already exists before adding it, and ensure that overview
documentation takes priority over API or examples pages. When filtering
components and creating the Map, add logic to skip adding a component to the Map
if its tag is already present, or implement a prioritization check to keep
overview docs and discard non-overview pages with the same tag. Apply the same
fix to the similar code referenced in lines 34-47.
projects/site/src/_11ty/layouts/links.test.ts (1)

6-9: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Expand invalid-link patterns to catch ../ relative paths too.

Lines 6 and 8 only reject ./... (or bare docs/...) forms. ../docs/..., ../examples/..., and ../starters/... currently bypass this test.

Suggested fix
-const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:\.\/)?(?:docs|examples|starters)\//;
+const RELATIVE_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()(?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
 const BASE_PREFIXED_INTERNAL_LINK_PATTERN = /(?:href=["']|]\()\/elements\/(?:docs|examples|starters)\//;
-const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:\.\/)?(?:docs|examples|starters)\//;
+const JS_RELATIVE_INTERNAL_LINK_PATTERN = /\bhref:\s*['"](?:(?:\.\.\/)+|\.\/)?(?:docs|examples|starters)\//;
 const JS_BASE_PREFIXED_INTERNAL_LINK_PATTERN = /\bhref:\s*['"]\/elements\/(?:docs|examples|starters)\//;
As per coding guidelines, "`**/*.test.ts`: Follow unit testing patterns from `/projects/site/src/docs/internal/guidelines/testing-unit.md` including createFixture and elementIsStable patterns."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@projects/site/src/_11ty/layouts/links.test.ts` around lines 6 - 9, The regex
patterns RELATIVE_INTERNAL_LINK_PATTERN on line 6 and
JS_RELATIVE_INTERNAL_LINK_PATTERN on line 8 currently only match optional `./`
prefixes using the pattern `(?:\.\/)?`, which allows `../` relative paths to
bypass the test. Modify both patterns to also catch `../` paths by updating the
prefix matching group from `(?:\.\/)?` to `(?:\.\.?\/)?`, which will match
either `.` or `..` followed by a forward slash, ensuring that paths like
`../docs/...`, `../examples/...`, and `../starters/...` are properly caught.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@projects/core/src/tabs/tabs.examples.ts`:
- Around line 148-154: The `@summary` description for the tabs example in the
examples file incorrectly states "routing-based tab switching and page
navigation" when the actual example code demonstrates hash-only anchor links for
same-page fragment navigation. Locate the `@summary` comment associated with this
example block that contains the nve-tabs-item elements with href="`#links`"
anchors and update the description to "Tabs with hash-only anchor links for
same-page navigation and fragment scrolling" to accurately reflect the
demonstrated behavior.

In `@projects/site/src/docs/metrics/bundle-explorer.11ty.js`:
- Around line 17-22: The tab navigation hrefs have been correctly updated to use
root-relative paths, but the iframe src attribute on line 26 remains as a
relative path (docs/metrics/bundle-explorer-report/) instead of a root-relative
path. Update the iframe src attribute to match the consistency of the navigation
links by converting it to a root-relative path format that starts with a forward
slash, similar to how the href attributes in the nve-tabs-item elements are
structured.

---

Duplicate comments:
In `@projects/site/src/_11ty/layouts/links.test.ts`:
- Around line 6-9: The regex patterns RELATIVE_INTERNAL_LINK_PATTERN on line 6
and JS_RELATIVE_INTERNAL_LINK_PATTERN on line 8 currently only match optional
`./` prefixes using the pattern `(?:\.\/)?`, which allows `../` relative paths
to bypass the test. Modify both patterns to also catch `../` paths by updating
the prefix matching group from `(?:\.\/)?` to `(?:\.\.?\/)?`, which will match
either `.` or `..` followed by a forward slash, ensuring that paths like
`../docs/...`, `../examples/...`, and `../starters/...` are properly caught.

In `@projects/site/src/_11ty/layouts/page.11ty.js`:
- Line 25: The nve-button element containing the "Starters" link currently
points to "/starters/" which creates an unnecessary redirect. Update the href
attribute on this nve-button from "/starters/" to "/docs/integrations/" to align
with the navigation target used in the shared docs header, ensuring consistent
navigation behavior across layouts and eliminating the redirect hop.

In `@projects/site/src/docs/elements/index.11ty.js`:
- Around line 29-30: The docsByTag Map on line 29 overwrites entries when
multiple components share the same tag, causing the wrong document (such as API
or examples pages) to be used for catalog card links instead of overview docs.
Modify the Map creation logic to check if a tag already exists before adding it,
and ensure that overview documentation takes priority over API or examples
pages. When filtering components and creating the Map, add logic to skip adding
a component to the Map if its tag is already present, or implement a
prioritization check to keep overview docs and discard non-overview pages with
the same tag. Apply the same fix to the similar code referenced in lines 34-47.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0be14e9a-dd3e-44fd-8c26-2dcb707c951d

📥 Commits

Reviewing files that changed from the base of the PR and between 4246c8c and 08d113d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (77)
  • pnpm-workspace.yaml
  • projects/core/src/tabs/tabs.examples.ts
  • projects/site/eleventy.config.js
  • projects/site/package.json
  • projects/site/src/_11ty/layouts/common.js
  • projects/site/src/_11ty/layouts/docs.11ty.js
  • projects/site/src/_11ty/layouts/links.test.ts
  • projects/site/src/_11ty/layouts/metadata.js
  • projects/site/src/_11ty/layouts/metadata.test.ts
  • projects/site/src/_11ty/layouts/page.11ty.js
  • projects/site/src/_11ty/plugins/llms-txt.js
  • projects/site/src/_11ty/plugins/llms-txt.test.ts
  • projects/site/src/_11ty/plugins/sitemap-xml.js
  • projects/site/src/_11ty/plugins/sitemap-xml.test.ts
  • projects/site/src/_11ty/shortcodes/index.js
  • projects/site/src/_11ty/templates/api.js
  • projects/site/src/_11ty/transforms/anchor-generator.js
  • projects/site/src/_11ty/transforms/site-urls.js
  • projects/site/src/_11ty/transforms/site-urls.test.ts
  • projects/site/src/_11ty/utils/site-url.js
  • projects/site/src/_internal/metrics-carousel/metrics-carousel.ts
  • projects/site/src/docs/about/contributions.md
  • projects/site/src/docs/about/migration.md
  • projects/site/src/docs/about/support.md
  • projects/site/src/docs/api-design/logs.md
  • projects/site/src/docs/api-design/packaging.md
  • projects/site/src/docs/changelog/changelog.11ty.js
  • projects/site/src/docs/changelog/index.11ty.js
  • projects/site/src/docs/elements/dialog.md
  • projects/site/src/docs/elements/drawer.md
  • projects/site/src/docs/elements/dropdown.md
  • projects/site/src/docs/elements/forms/index.md
  • projects/site/src/docs/elements/icon.md
  • projects/site/src/docs/elements/index.11ty.js
  • projects/site/src/docs/elements/notification.md
  • projects/site/src/docs/elements/page.md
  • projects/site/src/docs/elements/toast.md
  • projects/site/src/docs/elements/toggletip.md
  • projects/site/src/docs/elements/tooltip.md
  • projects/site/src/docs/foundations/iconography.md
  • projects/site/src/docs/foundations/index.md
  • projects/site/src/docs/foundations/layout/grid.md
  • projects/site/src/docs/foundations/layout/horizontal.md
  • projects/site/src/docs/foundations/layout/index.md
  • projects/site/src/docs/foundations/layout/responsive/container.md
  • projects/site/src/docs/foundations/layout/responsive/index.md
  • projects/site/src/docs/foundations/layout/responsive/viewport.md
  • projects/site/src/docs/foundations/layout/vertical.md
  • projects/site/src/docs/foundations/popovers.md
  • projects/site/src/docs/foundations/themes/index.11ty.js
  • projects/site/src/docs/foundations/typography.md
  • projects/site/src/docs/foundations/view-transitions.md
  • projects/site/src/docs/integrations/angular.md
  • projects/site/src/docs/integrations/index.11ty.js
  • projects/site/src/docs/integrations/lit.md
  • projects/site/src/docs/integrations/mcp-apps.md
  • projects/site/src/docs/integrations/shortcodes.js
  • projects/site/src/docs/internal/guidelines/agent-harness.md
  • projects/site/src/docs/internal/guidelines/agent-ownership.md
  • projects/site/src/docs/internal/guidelines/component-creation.md
  • projects/site/src/docs/internal/guidelines/testing.md
  • projects/site/src/docs/metrics/api-status.11ty.js
  • projects/site/src/docs/metrics/bundle-explorer.11ty.js
  • projects/site/src/docs/metrics/index.11ty.js
  • projects/site/src/docs/metrics/metadata.11ty.js
  • projects/site/src/docs/metrics/testing-and-performance.11ty.js
  • projects/site/src/docs/metrics/wireit.11ty.js
  • projects/site/src/docs/monaco/diff-editor.md
  • projects/site/src/docs/monaco/editor.md
  • projects/site/src/docs/patterns/editor.md
  • projects/site/src/docs/patterns/index.md
  • projects/site/src/docs/patterns/panel.md
  • projects/site/src/docs/skills/index.md
  • projects/site/src/examples/examples.11ty.js
  • projects/site/src/examples/index.11ty.js
  • projects/site/src/index.md
  • projects/starters/nextjs/package.json

Comment thread projects/core/src/tabs/tabs.examples.ts
Comment thread projects/site/src/docs/metrics/bundle-explorer.11ty.js
@coryrylan coryrylan force-pushed the topic-base-path-fix branch 2 times, most recently from 264380d to d9f75d0 Compare June 23, 2026 18:31
- Changed internal links in documentation to use root-relative paths for consistency.
- Added a new transform for site URLs to ensure correct linking in different environments.
- Updated various files to reflect these changes, including configuration and layout files.
- Added tests to verify that all internal links are correctly formatted.

Signed-off-by: Cory Rylan <crylan@nvidia.com>
@coryrylan coryrylan force-pushed the topic-base-path-fix branch from d9f75d0 to e01a711 Compare June 23, 2026 18:32
@coryrylan coryrylan merged commit f97acb6 into main Jun 23, 2026
13 checks passed
@coryrylan coryrylan deleted the topic-base-path-fix branch June 23, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants