Skip to content

feat(llms): add related links to raw markdown endpoint#3724

Merged
farnabaz merged 2 commits intonuxt:mainfrom
HugoRCD:feat/raw-markdown-links
Feb 17, 2026
Merged

feat(llms): add related links to raw markdown endpoint#3724
farnabaz merged 2 commits intonuxt:mainfrom
HugoRCD:feat/raw-markdown-links

Conversation

@HugoRCD
Copy link
Member

@HugoRCD HugoRCD commented Feb 17, 2026

CleanShot 2026-02-17 at 12 38 16@2x

@vercel
Copy link

vercel bot commented Feb 17, 2026

@HugoRCD is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@atinux atinux requested review from atinux and farnabaz and removed request for farnabaz February 17, 2026 12:40
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds a new links field to the content schema (array of objects with label, icon, and to), creates a test Markdown page with links frontmatter, adds nuxt-llms to modules and an llms config object in nuxt.config.ts, adds nuxt-llms as a devDependency in package.json, and updates a server route to append related links (from page.links or page.meta.links) as an HR and unordered list at the end of generated markdown responses.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding related links functionality to the raw markdown endpoint in the llms feature.
Description check ✅ Passed The description contains a screenshot demonstrating the test page implementation that validates the feature works correctly, relating directly to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/features/llms/runtime/server/routes/raw/[...slug].md.get.ts (1)

47-47: Consider narrowing the fallback lookup for links.

(page as unknown as Record<string, unknown>).links will match any links property on the page object, including potential future collisions. This is acceptable for now given the custom schema, but worth a note: if PageCollectionItemBase ever adds its own links field with different semantics, this would silently pick it up.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/llms/runtime/server/routes/raw/`[...slug].md.get.ts at line 47,
Narrow the lookup for links by preferring page.meta?.links and only falling back
to page.links when it matches the expected shape: replace the current expression
with logic that first reads (page as Record<string, unknown>)?.meta?.links and,
if absent, checks (page as any).links but only uses it when it has the expected
type/structure (e.g., Array.isArray(...) or has the expected keys). This keeps
the variable links limited to the schema you expect and prevents silently
picking up unrelated future page.links properties.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@playground/content.config.ts`:
- Around line 39-43: The schema currently requires links: z.array(z.object({
label: z.string(), icon: z.string(), to: z.string() })), which forces every page
to provide links and every link to include icon; change the schema so links is
optional or defaults to an empty array and make the icon field optional: update
the links definition (the z.array/z.object block) to use either
z.optional(z.array(...)) or z.array(...).default([]) and change icon to
z.string().optional() so pages without links or link icons validate correctly.

In `@playground/nuxt.config.ts`:
- Around line 8-11: The llms config block is out of order and triggers
nuxt/nuxt-config-keys-order; move the llms object so it appears after the core
Nuxt keys (e.g., after the hub key or at the end of the exported config) rather
than between modules and content; locate the llms block in nuxt.config.ts and
cut/paste it below the core keys (or to the file end) to restore the expected
key ordering while keeping the llms object contents unchanged.

---

Nitpick comments:
In `@src/features/llms/runtime/server/routes/raw/`[...slug].md.get.ts:
- Line 47: Narrow the lookup for links by preferring page.meta?.links and only
falling back to page.links when it matches the expected shape: replace the
current expression with logic that first reads (page as Record<string,
unknown>)?.meta?.links and, if absent, checks (page as any).links but only uses
it when it has the expected type/structure (e.g., Array.isArray(...) or has the
expected keys). This keeps the variable links limited to the schema you expect
and prevents silently picking up unrelated future page.links properties.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 17, 2026

npm i https://pkg.pr.new/@nuxt/content@3724

commit: df9428b

@farnabaz farnabaz merged commit fadaf71 into nuxt:main Feb 17, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants