jekyllt / jasper2

Full-featured Jekyll port of Ghost's default theme Casper v2 👻
https://jekyllt.github.io/jasper2/
MIT License
764 stars 662 forks source link

Any plans on making a gem out of this? #14

Closed EduardoBautista closed 3 years ago

EduardoBautista commented 6 years ago

Usually a Jekyll theme is a gem that can just be added to the Gemfile.

biomadeira commented 6 years ago

@EduardoBautista Good idea! I am gonna look on how to do it, but your help is welcomed!

biomadeira commented 6 years ago

With bundle exec jekyll new-theme jasper2 I get this jasper2.gemspec

# coding: utf-8

Gem::Specification.new do |spec|
  spec.name          = "jasper2"
  spec.version       = "0.1.0"
  spec.authors       = ["Fábio Madeira"]
  spec.email         = ["fbiomadeira@gmail.com"]

  spec.summary       = %q{TODO: Write a short summary, because Rubygems requires one.}
  spec.homepage      = "TODO: Put your gem's website or public repo URL here."
  spec.license       = "MIT"

  spec.files         = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }

  spec.add_runtime_dependency "jekyll", "~> 3.6"

  spec.add_development_dependency "bundler", "~> 1.12"
  spec.add_development_dependency "rake", "~> 10.0"
end

I guess with some edits, shouldn't take much to make a gem out of this...

rriemann commented 6 years ago

I just link here two examples of gemified jekyll themes:

I wonder if plugin files can be bundled with theme files.

With gem-based themes, some of the site’s directories (such as the assets, _layouts, _includes, and _sass directories) are stored in the theme’s gem, hidden from your immediate view. Yet all of the necessary directories will be read and processed during Jekyll’s build process.

Source: https://jekyllrb.com/docs/themes/

ruipires commented 6 years ago

Any news on this ? Is it worth it to give it a shot, or has anyone already tried and stumbled into some major issue ?

ruipires commented 6 years ago

Trying this (along with some other customizations) on my fork, but the plugins bundled in the gem are not being run from the site using the theme in gem form. No sure if this is by (jekyll) design or a bug.

rriemann commented 6 years ago

No sure if this is by (jekyll) design or a bug.

Only few folders are copied from the gem themes:

With gem-based themes, some of the site’s directories (such as the assets, _layouts, _includes, and _sass directories) are stored in the theme’s gem

Source: https://jekyllrb.com/docs/themes/

Hence, the _plugin folder is not part of it.

ruipires commented 6 years ago

Only few folders are copied from the gem themes:

With gem-based themes, some of the site’s directories (such as the assets, _layouts, _includes, and _sass directories) are stored in the theme’s gem

Source: https://jekyllrb.com/docs/themes/

Hence, the _plugin folder is not part of it.

Yeah, I saw that, but I was hoping that was not an exhaustive list. Anyway, I have worked around the limitation in my scenario by copying over the plugins I need.

claudiuconstantin commented 5 years ago

Any news on this one?

biomadeira commented 3 years ago

Gem now live at https://rubygems.org/gems/jasper2