Add a social preview image (og:image) to the Pages site
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- html, python
调研方向
从 overrides/main.html 开始,阅读 extrahead 块,它已经会输出 og:title、og:description、og:url 和 twitter:card;确认它通过 mkdocs.yml 中的 theme.custom_dir 被纳入。将 1200x630 的 PNG 添加到 docs/assets/ 下,然后添加 og:image、width/height 和 twitter:image meta 标签,并将 twitter:card 切换为 summary_large_image。用 python scripts/prepare-mkdocs.py 和 mkdocs build --strict 验证,然后检查 site/index.html 中的 og:image,以及所引用的图片确实能加载。
由索引模型根据 Issue 内容生成。
描述
Summary
Shared links to the site now carry a title and description (Open Graph and Twitter tags), but no image. Most chat apps and social feeds show a bare text card without one, which is easy to scroll past.
Where
overrides/main.html(extraheadblock)mkdocs.yml(theme.custom_dir)
Details
overrides/main.html emits og:title, og:description, og:url, and twitter:card set to summary. There is no og:image or twitter:image, because the repo has no image made for previews.
Suggested fix
Add a 1200x630 PNG (for example docs/assets/social-card.png) with the project name and tagline, then in overrides/main.html add:
<meta property="og:image" content="{{ config.site_url }}assets/social-card.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:image" content="{{ config.site_url }}assets/social-card.png">
and switch twitter:card to summary_large_image. Material's built-in social plugin is an alternative, but it needs Cairo and Pillow system libraries in CI.
Acceptance criteria
- Every built page has
og:imagepointing to an image that loads. -
mkdocs build --strictstill passes.
Getting started
- Relevant files:
overrides/main.html,mkdocs.yml - How to check:
python scripts/prepare-mkdocs.pythenmkdocs build --strict, and look forog:imageinsite/index.html.
Filed by repo-audit/pages-site at c8f223f. Severity: low. Effort: S. audit-key: enhancement|overrides/main.html|og:image
- 主要语言
- Python
- 星标
- 2
- 派生
- 5
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/Awesome-Ads 的其他 Issue
-
bug good first issue severity: low
难度 1/5 1-3 小时 新手友好度 85/100
TMHSDigital/Awesome-Ads#37 ·
维护者通常 1 天内回复
-
documentation help wanted severity: low
难度 2/5 半天 新手友好度 72/100
TMHSDigital/Awesome-Ads#29 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
TMHSDigital/Awesome-Ads#16 ·
维护者通常 1 天内回复
-
dependencies help wanted severity: low
难度 3/5 1-2 天 新手友好度 62/100
TMHSDigital/Awesome-Ads#27 · 1 条评论 ·
维护者通常 1 天内回复
查看 TMHSDigital/Awesome-Ads 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
datamodel-code-generator/datamodel-code-generator#6906 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
UKGovernmentBEIS/optstop#12 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
smokin-salmon/smoked-salmon#1095 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
Sienna-Platform/SiennaSchemas#130 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
samuelcolvin/dirty-equals#146 ·