Skip to content

0-draft/dev.to

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

675 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

 
 
 

Contributors