Skip to content

Repository files navigation

dev.to

dev.to articles

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

publish workflowschedule workflowvalidate workflowdev.to profile

106 articles (0 unpublished) · 106 live on dev.to · 152 reactions · 27 comments

Most reacted: RFC 8693 Deep Dive: Token Exchange (11 reactions)

Browse the full article index


Pushing to main triggers .github/workflows/publish.yml, which validates the changed articles/*.md and syncs them to dev.to in a single @sinedied/devto-cli batch. 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. It is passed to the CLI as DEVTO_TOKEN in the environment, never as a command-line flag.

Reusing this repository

If you fork or copy this repo to run your own dev.to sync, delete the id: and date: lines from any article you keep. Those ids belong to this account, and devto-cli aborts the whole batch with Cannot find published article on dev.to: <title> when it meets an id your token cannot see. scripts/check_devto_ids.py runs before every publish and names the offending files instead of leaving you with that one line.

If your articles already exist on dev.to but the local copies have no id, run the publish workflow manually with the reconcile input enabled. It matches local articles to remote ones by title and adopts their ids rather than creating duplicates.

Checks

validate.yml gates every push and pull request that touches an article. It runs three checks against the changed files only, so the pre-linter backlog in older articles never blocks new work:

CheckScriptBlocks on
Frontmatter and assetsscripts/validate_articles.pymore than 4 tags, non-lowercase tags, a relative or missing cover_image, a missing image, an SVG reference, an <img> with a relative src, a duplicate dev.to id
markdownlintscripts/lint_ratchet.pya change that adds markdownlint errors relative to the base revision
Linksscripts/check_links.pya dead dev.to/kanywst/... cross-link or a dead asset URL in this repo

audit.yml runs weekly and reports rather than blocks: full-corpus validation, third-party link rot, a dev push --dry-run drift check against dev.to, and a refresh of INDEX.md and the stats block above.

Everything is runnable locally:

make setup # .venv + pinned dependencies
make check # validate + lint + links, whole repo
make lint-changed validate-changed # exactly what CI gates on
make links-external # slow: reports third-party link rot
make index # regenerate INDEX.md and README stats
make diagrams # re-render every D2 source to PNG
make schedule-dry # what the scheduler would publish, writes nothing

License

Tooling (scripts/, .github/, Makefile, templates/) is MIT. Article content under articles/, including diagrams and images, is CC BY 4.0.