Repository navigation
feat(core): SEO022/SEO023 — title & description length #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2c7be5c
docs: design spec for SEO022/SEO023 title & description length
oekazuma ab1f8da
docs: implementation plan for SEO022/SEO023 length rules
oekazuma ec8c273
feat(core): add visibleLength text-metrics helper
oekazuma 598b547
feat(cli): capture static title/description text onto HeadTag.text
oekazuma dc3f4f1
fix(cli): leave description text undefined for quoted dynamic content
oekazuma c4bf1ac
feat(vite): capture decoded title/description text in rendered mode
oekazuma a2fb3c8
feat(core): add SEO022/SEO023 title & description length rules
oekazuma 8aeeabb
docs: SEO022/SEO023 reference pages (en+ja) + changeset
oekazuma 3927424
test: update clean-page fixtures for SEO022/SEO023 length rules + format
oekazuma 2d30a67
fix: point length findings at the tag's source file; compliant ja exa…
oekazuma 1e4a047
test: lock HTML-entity decoding of captured title/description in both…
oekazuma 6b306d8
feat: extend SEO022/SEO023 capture to meta-library adapters + graphem…
oekazuma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| '@svelte-vitals/core': minor | ||
| 'svelte-vitals': minor | ||
| '@svelte-vitals/vite': minor | ||
| '@svelte-vitals/mcp': minor | ||
| --- | ||
|
|
||
| Add SEO022 (title length, 30–60 chars) and SEO023 (meta description length, | ||
| 70–160 chars). Both check only static text — the literal title/description is now | ||
| captured onto the head model — and flag both too-short and too-long values; a | ||
| dynamic title/description is skipped (presence stays owned by SEO001/SEO002). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: SEO022 · タイトルの長さ | ||
| description: ドキュメントのタイトルは 30〜60 文字であるべきです。 | ||
| --- | ||
|
|
||
| **重大度:** info | ||
|
|
||
| ## チェック内容 | ||
|
|
||
| 静的な `<title>` の表示テキストが 30 文字未満、または 60 文字超のものを検出します。カウント前に空白はトリム・圧縮されます。動的なタイトルは検査しません。 | ||
|
|
||
| ## なぜ重要か | ||
|
|
||
| タイトルが短すぎると最も強力なオンページ SEO シグナルを無駄にし、長すぎると検索結果で切り詰められて見出しの末尾が隠れます。 | ||
|
|
||
| ## 修正方法 | ||
|
|
||
| ```svelte | ||
| <svelte:head> | ||
| <title>検索結果で目を引く、簡潔でわかりやすいページタイトルの付け方ガイド</title> | ||
| </svelte:head> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: SEO023 · 説明文の長さ | ||
| description: meta description は 70〜160 文字であるべきです。 | ||
| --- | ||
|
|
||
| **重大度:** info | ||
|
|
||
| ## チェック内容 | ||
|
|
||
| 静的な `<meta name="description">` の内容が 70 文字未満、または 160 文字超のものを検出します。カウント前に空白はトリム・圧縮されます。動的な説明文は検査しません。 | ||
|
|
||
| ## なぜ重要か | ||
|
|
||
| 説明文が短すぎると検索スニペットを活かしきれず、長すぎると検索エンジンに切り詰められて行動喚起が途切れます。 | ||
|
|
||
| ## 修正方法 | ||
|
|
||
| ```svelte | ||
| <svelte:head> | ||
| <meta | ||
| name="description" | ||
| content="このページでは、SvelteKit で構築したサイトの SEO を強化し、検索結果での表示やクリック率を改善するための具体的な手順をわかりやすく解説します。" | ||
| /> | ||
| </svelte:head> | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: SEO022 · Title length | ||
| description: The document title should be 30–60 characters. | ||
| --- | ||
|
|
||
| **Severity:** info | ||
|
|
||
| ## What it checks | ||
|
|
||
| Flags a static `<title>` whose visible text is shorter than 30 or longer than 60 characters. Whitespace is trimmed and collapsed before counting; dynamic titles are not checked. | ||
|
|
||
| ## Why it matters | ||
|
|
||
| A title that is too short wastes the strongest on-page SEO signal; one that is too long is truncated in search results, hiding the end of your headline. | ||
|
|
||
| ## How to fix | ||
|
|
||
| ```svelte | ||
| <svelte:head> | ||
| <title>Concise, descriptive page title (30–60 chars)</title> | ||
| </svelte:head> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: SEO023 · Description length | ||
| description: The meta description should be 70–160 characters. | ||
| --- | ||
|
|
||
| **Severity:** info | ||
|
|
||
| ## What it checks | ||
|
|
||
| Flags a static `<meta name="description">` whose content is shorter than 70 or longer than 160 characters. Whitespace is trimmed and collapsed before counting; dynamic descriptions are not checked. | ||
|
|
||
| ## Why it matters | ||
|
|
||
| A description that is too short under-uses the search snippet; one that is too long is truncated by search engines, cutting off your call to action. | ||
|
|
||
| ## How to fix | ||
|
|
||
| ```svelte | ||
| <svelte:head> | ||
| <meta name="description" content="A concise, compelling summary of the page in roughly 70–160 characters." /> | ||
| </svelte:head> | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.