DEV Community

Discussion on: Do you have your own Gatsby site? Let's brainstorm a dev.to cross-poster

Collapse
 
qm3ster profile image
Mihail Malo

A little confused: How do you use feature branches for draft posts if your posts are in a CMS API, not the repo?
Do you make a branch where the only difference is that it fetches and renders "draft" posts in addition to "published"?

Collapse
 
irreverentmike profile image
Mike Bifulco

Yeah, that's a great question! So while I do like using a CMS to keep my content online, I like the idea of keeping a copy of my actual blog content in the repo, so future migrations aren't a total headache. My (somewhat convoluted) workflow is currently as follows:

  1. I author the post in my repo locally using typora. These posts go in the /src/posts/drafts folder in the repo, and are generally added to source control by way of a PR from a branch with a name like draft/post-name.

  2. Once the post is ready to go, I create a header image using SketchApp

  3. I make the post public by publishing it via TakeShape

  4. I then cross-post to dev.to by starting a new post from the markdown in my repo, and uploading any missing images, and setting the canonical_url to my own blog