Publish: lint internal links that point at non-live posts
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown, sqlite, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.tscovering: 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
.svxtext.
Estimate: about 3 hours.
- Ngôn ngữ chính
- HTML
- Star
- 0
- Fork
- 0
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mrgnw/cfcms
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
G-nn-r/lg_heatpump#52 ·
-
grep: unknown parameter file_path is silently dropped, so the search runs over the whole cwdĐang mởarea: core bug priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
griffinwork40/agent-afk#4872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fleet size/m
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sipyourdrink-ltd/bernstein#7517 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG-MERGE-TO-HDR-RESULT-NAMECó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
storytold/photocraft#14025 ·
Maintainer thường phản hồi trong vòng 1 ngày