DEV Community

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

Collapse
 
cdvillard profile image
Charles D. Villard

It's funny how so many people can start thinking about the same thing in a given timespan. The folks at StackBit have a formal project working with The Practical Dev called #projectbenatar for a similar purpose, and I've personally been trying to write a script to manage this on build.

In my case, I have a Gridsome site using Netlify CMS for editing and Netlify for hosting. My goal has been to run a script after the build step to pull the latest file content from a posts folder, transform that into a POST request, and send that along to the DEV API. With GitHub's v3 Content API, you can retrieve a base64-encoded version of the file content, but then that means a lot of decoding and string manipulation.