Docs search: let pages declare tags so related searches find them

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

还没有人认领这个 Issue。

评估

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

调研方向

Start with the search endpoint in app/docs/api/search/route.ts and the docs frontmatter schema in source.config.ts, where the blog's optional tags list shows the pattern to follow. Check how the search index is built and whether it can weight tags above body text. Done means a page is found by a tag that does not appear in its body, existing pages still validate, and pnpm test and pnpm build pass.

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

描述

documentation enhancement frontend help wanted

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

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

Problem

Docs search matches page titles and body text, but nothing else. Someone searching "webhook", "SSO" or "Ollama" gets results ordered only by where the word happens to appear, and a page can't say what else it should be found for. A visitor looking for "self-host" or "Docker" can miss the right page because it uses different words.

Where

  • app/docs/api/search/route.ts serves the search (built on Fumadocs' createFromSource).
  • source.config.ts defines the docs frontmatter schema.
  • The blog already has an optional tags list in its frontmatter (source.config.ts), which is a pattern to follow.

Suggested approach

  1. Add an optional tags field (a list of strings) to the docs frontmatter schema.
  2. Include the tags in the search index so they influence matching, and check whether the search library supports weighting them above body text.
  3. Add useful tags to the pages people search for most (the integrations, self-hosting and billing pages first).
  4. Check the result list shows enough context to tell similar pages apart.

Acceptance criteria

  • Docs frontmatter accepts an optional tags list, and existing pages still validate.
  • A search for a tag that doesn't appear in a page's body still finds that page.
  • At least the top 15 most-visited pages have sensible tags.
  • A test covers the search route returning a page by tag.
  • pnpm test and pnpm build pass.

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 摘要。