Skip to content

docs: documentation content audit and formatting improvements#718

Merged
harlan-zw merged 1 commit into
mainfrom
docs/content-audit-fixes
Apr 5, 2026
Merged

docs: documentation content audit and formatting improvements#718
harlan-zw merged 1 commit into
mainfrom
docs/content-audit-fixes

Conversation

@harlan-zw

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

Copy link
Copy Markdown
Collaborator

Summary

This PR addresses several issues identified during a documentation audit:

  • Fixed Broken Fragment Links: Corrected internal links like [skip](#4-what-default-tags-does-unhead-add) in the Vue installation guide.
  • Updated Version References: Replaced outdated "Unhead v2" mentions with "Unhead v3" or "Unhead v2+" across all documentation to reflect current major versions and framework support accurately.
  • Automated Formatting: Resolved thousands of linting errors (spacing, blank lines, list styles) using the project's documentation linter (pnpm run lint:docs:fix).
  • Standardized Migration Guides: Ensured consistent language regarding Vue 2 support and Nuxt 3.16 defaults.

Checklist

  • Ran pnpm run lint:docs
  • Verified fragment links
  • Standardized framework migration numbering

Summary by CodeRabbit

Release Notes

New Features

  • Added defaultTitle option in template parameters as a fallback title when no page title is provided
  • Improved title template behavior to prevent formatting with empty page titles
  • Enhanced text content extraction from Vue head component children and slot content

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@harlan-zw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5512788e-f4a0-478e-85fa-84f4cb473773

📥 Commits

Reviewing files that changed from the base of the PR and between f88c846 and 132a40d.

📒 Files selected for processing (45)
  • docs/0.angular/head/guides/0.get-started/1.installation.md
  • docs/0.angular/head/guides/0.get-started/2.migration.md
  • docs/0.angular/head/guides/1.core-concepts/0.reactivity.md
  • docs/0.angular/schema-org/guides/get-started/0.installation.md
  • docs/0.nuxt/head/guides/0.get-started/1.migration.md
  • docs/0.react/head/guides/0.get-started/1.installation.md
  • docs/0.react/head/guides/0.get-started/2.migration.md
  • docs/0.react/head/guides/0.get-started/migrate-from-react-helmet.md
  • docs/0.react/head/guides/1.core-concepts/2.reactivity.md
  • docs/0.react/schema-org/guides/get-started/0.installation.md
  • docs/0.solid-js/head/guides/0.get-started/1.installation.md
  • docs/0.solid-js/head/guides/0.get-started/2.migration.md
  • docs/0.solid-js/head/guides/1.core-concepts/0.reactivity.md
  • docs/0.solid-js/schema-org/guides/get-started/0.installation.md
  • docs/0.svelte/head/guides/0.get-started/1.installation.md
  • docs/0.svelte/head/guides/0.get-started/2.migration.md
  • docs/0.svelte/schema-org/guides/get-started/0.installation.md
  • docs/0.typescript/head/guides/0.get-started/1.installation.md
  • docs/0.typescript/head/guides/0.get-started/1.migration.md
  • docs/0.typescript/schema-org/guides/get-started/0.installation.md
  • docs/0.vue/head/guides/0.get-started/1.installation.md
  • docs/0.vue/head/guides/0.get-started/1.migration.md
  • docs/0.vue/schema-org/guides/0.get-started/0.installation.md
  • docs/head/1.guides/1.core-concepts/1.titles.md
  • docs/head/1.guides/1.core-concepts/2.positions.md
  • docs/head/1.guides/1.core-concepts/3.class-attr.md
  • docs/head/1.guides/1.core-concepts/4.inner-content.md
  • docs/head/1.guides/1.core-concepts/6.handling-duplicates.md
  • docs/head/1.guides/1.core-concepts/8.dom-event-handling.md
  • docs/head/1.guides/1.core-concepts/9.loading-scripts.md
  • docs/head/1.guides/2.advanced/11.extending-unhead.md
  • docs/head/1.guides/2.advanced/7.client-only-tags.md
  • docs/head/1.guides/plugins/6.template-params.md
  • docs/head/1.guides/plugins/alias-sorting.md
  • docs/head/1.guides/plugins/canonical.md
  • docs/head/1.guides/plugins/infer-seo-meta-tags.md
  • docs/head/1.guides/plugins/validate.md
  • docs/head/1.guides/releases/v3.md
  • docs/head/7.api/composables/0.use-head.md
  • docs/head/7.api/composables/4.use-script.md
  • docs/schema-org/2.guides/0.get-started/0.overview.md
  • docs/schema-org/2.guides/4.recipes/0.custom-nodes.md
  • docs/schema-org/2.guides/4.recipes/blog.md
  • docs/schema-org/2.guides/4.recipes/faq.md
  • docs/schema-org/5.api/0.composables/0.use-schema-org.md
📝 Walkthrough

Walkthrough

The PR introduces a defaultTitle field to template parameters that serves as a fallback title when no page title is provided. It refactors title resolution logic to avoid creating title tags from unresolved templates, and improves Vue component text content extraction from nested vnodes.

Changes

Cohort / File(s) Summary
Type Definitions
packages/unhead/src/types/schema/head.ts, packages/unhead/src/types/tags.ts
Added optional defaultTitle?: string property to ResolvableTemplateParams and TemplateParams types to support fallback title when no page title is provided.
Plugin & Core Logic
packages/unhead/src/plugins/templateParams.ts, packages/unhead/src/utils/resolve.ts
Implemented defaultTitle extraction and application in templateParams plugin; added early-return guards in resolveTitleTemplate to prevent creating title tags from templates with unresolved %s placeholders when title is absent.
Vue Component Handling
packages/vue/src/components.ts
Refactored vnode-to-head-object conversion with new extractTextContent() helper for recursive text extraction from vnodes; improved children prop mapping to textContent/innerHTML based on tag type, and fixed title resolution from vnode content.
Client Tests
packages/unhead/test/unit/client/templateParams.test.ts, packages/unhead/test/unit/client/titleTemplate.test.ts
Added tests verifying defaultTitle behavior when page title is absent or present; added tests confirming string titleTemplate with %s placeholder renders nothing when title is missing.
Server Tests
packages/unhead/test/unit/server/templateParams.test.ts, packages/unhead/test/unit/server/titleTemplate.test.ts
Added SSR tests for defaultTitle application and titleTemplate string handling; verified correct tag output for scenarios with and without explicit page title.
Vue Component Tests
packages/vue/test/unit/dom/headComponents.test.ts
Added comprehensive test suite for Vue Head component children handling via props and slots, including <style> and <script> content extraction and DOM rendering validation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A defaultTitle hops to the rescue,
When page titles flee and templates confuse you,
Vue children now sing in proper form,
With textContent extracted in every norm,
Title templates take guard with graceful care! ✨

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title claims to address documentation updates, but the actual changes are code modifications for title template handling and Vue component fixes, not documentation changes. Update the title to reflect the actual code changes, e.g., 'fix: handle missing title with titleTemplate and add defaultTitle support' based on the commit messages.
Description check ⚠️ Warning The PR description describes documentation audits and formatting fixes, but the actual changes are code modifications affecting title handling and Vue components. The description does not match the code changes, and required PR template sections are missing. Update the description to accurately reflect the code changes: title template handling, defaultTitle support, and Vue Style component restoration. Complete the required template sections (Type of change, Linked issue).
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ 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 docs/content-audit-fixes

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.

- fix broken fragment link in Vue installation guide
- update outdated Unhead v2 references to v3
- standardize Vue 2 support language
- run automated lint fixer for formatting (MD031, MD032, MD022, etc.)
@harlan-zw harlan-zw force-pushed the docs/content-audit-fixes branch from be99986 to 132a40d Compare April 5, 2026 17:19
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Bundle Size Gzipped
Client (Minimal) 10.6 kB 4.3 kB
Server (Minimal) 10.3 kB 4.2 kB
Vue Client (Minimal) 11.6 kB 4.8 kB
Vue Server (Minimal) 11.3 kB 4.6 kB

@harlan-zw harlan-zw merged commit 796136a into main Apr 5, 2026
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.

1 participant