Search code examples
rubyrubygemsjekyllgithub-pagesjekyll-theme

GitHub Pages site will not load any theme other than minima


Versions

Windows 10.0.19044.2364
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x64-mingw-ucrt]
gem v3.3.26
jekyll 4.3.1

Problem

With my Gemfile and _config.yml in a default configuration using the minima theme, everything works as expected. When I attempt to change to another theme (any theme), the site fails to load propertly.

Details

My default Gemfile:

source "https://rubygems.org"
# gem "jekyll", "~> 4.3.1"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima"

gem "github-pages", "~> 227", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
  gem "jekyll-remote-theme"
end
...

My default _config.yml:

title: default theme...
email: [email protected]
description: ...description...
domain: "chrisxfire.github.io"
url: "http://chrisxfire.github.io"

# Build settings
theme: minima

# remote-theme: pages-themes/[email protected]
plugins:
- jekyll-feed
- jekyll-remote-theme

GitHub Pages generates the site correctly and the page is normal:

enter image description here

Next, I attempt to use a GitHub Pages-supported theme, like midnight. I make the following changes:

In Gemfile, I change the line gem "minima" to:

gem "jekyll-theme-midnight"

In _config.yml, I change the line theme: minima to:

theme: jekyll-theme-midnight

I then commit. GitHub Actions finish successfully, but I now have a blank white page on the site.

Next, per the instructions on the midnight theme's GitHub site, I try making the following changes to _config.yml:

# theme: jekyll-theme-midnight
remote-theme: pages-themes/[email protected]

I then commit. GitHub Actions finish successfully. However, the page renders with only a blue header and nothing else:

enter image description here

What am I doing wrong?


Solution

  • testing midnight theme... is your theme title.

    To show the page in midnight black, I have moved your github-pages gem into plugins in the Gemfile:

    source "https://rubygems.org"
    
    group :jekyll_plugins do
      gem "github-pages"
      gem "jekyll-feed", "~> 0.12"
      gem "jekyll-remote-theme"
    end
    

    Also, the current post and home layouts in pages and posts create warnings when starting the server. You should see them in the build log.

    The theme is not required in your Gemfile anymore, as you use the remote-theme options in your _config.yml.