Unit 07 · lesson

Gem-Based Themes

A gem-based Jekyll theme can hide source files from the project tree while still participating in the build.

That sounds weird only until you remember Bundler.

Project + dependency model

Your project may contain:

Gemfile
_config.yml
index.md
about.md

while the installed theme gem contains:

_layouts/
_includes/
_sass/
assets/
_data/

Jekyll can use both sources during the build.

Why package themes as gems?

A gem gives the theme author a distribution/update mechanism through RubyGems/Bundler.

That means:

  • the theme can be versioned;
  • the project can declare the dependency;
  • updates can be pulled through Bundler;
  • the project directory stays smaller.

The tradeoff is visibility.

The source exists, but not necessarily inside your repository.

Read the dependency

A Gemfile may contain something like:

gem "minima"

and _config.yml may select the theme according to the theme/Jekyll setup.

Do not copy this blindly. Your project should only declare a theme you actually intend to use.

Compare source ownership

Create a table:

ResponsibilityCurrent custom siteGem theme version
default layoutrepositorytheme gem unless overridden
navigationrepositorydepends on theme
CSSrepositorytheme + local overrides
project layoutrepositorylikely still local/custom

Dependency evidence

If you run a theme experiment, record:

Theme gem:
Declared version/range:
Resolved version:
Which files/behaviors it provides:
Which local files override it:

Failure scenario

A theme update changes markup expected by your custom CSS.

The build may succeed.

The visual output can still break.

That is a dependency compatibility failure, not proof that Jekyll itself changed incorrectly.

Checkpoint

Explain what information Gemfile and Gemfile.lock give you when a theme behavior changes after dependency updates.