Creating your Blog using GatsbyJS and Dev.to API

Aivan Monceller on March 31, 2019

TLDR: You can go to the demo on what this is all about. Nonetheless, this is really very easy even if you don't know about GatsbyJS. I have seen... [Read Full]
markdown guide
 

So, I decided to try my hand at making a source for Gatsby, even though I'm very new to it. I saw that there were an API for Dev.to and thought, hey, I should make a source for dev.to. Starting to look for the dev.to api, found this...

 

Smart thinking! I really prefer the experience that Dev.to creates for bloggers and their audience, but I want my entries on my own site as well. I was going to spin up cross-posting in the next iteration of my site, but this is a lot better!

 

Interesting stuff, this is why I love Gatsby!

Does dev.to have the ability to fire off a webhook when you publish (or a comment is made)? Thinking thats the best way to ensure that your site always has the latest content.

 

That would definitely be a great feature, I hope Dev.to will consider to add support for webhooks.

 

I added a blog header just like dev.to

screenshot

I'm cleaning it up and setting up social icons for being parameterizable, then I will submit the PR.

 
 

Excellent share and tool! Can you pull over comments too? Planning in building a site with gatsby and the cross post issue would defo solved with this approach. Thank you for building it.

 

I will look into the API and check if it provides such functionality.

 

This is a great idea. Hosting your stuff on your own site makes a lot of sense, but if you're going to write and publish on dev.to, then why not use it as your CMS too.

Fantastic use for Gatsby!

 

Nice job, it is very simple.

I will try to find a way to:

  • Exclude some posts, so you can show just what you want.
  • Sync comments (it could be a scheduled task)
 

sooo.. youre posting in dev.to and your site magically have it too?

 

That is the idea. However, this does not happen magically. You need to trigger a manual gatsby build. It could be automated once Dev.to supports webhooks 👍

 

Nice post. I also wrote a post more in details about how to create your first blog site using Gatsby. zeptobook.com/create-your-blog-sit...

 
 

Brilliant! I was thinking about this over the weekend so I'm glad I found your post to get me thinking more seriously about this.

code of conduct - report abuse