Skip to content

fix(types): missing rel sitemap, amphtml, hub, apple-touch-startup-image#744

Merged
harlan-zw merged 1 commit into
mainfrom
fix/link-rel-types
Apr 14, 2026
Merged

fix(types): missing rel sitemap, amphtml, hub, apple-touch-startup-image#744
harlan-zw merged 1 commit into
mainfrom
fix/link-rel-types

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Resolves #743

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The Link type was missing several valid IANA rel values, so passing rel: 'sitemap' (and friends) into head links failed type checks. Adds dedicated interfaces for sitemap, apple-touch-startup-image, amphtml, and hub, and wires them through KnownLinkRel and the Link union.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added type support for four new HTML link relation types: sitemap, apple-touch-startup-image, amphtml, and hub. This enables improved type safety and IDE intellisense when configuring these link types.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Introduces four new discriminated <link> types to the unhead schema: SitemapLink, AppleTouchStartupImageLink, AmpHtmlLink, and HubLink. These additions extend the KnownLinkRel type and the Link union, enabling type-safe narrowing for these previously unsupported link relations.

Changes

Cohort / File(s) Summary
Link Schema Extensions
packages/unhead/src/types/schema/link.ts
Added four new discriminated link interfaces (SitemapLink, AppleTouchStartupImageLink, AmpHtmlLink, HubLink) with appropriate rel values and properties. Extended KnownLinkRel type literal union and Link discriminated union to include these new relations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Four new links hop into view,
Sitemap, Apple, AmpHtml too!
Hub and types align just right,
Schema's fuller, oh what a sight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template with all required sections completed: linked issue (#743), type of change (bug fix selected), and detailed description explaining the problem and solution.
Linked Issues check ✅ Passed The PR successfully addresses issue #743 by adding TypeScript support for the 'sitemap' rel value and additionally implements support for 'apple-touch-startup-image', 'amphtml', and 'hub' rel types through new dedicated interfaces.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of supporting missing IANA rel values in the Link type; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately reflects the main change: adding support for four missing link rel types (sitemap, amphtml, hub, apple-touch-startup-image) to resolve TypeScript type errors.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/link-rel-types

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.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Bundle Size Gzipped
Client (Minimal) 10.7 kB 4.4 kB
Server (Minimal) 10.6 kB 4.3 kB
Vue Client (Minimal) 11.8 kB 4.8 kB
Vue Server (Minimal) 11.6 kB 4.7 kB

@harlan-zw harlan-zw changed the title fix(schema): add sitemap, amphtml, hub, apple-touch-startup-image rel types fix(schema): missing rel sitemap, amphtml, hub, apple-touch-startup-image Apr 14, 2026
@harlan-zw harlan-zw changed the title fix(schema): missing rel sitemap, amphtml, hub, apple-touch-startup-image fix(types): missing rel sitemap, amphtml, hub, apple-touch-startup-image Apr 14, 2026
@harlan-zw harlan-zw merged commit 578da8a into main Apr 14, 2026
8 checks passed
harlan-zw added a commit that referenced this pull request Apr 21, 2026
Follow-up to #744. The new link rel types were added to the discriminated
union but were not re-exported from the schema entry, so consumers could
not import them directly. Adds tests guarding the `href` requirement.
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.

Doesn't support sitemap value for rel

1 participant