Preview checker: a long `og:title` or `og:description` gets no warning when the page also has a normal title and description
维护者通常 2 天内回复
@Imhamza86 已经在做这个了。
开始于 2026年12月4日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
从src/lib/meta-analyzer.ts开始,阅读现有的标题和描述长度检查,然后查看tests/lib/meta-analyzer.test.ts中的相关用例。补充覆盖长 Open Graph 值与普通值,以及文本匹配与不匹配的情况。指定的警告和分数扣减均有覆盖、现有回退行为得到保留,并且列出的检查全部通过,即为完成。
由索引模型根据 Issue 内容生成。
描述
analyzeMeta only checks the length of one title and one description: tags.title || tags.ogTitle and tags.description || tags.ogDescription (src/lib/meta-analyzer.ts lines 21 and 35). So when a page has a <title> and a meta description, the og:title and og:description never get measured, and those are the ones the social previews show.
I ran parseMetaTags and analyzeMeta on the current dev with a page where everything else is set:
everything normal → score 100 (A), no issues
og:title is 116 chars → score 100 (A), no issues
og:description is 418 chars → score 100 (A), no issues
<title> is 116 chars → score 95 (A), "Title is 116 chars (recommended: under 70)"
#333 made the title check fall back to og:title when there's no <title>. This is the other half: a page that has both.
What to do
- After the current title check, also check
og:titlewhen it's set and isn't the same text as the title that was just checked. Over 70 characters gives a warning on theog:titletag, likeog:title is 116 chars (recommended: under 70), and takes 5 points like the title does. - Do the same for
og:descriptionover 160 characters, as a warning on theog:descriptiontag that takes 3 points like the description does. - When there's no
<title>or no meta description, keep what happens now: the Open Graph value is the one that gets checked, once. - The "too short" description warning stays as it is, this one is only about values that are too long.
- The test
prefers the HTML title when both title sources are presentintests/lib/meta-analyzer.test.tsexpects no warning for exactly this case, so it has to change.
Acceptance criteria
- A 116 character
og:titlenext to a normal<title>gets theog:titlewarning and scores 95 - A 418 character
og:descriptionnext to a normal description gets theog:descriptionwarning and scores 97 - A long
<title>and a longog:titlewith different text get one warning each - The same long text in
<title>andog:titlegets one warning, not two - Pages without a
<title>or meta description come out exactly as before - A test that fails on the current code
-
npm run check,npm run testandnpm run buildpass
How to test
Run the new tests, then npm run dev, open /preview and check a page with a short <title> and a long og:title. The report should list the og:title warning.
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #458 in the description.
- 主要语言
- TypeScript
- 星标
- 8
- 派生
- 4
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 34
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/ogcops 的其他 Issue
-
Preview checker: a page that only has `og:image:url` is reported as having no image可能已有人在做 @MugdhoAI 今天认领。 未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 88/100
codercops/ogcops#455 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug] “Copy Recommended Meta Tags” generates an unusable placeholder image URL可能重新可做 @CreatorguyS 于 34 天前认领,目前没有进行中的 PR。 未关闭bug enhancement
难度 2/5 1-3 小时 新手友好度 72/100
codercops/ogcops#378 · 4 条评论 ·
维护者通常 2 天内回复
-
good first issue templates
难度 3/5 1-2 天 新手友好度 76/100
维护者通常 2 天内回复
-
good first issue templates
难度 3/5 1-2 天 新手友好度 78/100
维护者通常 2 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
codercops/ogcops#341 · 2 条评论 ·
维护者通常 2 天内回复
相似的 Issue
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
难度 2/5 1-3 小时 新手友好度 82/100
openclaw/openclaw#212827 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Use one constant for the 10,000-character input limit可能已有人在做 @NginxL 今天认领。 未关闭good first issue refactor
难度 2/5 1-3 小时 新手友好度 78/100
aniru-dh21/snap-validate#51 ·
维护者通常 1 天内回复
-
dependencies effort: small good first issue priority: low
难度 1/5 1-3 小时 新手友好度 88/100
TMHSDigital/screencast-mcp#509 ·
维护者通常 1 天内回复
-
from-review tech-debt testing
难度 2/5 1-3 小时 新手友好度 82/100
blamechris/chroxy#9520 ·
维护者通常 1 天内回复