Minimal-mistakes: Convert theme into a Ruby Gem

Created on 8 Aug 2016  路  9Comments  路  Source: mmistakes/minimal-mistakes

As of Jekyll 3.2.0 themes packaged as gems are now supported. In theory installing and updating the theme would be much easier and not rely on forking the repo and dealing with merge conflicts. What needs to get done to make this a reality.

Pre-release docs and installation instructions

  • [x] jekyll/jekyll adds theme assets folder support to bundle (JavaScript, images, fonts, etc) with gem https://github.com/jekyll/jekyll/pull/5364
  • [x] Windows bug fixed in https://github.com/jekyll/jekyll/pull/5256
  • [x] jekyll gem updated to support theme's assets folder
  • [x] github-pages gem updated to support new absolute_url filter
  • [x] Move images/ into assets/ and update _includes and _layouts to reflect this change.
  • [x] Document installation/setup process for jekyll new
  • [x] Document migration process for users of a forked Minimal Mistakes repo
  • [x] Document upgrade process
  • [x] Move example/documentation site from gh-pages branch into master under docs/ for easier maintenance of the project.

Nice to haves for GitHub Pages support

  • [ ] GitHub Pages allows 3rd party theme gems
  • [x] github-pages gem updated to support theme's assets folder

Inclusion of _data files would be nice to bundle in the theme's UI text string localizations. If not possible at launch default to en with instructions on how to copy ui-text.yml into repo for use/modification.

Enhancement

Most helpful comment

gem install minimal-mistakes-jekyll

or add to Gemfile

gem 'minimal-mistakes-jekyll'

https://rubygems.org/gems/minimal-mistakes-jekyll

All 9 comments

This is great that you will support jekyllrb theme packaged as a gem

This is awesome, thanks a lot!

The only issue I encountered was that the images folder wasn't correctly searched anymore, I had to change this: https://github.com/basnijholt/nijholt.org/commit/aa11c24fd11540a1b44f43a4aa3f8b6991c0010c.

Thanks for testing it out @basnijholt. I'll be sure to properly document that images need a full path now when specified in _config.yml or YAML Front Matter. I mentioned it quickly in the instructions for using the alpha version but it might not have been as clear as it needed to be.

This is probably not the right place to ask, but I don't think it's justified to open a new issue for ths question.

I would like to keep my _config.yml clean, most settings are still just the default ones. If I would remove them, would it take the values of the default config in the gem?

@basnijholt Keep your existing _config.yml. Gemified themes only contain _layouts, _includes, _sass, and assets. There is no way to bundle in configs, _data, _posts, pages, or collections.

So you'll need your existing config for things to work. All this is really solving is the need to manually copy layouts and assets into your repo making installing and updating the theme easier.

Jekyll 3.3.0 has arrived..!!

@ashmaroli :+1: already on it!

gem install minimal-mistakes-jekyll

or add to Gemfile

gem 'minimal-mistakes-jekyll'

https://rubygems.org/gems/minimal-mistakes-jekyll

Was this page helpful?
0 / 5 - 0 ratings