One of the reasons I chose to use Bash to orchestrate the build process for my minimal static site generator was due to it's ubiquity. Bash has been around for a long time and it's present on the build platforms I most frequently use, not to mention on my dev machines. So to wrap up this series, I wanted to have the build process run not only on Github, but also Bitbucket.
I added multiple page types back in Part 6: Multiple Page Types of this series. But with multiple different pages I'm using multiple different HTML templates, duplicating quite a bit of HTML between them. I want to make sure I keep all that HTML boilerplate consistent, which I'll do with "layouts". I also want to create some "components" which can be used on any page to display specific content across many pages. I'll explore these concepts in this post.
In the last post of this series I duplicated a lot of code in the script file. To keep the script clean as I extend it further (and add more page types) I need to spend some time refactoring to improve the structure of the script. I can also apply the DRY principal (Don't Repeat Yourself) by extracting duplicated logic to separate functions.
So far in this series I've only been processing a single kind of content item and that's blog posts. But sites rarely have a single content page type. It's time to add an additional page type and generate the static files for this new page type.
In previous posts of this series I showed how to generate pages for each blog post I had in Content Hub ONE. Now the pages are generated I need some way to navigate and display the list of blog posts to users. I need to generate a list page (index page) that shows all the blog posts and provides links to them.
In the previous posts in this series I've been processing multiple pages by using the allBlogPost query field which returns a list of blog post content items. But at some point I'm going to hit the page size limit and a single query won't do. I need to rework my querying to be able to page over all the results in Experience Edge.
So far in this series I've only used 2 types of fields: Short text and Rich text. But the blog post content type in my Content Hub ONE tenant has some additional field types which I want to use: Date and time and Select. In this post I'll extend the blog post output to make use of these additional fields.
In the previous post, I showed the minimum required to generate a single page, consuming content which I manage in Content Hub ONE and which is delivered via Experience Edge. Now I want to build on that exercise and generate many pages.
In this multi-part series, I'm going to explore how far I can progress, building a static site generator (SSG) for a headless CMS using a restrained toolset and minimal dependencies.