Files
squid 573d0265f8
Frontend CI / build (push) Successful in 12m2s
BLOG-117 Auto generate sitemap and rss file (#303)
## Description

This PR generates sitemap.xml and feed.xml from the frontend instead of the manual/toolbox script, so
the public URL scheme lives in one place and the documents are never hand-mutated.

- New SvelteKit server routes /sitemap.xml and /feed.xml, generated on demand with a short
  Cache-Control (public, max-age=300). There is no server-side cache, so the app regenerates on a
  cache miss; browsers, crawlers and any intermediary honour the header.
- A shared PostPage entity and ListPostPagesUseCase map published posts to their public URLs using
  resolve(), so the frontend route table stays the single source of truth.
- sitemap.xml (sitemap package) lists every published post plus the static pages only the frontend
  knows about: home, post list, and the terms documents.
- feed.xml (feed package) contains only posts, capped at the 20 most recent. Static pages never
  appear in the feed.
- The backend now exposes, per post, the preview image mime type and size (for a valid RSS enclosure)
  and the post updated_time. The frontend uses updated_time as sitemap lastmod, while the feed pubDate
  remains the published time.

## Package Changes

| Package | Action | Version |
| --- | --- | --- |
| feed | Added | 6.0.0 |
| sitemap | Added | 9.0.1 |
| sanitize-html | Updated | 2.17.3 -> 2.17.7 |

No Cargo.toml changes.

## Screenshots

N/A (XML endpoints).

## Reference

Resolves #117

## Checklist

- [x] A milestone is set
- [x] The related issues has been linked to this branch

---
Generated by Zed coding agent with Deepseek Flash

Reviewed-on: #303
Co-authored-by: SquidSpirit <squid@squidspirit.com>
2026-09-23 22:39:42 +08:00
..