How to post on DEV and still own your content effortlessly.
Tags: gatsby, tutorial
Published: 2020-12-30 20:22:03

---
title: How to post on DEV and still own your content effortlessly.
published: true
description: Some bloggers are asking how to set up a custom domain on DEV. It is not possible but there is an easy workaround.
tags: gatsby, tutorial
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ssovcu1s2haofnn63phj.jpg
---

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](https://github.com/gatsbyjs/gatsby-starter-blog) and click on ["Deploy to Netlify"](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-blog) button which is at the bottom of the page.

Follow all of the steps and tada :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](https://docs.netlify.com/domains-https/netlify-dns/domain-registration/#register-a-new-domain).

### 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](https://www.gatsbyjs.com/plugins/gatsby-plugin-canonical-urls/) 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`.
4. Push changes to my repo.
5. Publish my post on DEV.

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