Publish: lint internal links that point at non-live posts

オープン
#2 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
markdown, sqlite, typescript
領域
backend, content

調査の方向性

Start in buildLiveSet in src/lib/server/publish.ts, where the publish pass already has the live slug set when it renders post bodies. The new pure function findLinkProblems(body, liveSlugs) belongs in its own module with a *.check.ts file covering the listed link cases. Done means the check passes for every case, warnings appear per post in the Publish view, editor-route links disable the Publish button with a reason, and the rendered .svx text is unchanged.

索引モデルが issue の本文から書いたものです。

説明

good first issue

Context

Posts link to each other by hand with a root-relative slug (/gear). Nothing checks that the target is a live post, so links to drafts, renamed posts and pasted titles ship broken. Publish already knows the full live set when it renders post bodies (buildLiveSet in src/lib/server/publish.ts).

Scope

In the publish pass, scan each live body for links and report:

  • root-relative hrefs whose first segment is not a live slug: a warning per link, shown in the Publish view;
  • hrefs that contain the editor's own origin or start with /posts/ (an editor route, not a site route): block the publish.

Acceptance criteria

  • A pure function findLinkProblems(body, liveSlugs) in its own module with a *.check.ts covering: live slug, unknown slug, renamed slug, editor-route href, external link, anchor-only link, and a title pasted as a path.
  • The Publish view lists warnings per post; editor-route links disable the Publish button with the reason.
  • No change to the rendered .svx text.

Estimate: about 3 hours.

主要言語
HTML
スター
0
フォーク
0
平均マージ
1分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mrgnw/cfcms のほかの issue

mrgnw/cfcms の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。