Cross posting done right. Publish your article like a boss to Medium, Hashnode, and dev.to
In your terminal:
npm i -g crossposting
Adding keys for publishing it:
# [platform]: dev | hashnode | medium
# crosspost [command] - can also be used
cpt setk [platform]
more info: Obtaining key from dev.to | medium | hashnode
url|path
is the URL or the path to your article. It can either upload from a website like medium.com or from your local folder.
cpt <url|path> [options]
You can set title, tags, canonicalUrl, mainImage from the command line, from the frontmatter inside your markdown files, or you can leave to us (we will try our best). We recommend that you get used to adding frontmatter to your .md files when writing:
# post.md
# frontmatter section
---
title: The best author
canonical: https://originalsitepublished.com
main_image: sameAsImageUrlInCli.jpg
tags:
- life
- amazing
- great
---
And then inside the folder you would just:
cpt post.md
It is that easy!
Definitely you can. Crossposting was created to be used in scenarios where you already have your articles out there. For that use like that:
cpt https://www.article.com/all-good -t Life Good -i ./image.png -tags life amazing
We will assume the url above as the canonical one.
Sure you can. Just remove the canonical url info from you .md files and you are set to go.
cpt post.md
To even more customization cross post your articles, you will use the following command:
-p, --platforms [platforms...]
The platform(s) you want to post the article on. By default: all platforms with a KEY token set.cross-post <url> -p dev hashnode
-t, --title [title]
The title by default will be taken from the URL you supplied, however, if you want to use a different title you can supply it in this option.-tg, --tags <tags...>
Tags for the article-c, --canonical-url [canonicalUrl]
Original url the article was published first. It is mandatory for SEO-i, --image-url [imageUrl]
this will use the image URL you provide as a value for main cover inside your post.-si, --skip-image
Skip image main cover.-pu, --public
by default, the article will be posted as a draft (or hidden for Hashnode). You can pass this option to post it publicly.
The tokens are only saved inside your computer.
- After logging into your account on dev.to.
- Go to https://dev.to/settings/extensions#api
- Generate API Key
cross-post setk dev
- After logging into your account on hashnode.com.
- Go to https://hashnode.com/settings/developer
- Generate new token
cross-post setk hashnode
- After logging into your account on medium.com.
- Go to https://medium.com/me/settings/security
- Integration tokens (end of the page)
- Get token
cross-post setk medium
This repository initially started as a fork of the crosspost project. Over time, it became apparent that the codebase needed to diverge significantly to meet our unique set of requirements and to optimize for performance, maintainability, and scalability.
- Refactoring for Performance: Extensive refactoring has been carried out to make the codebase leaner, more efficient, and significantly faster.
- Modular Design: The code has been restructured into a more modular design to make it easier for other developers to understand, contribute to, and maintain.
- Improved Documentation: Comprehensive documentation has been added, making it easier for new developers to get started and for users to understand the project's capabilities.
- Automated Workflows: Integration with CI/CD pipelines like GitHub Actions has been established for automated deployment, ensuring that the code in the main branch is always deployable.
Due to the extensive changes and the divergent paths of the original cross-post-blog and this repository, it became necessary to detach and establish this as a standalone repository. This allows for more focused development and issue tracking tailored specifically to the features and architecture of this project.
We are open to contributions and actively seeking collaborators who are interested in making this project even better. If you encounter any issues or have feature requests, please feel free to open an issue or submit a pull request.
MIT