Skip to main content

Publish articles written in Markdown files to medium.com, dev.to, hashnode and twitter

Project description

Publish markdown

Publish articles written in Markdown files to the following platforms:

  • medium.com
  • dev.to

Markdown files should include YAML frontmatter with at least a title. Adding tags will help your posts reach a wider audience on the target platforms:

---
title: Some title or other
tags: ["webdev", "writing"]
---

{content in Markdown}

I wrote this to cross-post article from my own Jekyll blog, in a GitHub workflow (which I may yet publish as an action).

Installation

$ pip3 install publish-markdown

Publishing to medium.com

$ export MEDIUM_TOKEN={your-integration-token}
$ publish-to-medium _posts/2022-01-01-my-first-post.md --canonical-url="https://my-blog.com/2022/01/02/my-first-post"
Found user ID: {your-user-id}
- Article published at https://medium.com/@auser/my-first-post-50134f3aeba0
- Added 'medium.com' to 'published_to' metadata

Optimisations

You can avoid the code having to retrieve your user ID every time by setting it as an environment variable as well:

export MEDIUM_USER_ID={your-user-id}

Publishing to dev.to

$ export DEV_TO_TOKEN={your-api-token}
$ publish-to-DEV _posts/2022-01-01-my-first-post.md --canonical-url="https://my-blog.com/2022/01/02/my-first-post"
- Article published at https://dev.to/auser/my-first-post-74n
- Added 'dev.to' to 'published_to' metadata

Is cross-posting allowed / a good idea?

Cross-posting to extra platforms gets your post to be seen by more communities. This is mostly a good thing - people in one community are unlikely to also be in another simultaneously.

While plainly duplicating content on the internet is not generally a good idea, cross-posting or syndicating is fine where it's done right. Dev.to, Medium and Hashnode all explicitly support cross-posting, by providing the ability to set a rel=canonical meta tag inside their posts. And Google explicitly mention syndication of articles as a legitimate use of the rel=canonical tag.

So yes, cross-posting is a good idea.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publish-markdown-0.2.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file publish-markdown-0.2.1.tar.gz.

File metadata

  • Download URL: publish-markdown-0.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for publish-markdown-0.2.1.tar.gz
Algorithm Hash digest
SHA256 dc0088a7301a24283957bb9e8d86d8d89b92a76af7efe07c1ea3f738cb9c6265
MD5 96ae54ccca0775f5cb0886907fbd8d15
BLAKE2b-256 d3b211dce18b56df68a2adf9599d8c097879dafff5b59e895e559281ae108b4d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page