DEV Community

Cover image for Introducing Papertown
Christian Kohler
Christian Kohler

Posted on β€’ Edited on β€’ Originally published at christiankohler.net

6

Introducing Papertown

Papertown syncs you personal markdown blog with blog platforms like dev.to. It's a command line tool and works perfectly in combination with static blog frameworks like Gatsby.

The idea πŸ’‘

The core idea of Papertown is that it runs on every commit and creates and updates blogpost on dev.to and other platforms.

// Current setup
+-----------+       +-----------+        +-----------+
| Commit md |  ---> |  Gatsby   |  --->  |  Webhost  |
+-----------+       +-----------+        +-----------+
// With Papertown

                    +-----------+        +-----------+
                  / |  Gatsby   |  --->  |  Webhost  |
+-----------+    /  +-----------+        +-----------+
| Commit md |
+-----------+    \  +-----------+        +-----------+
                  \ | Papertown |  --->  | devto etc |
                    +-----------+        +-----------+

Why did I write it? πŸ“

I had two requirements for my personal blog:

βœ… Blog content is owned and managed by me

βœ… I want to syndicate my post on other platforms as easy as possible

How to use it πŸš€

The easiest way to get started is to just run it locally with npx within you blog root folder:

npx papertown sync --devtoApiKey apikey

Don't worry, no blogpost are pushed to dev.to unless you add a masterid to a blogpost

Masterid?

Papertown needs an Id to identify blogpost and update them. Blogpost without a masterid are ignored.

---
title: "Minimal Blogpost example frontmatter"
author: "Chris Kohler"
masterid: 20191109
published: false
canonical_url: "https://christiankohler.net/url-to-this-blogpost"
---

Draft or published?

Add published: false if you don't want to publish the blogpost right now.

published: false

Correct root folder

The default rootfolder is blog-articles. To change it just set the root folder:

papertown sync --rootFolder posts

Alternatives to Papertown πŸ”­

There are two solutions I know of:

RSS feed support by dev.to

RSS feed support is not bad but is not as flexibel as I'd wish for updates and drafts.

Use dev.to as a source together with Gastby

Dev.to as a source is not an option for me since I want to be the master of the blog articles.

Source πŸ‘¨β€πŸ’»

Source is MIT and on Github: https://github.com/ChristianKohler/papertown

What's next? πŸ‘€

Over the next weeks I will focus on the dev.to integration and fixing bugs. The highest prioritiy currently is adding support for images. After that I will start to work on the medium integration. If you would like to help please open an issue or pr on Github. All contributions are appreciated.

Update

Version 1.2.0 comes with image support. That means that relative urls are now converted to github raw urls.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay