Automating Multi‑Platform Content Publishing with JSON Manifests in a Date‑Based Repo
Automating Multi‑Platform Content Publishing with JSON Manifests in a Date‑Based Repo TL;DR: I added a small Node CLI that walks the content/ tree, generates platform‑specific JSON payloads (Bluesky in this case) and flips the bluesky_published flag in each metadata.json . The change lets us push daily posts without manual file edits, and the repo now reflects the true publishing state. The…
The article discusses automating multi-platform content publishing using JSON manifests within a date-based repository. The problem was that manual copying and toggling of JSON files and metadata flags was required for publishing, leading to issues like the bluesky_published flag remaining false post-publishing, which caused CI checks to flag the post as not live.
The author implemented a Node.js CLI script (scripts/publish.js) that recursively scans the content tree for directories with metadata.json files. For each such directory, it checks for a corresponding Bluesky JSON payload. If the payload exists and bluesky_published is false, the script:
1. Calls the Bluesky API with the payload (with a stubbed API function for now)
2. Updates metadata.json to mark bluesky_published as true and records the returned URI under bluesky_uris
3. Writes a log entry to stdout
4. Handles cases where no Bluesky payload is found, logging a skip message
The implementation includes validation checks to avoid marking posts as published when the required payload is missing. The script can be run with `node scripts/publish.js` and handles both English and Spanish Bluesky payloads. The change eliminates the need for manual edits and ensures the repo accurately reflects the publishing state.
Rewritten by urgent.news; may contain errors — check the original. How we use AI.
Source: dev.to