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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file publish-markdown-0.2.0.tar.gz
.
File metadata
- Download URL: publish-markdown-0.2.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d99e55cbdac83bfbcff190e48015c1b3a2d7f81c1f1e807908778b02c0b81992 |
|
MD5 | ca300529a0566c427ddec00fca7eaf59 |
|
BLAKE2b-256 | 8779fe272b568596df6a78be436c5af90a2b721c09dbba6505d6c8c6504faf07 |