In an attempt to get back to writing more on things that interest me, I wanted to pull the blog over to a format that I could access readily via a CMS or simply through the code editor while I am writing markdown files.
To give context, the challenges that I needed to do:
Copy all existing posts into new repo.
Update markdown files to include metadata required for Gatsby template.
Update markdown files to remove the "h1" headings as it comes from metadata.
Setup blog.dennisokeeffe.com site on Netlify.
After deciding on Gatsby and Netlify CMS, I followed the steps outline on the Gatsby site. The decision for Netlify CMS came naturally as my main webstite and notes website are both currently being hosted on Netlify.
Step 1: Copy all the existing posted into new repo
This was the simplest step. The only requirement was to copy across what I previously had from the old repo to the new.
The challenges that came from that was that the format of the markdown files I brought across looked like this:
What I needed to do was update the content to look like so:
The only update above is the line to remove the heading with removeHeading(content).
Step 4: Setup blog.dennisokeeffe.com site on Netlify
This part required a few smaller stages. With some sites, I setup a netlify.toml file just to preset the expectations for when I add the Netlify site. That toml file looks like the following:
ID = "blog.dennisokeeffe.com"
command = "yarn build"
publish = "public"
# The following redirect is intended for use with most SPAs that handle
# routing internally.
from = "/*"
to = "/index.html"
status = 200
The Gatsby tutorial can show you what is required to get things up and running with Netlify from there.
As for the domain itself, I have dennisokeeffe.com setup on AWS Route53, so there was a small requirement to jump onto Route53 and create an alias to point the CNAME to the correct place.
Once that was there, all cylinders were a go! You can see the website here if you are not already on the website.
The website is now also using continuous deployment with Netlify, so any changes I make through the code editor locally or through the Netlify CMS will trigger a new build to deploy.
Looking forward to writing some more posts from now on, including those that are not directly affilliated with code!