Repository navigation
feat(blog): add a JSON feed for the app news tab - #9
Merged
Merged
Conversation
Adds /blog/feed.json (JSON Feed 1.1) built from the published posts, a feed autodiscovery link, a one-hour cache rule for it, and a privacy policy note on what the app's news tab fetches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vấn đề
App iOS sắp có tab Tin tức đọc danh sách bài viết của blog. Website chưa có feed nào (RSS hay JSON), nên app không có nguồn dữ liệu ổn định để đọc.
Thay đổi
/blog/feed.jsontheo chuẩn JSON Feed 1.1, sinh lúc build từ collectionblog. Mỗi bài cóid,url(có dấu/cuối vìtrailingSlash: 'always'),title,summary,date_published,date_modifiednếu có, vàtags. Bài nháp bị loại.src/lib/blog.ts: gom phần lọc nháp và sắp xếp mới nhất trước thànhgetPublishedPosts(), dùng chung cho trang/blog/, trang bài viết và feed.BaseLayout.astro: thêm<link rel="alternate" type="application/feed+json">để trình đọc RSS tự tìm thấy feed.nginx.conf: file.jsondùng chung rule cache 1 giờ với.xmlvà.txt, để bài mới hiện trong app nhanh.Kiểm thử
pnpm build:dist/blog/feed.jsoncó 11 bài (bài nhápwelcomebị loại), URL đúng dạnghttps://funput.app/blog/<id>/.pnpm check(0 lỗi) vàpnpm format:check: pass.curl -I https://funput.app/blog/feed.jsonđể xác nhận nginx trảapplication/jsonvà header cache.Thứ tự merge
Cần merge và deploy PR này trước khi phát hành tab Tin tức của app iOS (Funput/Funput, nhánh
feat/ios-news-tab). Nếu chưa có feed, tab đó sẽ báo không tải được bài.🤖 Generated with Claude Code