Docs: generate a share image for every docs page

未关闭
#118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃

调研方向

Start in app/docs/[...slug]/page.tsx and lib/marketing/metadata.ts, where the per-page title and description are set, then look for an existing opengraph-image route in app/ (the blog may have one) to copy. Add the image URL, width, height and alt text to the Open Graph and Twitter metadata, and add a test for at least one docs page. Done when every /docs page has its own image showing its title and section, long titles wrap without overflowing, and pnpm test and pnpm build pass.

由索引模型根据 Issue 内容生成。

描述

documentation enhancement frontend help wanted

Copied from DeadantCo/answerLoops#108 · originally opened by sethr07 on 2026-11-20

Copied from https://github.com/answerLoops/answerLoops/issues/479 — originally opened by @NathanTarbert on 2026-10-26

Problem

When a docs page is shared (Slack, Discord, X, a link preview) it shows the same generic card for every page, so every shared link looks the same. A shared link to the Slack guide should say it is the Slack guide.

Where

  • app/docs/[...slug]/page.tsx builds each docs page's metadata. It already sets the title and description through publicPageMetadata in lib/marketing/metadata.ts.
  • Next.js supports generated Open Graph images through an opengraph-image route file, and the blog may already do something similar; check app/ for an existing example to reuse.

Suggested approach

Generate a share image per docs page at build time: the page title, its section (for example "Integrations"), and the answerLoops mark, on the docs navy and teal. Keep it deterministic so the same page always produces the same image. Add the image to the page's Open Graph and Twitter card metadata.

Acceptance criteria

  • Every page under /docs has its own share image showing its title and section.
  • The metadata includes the image URL, width, height and alt text.
  • Long titles wrap or shrink without overflowing the card.
  • Images are generated at build time (no per-request cost) and the build time stays reasonable.
  • pnpm test and pnpm build pass, and a test covers the metadata for at least one page.

Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.

主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DeadantCo/answerLoopsdev 的其他 Issue

查看 DeadantCo/answerLoopsdev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。