Better GitHub Pages experience with Jekyll

Hey y’all. Congrats on 4.0 and thanks for having the forum. Spent the past few days on here and stackoverflow getting some of my sites updated and they’re finally done! I saw posts like this one /github-pages-and-jekyll-4-0-0/3471 (sorry i can only put two links in a post I’m new) who are upset that GitHub Pages is missing a lot of features which bottlenecks Jekylls potential.

Just wanted to share some articles I wrote on how to bypass GitHub Pages limits entirely and use Jekyll with all of the latest features available. I also wrote a bit more in depth on how to add super simple automated static-site testing to make sure my deployments are mostly never broken.

TL;DR
Using any devops tools like Jenkins, CircleCI, GitHub actions allows you to add a layer of automation between your commits and deployment. That layer is simply automating one of those platforms to build the site source, and then push it as a commit to a separate branch on GitHub where it will publish it exactly the same as if you had let GitHub do the build. The different is in the CI environment you have control over everything. the jekyll version. the plugins. using other gems to manipulate the site source, or do other quality checks. It’s not exactly a novel idea, but I’ve included a CircleCI example config that you can copy/paste as well as code snippets for running some basic QA checks on your produced source files. which you can run locally as well.

Any feedback on the articles is surely appreciated as well!

Thanks for sharing. I am going to check them out.

Unfortunately as far as I can tell, Github Pages chooses 3.8.x for you and this cannot be overridden with Gemfile or config. https://pages.github.com/versions

I switched one of new projects to jekyll 4 by specifying it in Gemfile and doing a Netlify build.

I use Netlify for some projects rather than Github Pages. One reason is the build log is verbose and I have control over the build command. Also there is a rebuild button which does not require a commit. You can share the build log with others if set to public and you can build Pull Requests as deploy previews which I found super useful lately.

Plus in Netlify you can could specify tests as part of the build command.

I recently also found a Ruby gem which I ran locally to check for any broken links on a site and potentially this could be added as part of a deploy workflow.

I may have explained it poorly. The method I describe in the blog posts outline how you can avoid the limitations of GitHub Pages by using CircleCI to build the site with Jekyll in CI and then publish the fully built site to GitHub Pages. And in the CI environment you can use Jekyll 4.0 and anything else. I’ve added some very basic QA validation as well that prevents the site from being deployed with errors that can hurt SEO or UX.

Okay I see. So your code is on one branch and built site on another, or different repos? I saw something for react which compiles and builds and publishes to different branch so one can use something not normally possible on GH pages.

Yes, in GitHub pages you can have the source code live in the master branch, for instance, and build/push the website to a separate branch. Then you tell GitHub to serve from the branch with the fully built site rather than the source. and you can use any version of Jekyll, or any gems/plugins that are available without issue but still host on GitHub pages.