DEV Community

Patryk Jeziorowski
Patryk Jeziorowski

Posted on • Originally published at cyberwritings.com

How I publish articles to all developer platforms (and my private blog) in one shot

Where to host your blog?

Qovery CEO, Romaric has just started his own blog on hashnode. I become jealous, so I started thinking about blogging again. I couldn't decide where to publish my content, though:

The answer > everywhere!

To reach the highest number of people, I decided to publish it everywhere with automated content distribution tools. Unluckily, I couldn't find any tool that would meet my needs:

  • allowing me to write just once
  • have it published automagically everywhere

In this post, I'll show you how I achieved what I wanted - I hope you'll find it helpful on your own blogging adventure.

Markdown

My blog uses markdown to build the HTML for the articles. Markdown is quite good for it as it's very portable. All, Hashnode, Dev.to, and Medium support markdown in their APIs. This is perfect - it allows me to write a single markdown file and have it published everywhere.

After the markdown file (the article) is written down, we need to use APIs. So, the tool needs to take the markdown and deliver it in the correct format to APIs of all the different platforms we target.

CLI

The first version of the tool is a simple CLI app. It's relatively fast to create and validates the concept quickly - we don't need backends, UIs or any other crazy stuff from the very beginning. BTW, I named the app Rollout to refer to it in this post more easily, hah!

Using Rollout

I won't go over the details of how the CLI is implemented (as it's not the topic of this post, it's very simple, though - you can see the code here).
I'll jump straight into showing how to use the tool and how simple it is to have your posts published everywhere.

1 Install the tool

MacOS

brew tap pjeziorowski/rollout-cli
brew install rollout-cli
Enter fullscreen mode Exit fullscreen mode

Windows/Linux

If you are on Linux/Windows, for now you need to build the app from the source. I'll improve it soon!

2 Write the article - this is definitely the most challenging part! Luckily for you, I wrote one that you can use for the test!

echo "---
title: "Test Rollout CLI"
canonical_url: https://google.com/test
tags: [Blogging, Automation]
---  
## Hello Rollout!
" > ./test.md
Enter fullscreen mode Exit fullscreen mode

3 Distribute the article

rollout test.md
Enter fullscreen mode Exit fullscreen mode
  • P.S. you also need to provide API tokens for the tool to use, it'll show you a hint you when you give it a try.

Congrats! Your post is now published everywhere

Hey... Did you forget somethin? You only published to Dev.to, Hashnode and Medium. What about your (and mine!) private blog?

Well, in my workflow, I publish posts to my blog by simply pushing markdown to my Github repository, so the tool doesn't have to do anything more. It's enough for me now, but in the future, Rollout could also be integrated with any headless CMS, for example. If I had a WordPress blog, I would simply use the WordPress API to push the article there. Luckily for me, all I have to do is store my posts on Github. If it's the same for you, welcome to the happy bloggers club!

It's open-sourced!

As I mentioned earlier, you can see the tool's code in its Github repository.
If you like the idea or the tool works for you - please give it a star and leave a feedback comment (if they are yet implemented on this site, ha) or contact me on Twitter/Linkedin directly.

If I see interest in the tool, I'll put more work to make it more versatile and probably create a UI (SPA) and some backend for managing the content and configuration. Contributions and suggestions are also very welcome!

BTW - this article was published with Rollout!

Top comments (9)

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

FYI: If you don't use canonical meta tag (Dev.to support it) and publish article to all those platforms, they will be recognized as duplicate by Google. It's bad SEO practice to create duplicate content.

Collapse
 
pjeziorowski profile image
Patryk Jeziorowski

Good point! I know about it - there's canonical_url: https://google.com/test in the markdown from the example - it's value is passed to all the services :)

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

Nice. Didn't notice that.

Collapse
 
philippmayrth profile image
Philipp

I have a similar tool supporting only WordPress and dev.to for now and pulling data from a headless cm/s. Iā€™d be interested in shelling out to your tool for developer blogs. Do you plan to support updating the articles? From what I can tell (Iā€™m not good in Go) there is nothing in the code to support that.

Collapse
 
pjeziorowski profile image
Patryk Jeziorowski

Hey! Yes, I do plan to add support for updating the articles. It's a must-have for blogging for sure :)

It would be great if we could merge the tools together - adding WordPress support + pulling the data from your CMS + edit/update article feature seem like reasonable next steps to me.

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
pjeziorowski profile image
Patryk Jeziorowski

I'll take a look, thanks for the link

Collapse
 
dorneanu profile image
Victor Dorneanu

This is exactly what I was looking for! Any plans to have this as a Github Action?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.