DEV Community

Cover image for How to post on DEV and still own your content effortlessly.
Michał Pietraszko
Michał Pietraszko

Posted on • Edited on • Originally published at michalpietraszko.com

How to post on DEV and still own your content effortlessly.

DEV is a great platform to start blogging but it doesn't give a straightforward way of owning your content. Some bloggers are asking how to set up a custom domain on DEV which unfortunately is not possible.

What does owning content mean and why would I want to do it?

It means that your content isn't bound to a specific platform.

If DEV becomes irrelevant then for any reason, you shouldn't be affected by it. Your content should accessible no matter what and you are the one deciding what happens to it. Locking yourself to a specific platform will set you back if you want to become independent at one point.

Why to post on DEV if you want to own your content?

The community. You can reach more people if you make your content visible in as many places as possible. Also, DEV enables interaction via comments. Don't forget the SEO it has.

How to post on DEV and still own my content? What is the secret?

Fortunately, there is a way to benefit from posting on DEV and content ownership.

You can achieve it effortlessly by using Netlify with Gatsby Starter Blog and making sure that canonical tags are properly maintained.

Why Gatsby starter blog?

It gives you a very good foundation for a personal blog that is very well optimised. Also, both DEV and Gatsby blog starter use markdown for content creation which boils down maintenance to copying markdown files and adjusting the front matter.

How do I do it?

Before you start.

Create a GitHub account if you don't have one already.

Setting up a personal blog.

Open gatsby blog starter repo which is available here and click on "Deploy to Netlify" button which is at the bottom of the page.

Follow all of the steps and tada 🎉 you have a Gatsby blog!

Buying and setting up a domain

It is not mandatory, but I strongly recommend doing it straight away. You'll avoid the pain of having to move content to a new domain if you decide to set it up later.

Follow the guide from Netlify which you can access here.

Modifying your Gatsby blog.

Pull your repository via your favourite GIT client.

Update siteUrl entry in gatsby-config.js file so it has your domain. This will ensure that all URLs are generated properly.

Delete all files from content/blog directory. You don't need example posts in your blog.

Adding canonical tags to your blog.

Now, the critical part. You have to update the site so it applies a canonical tag for each page.

Without it, Google will punish you for duplicating content.

The canonical tag tells Google which URL is the source.

Gatsby has a plugin for that, follow this guide to implement them.

Writing your content.

What I am doing at the moment is the following:

  1. Write my post on DEV.
  2. Update the front matter with canonical_url. In case of this post it looks like this: canonical_url: https://michalpietraszko.com/how-to-post-on-dev-and-still-own-your-content-effortlessly
  3. Copy the content to a markdown file in my repo. In my case it goes to content/blog/how-to-post-on-dev-and-still-won-your-content-effortlessly/index.md.
  4. Add entries to the front matter that are specific to my blog such as description or date.
  5. Push changes to my repo.
  6. Publish my post on DEV.

Rinse and repeat and enjoy the benefits of owning your content and DEV!

Top comments (0)