Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 2.79 KB

File metadata and controls

64 lines (41 loc) · 2.79 KB
dev.to

dev.to articles

Source for the articles auto-published under 0-draft/dev.to.

publish workflow schedule workflow dev.to profile


Pushing to main triggers .github/workflows/publish.yml, which syncs changed articles/*.md to dev.to through @sinedied/devto-cli. Set published: true in the frontmatter when an article is ready, or leave published: false with a future date: (UTC) and let the hourly schedule.yml cron flip it once the scheduled time arrives.

Writing

cp templates/article-template.md articles/<slug>.md

The slug becomes part of the dev.to URL (dev.to appends a random suffix on first publish). Local-only drafts and Japanese versions live under articles/DRAFT/ and articles/JA/, both gitignored, so nothing in those directories ever reaches dev.to.

Assets

Images and hands-on resources go under articles/assets/<slug>/. The publish step runs dev push -r ${{ github.repository }}, which rewrites relative asset paths to raw.githubusercontent.com URLs before sending to dev.to. Cover images at the canonical size (1000x420) can be generated with scripts/gen_cover_image.py.

Frontmatter writeback

After publishing, devto-cli writes the dev.to id and date back into the frontmatter, and the bot commits the change as chore: update article metadata from dev.to [skip ci]. Pull before the next edit so the local copy doesn't diverge.

API key

A repo secret DEVTO_API_KEY is required; generate it from your dev.to account settings and add it under repo Settings → Secrets and variables → Actions.