Notes / 2026-10-23

JSON Feed and Subpath Media

Adding JSON Feed alongside RSS, and notes on media, canonical URLs and checks under a GitHub Pages subpath.

1 min readastroseojson-feed

Why add a JSON Feed

RSS suits readers; JSON Feed suits scripts and front-end consumption. /feed.json was added, merging projects and notes, at most 20 entries, with application/feed+json declared in the page head.

Subpaths

When deployed at https://guidchen.github.io/dsh-personalnet/, every in-site URL must carry BASE_PATH:

  • Media at /media/projects/... gets the base added by the components;
  • The absolute addresses of canonical URLs and JSON Feed entries are generated by absoluteUrl;
  • check-dist and check-budget support BASE_PATH, avoiding mistaking a subpath for a missing asset.

Verification

After the build, the version and entry count of feed.json are checked; RSS is kept as well, and neither replaces the other. Running check-dist again on a subpath build catches, in advance, 404s that only appear on GitHub Pages.

Implementation index

  • src/pages/feed.json.ts: feed generation and Content-Type.
  • src/lib/seo.ts: subpath handling for absoluteUrl / toDate.
  • scripts/check-dist.mjs: feed entry and version checks.

Command palette

Esc

↑↓ selectEnter runEsc close