Skip to content

[codex] Add writing sync workflow - #5

Merged
dbtlr merged 1 commit into
mainfrom
codex/sync-writing
Jun 20, 2026
Merged

[codex] Add writing sync workflow#5
dbtlr merged 1 commit into
mainfrom
codex/sync-writing

Conversation

@dbtlr

@dbtlr dbtlr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a local writing sync workflow for publishing blog posts authored outside the repository into Astro's writing content collection.

What changed

  • Added pnpm sync:writing, backed by scripts/sync-writing.ts.
  • Loads DBTLR_WRITING_SOURCE_DIR from local .env via dotenv; .env is gitignored.
  • Syncs only status: published Markdown files and skips drafts/stubs.
  • Generates Astro-compatible Markdown in src/content/writing/.
  • Tracks stable source-to-slug mappings in src/content/writing/.sync-manifest.json using source-relative filenames, not absolute local paths.
  • Supports --dry-run, --prune, and --rename-slugs.
  • Adds synced writing posts to the build-time search index.
  • Documents the workflow in the README.

Validation

  • pnpm sync:writing -- --dry-run
  • Fixture tests for draft skip, create/update, stable title-change slugs, prune, and opt-in slug rename
  • pnpm exec tsc --ignoreConfig --noEmit --module NodeNext --moduleResolution NodeNext --target ES2024 --types node --esModuleInterop scripts/sync-writing.ts
  • pnpm check
  • pnpm build

pnpm check and pnpm build still show the known empty-writing collection warning until the first article exists.

@github-actions

Copy link
Copy Markdown

🔎 Preview deploy

https://52231f28-dbtlr-com.dbs-account.workers.dev

Updated for 7fce9f2 · ephemeral version, not production.

@dbtlr
dbtlr marked this pull request as ready for review June 20, 2026 03:07
@dbtlr
dbtlr merged commit 064252c into main Jun 20, 2026
1 check passed
@dbtlr
dbtlr deleted the codex/sync-writing branch June 20, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant