As of Jekyll v3.2, themes are a first-class citizen in Jekyll. This means that theme designers can create Jekyll themes that are bundled as RubyGems and are properly versionable and updatable. This is a great move to foster a better theme ecosystem in Jekyll and make life easier for both theme designers and website creators.
Right now themes only support layout, include and Sass files, but the plan is to also support other theme assets in future releases. Themes need to be bundled as RubyGems, so the RubyGems website will be a good place to find themes and follow the latest updates.
Add the theme by its name to your Gemfile:
You can have multiple themes in your Gemfile
Then add the theme in your _config.yml file:
Only one theme should be used in your _config.yml however.
Themes are also required to include a README file, which should be useful to learn the specifics of each theme.
As themes are now bundled as Rubygems, updating when there’s a new version is now as easy as updating the gem:
gem update theme-name
Or, if you’re using bundler:
bundler update theme-name
Jekyll will first look if it can find a version of any file in your Jekyll project before using the theme’s version of the same file. This means that you can overwrite any theme file simply by creating a file with the same name in your project.
Read the official docs for Jekyll themes for more details and to learn how to create and bundle your own themes.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.Sign up