By default, Gatsby generates URLs for posts from their filename (or the directory name, depending on how you organize your posts). For example, if your post is named gatsby-custom-paths.md , its URL will be https://mysite.com/gatsby-custom-paths . But what if you want to use a different URL (say… Read
I like writing articles ahead of time and only have them listed on my site based on whether the current date is greater than or equal to the article's date attribute. This means I get to write a bunch of content at once, but release it over time so there's a constant stream of new material on my… Read
Yo! You might want to check out this article first on Managing Draft Articles in Gatsby . Lots of sites include "Previous Article" and "Next Article" buttons/links on the bottom of their articles. I wanted some, too! The Solution Updating the UI Let's start with the fun stuff first - updating the… Read
I'm a lazy programmer. I love building stuff, but I hate repeating myself. Anytime I start a new article for this site, I do the following: navigate to my site's directory in terminal open up VS Code create a new file set the title set the slug set the date set its published flag to false By no… Read
After converting this site to Gatsby, I quickly realized I needed a way to manage draft posts - pieces of writing I started, but for whatever reason weren't ready to be released publicly. Gatsby makes your posts public by default - as soon as you create that Markdown file and build your site, your… Read
I use Gatsby for blogging and like to write a bunch of articles at once so I can release them over time. But, since I use flat files instead of a CMS, keeping track of my articles and their status (published, pending, unpublished) can get tricky - especially as the number of them grows. So I built a… Read
When you use Gatsby 's starter for creating a blog, it displays an excerpt of the post's body on the list page. In my case though, I wanted the ability to display a custom blurb instead. A blurb is defined as a short description of a book, movie or article. In some cases, it's better to use this… Read
Note: this article builds upon the technique explained in my "How to Add Custom JavaScript to a Gatsby Site" article. I recently added Twitter buttons to the bottom of each article on this site. One to share the article and one to follow my account. Because this site runs on Gatsby (and… Read
I recently found myself needing to add some custom JavaScript to the head of a Gatsby project. In this article I'll show you how to do this. Gatsby doesn't actually use an index.html file. Instead, it uses an html.js file, which isn't exposed by default. Following their docs , we can expose… Read