diff --git a/Gemfile b/Gemfile index d9266971..851fabc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,2 @@ source 'https://rubygems.org' -gemspec \ No newline at end of file +gemspec diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 89324cb1..4f807eae 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -225,3 +225,11 @@ Feature: Site configuration And I should see "Page Layout: 2 on 2010-01-01" in "_site/index.html" And I should see "Post Layout:
content for entry1.
" in "_site/2007/12/31/entry1.html" And I should see "Post Layout:content for entry2.
" in "_site/2020/01/31/entry2.html" + + Scenario: Add a gem-based plugin + Given I have an "index.html" file that contains "Whatever" + And I have a configuration file with "gems" set to "[jekyll_test_plugin]" + When I run jekyll + Then the _site directory should exist + And I should see "Whatever" in "_site/index.html" + And I should see "this is a test" in "_site/test.txt" diff --git a/jekyll.gemspec b/jekyll.gemspec index 35368433..ce7a211a 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -47,6 +47,7 @@ Gem::Specification.new do |s| s.add_development_dependency('simplecov-gem-adapter', "~> 1.0.1") s.add_development_dependency('coveralls', "~> 0.7.0") s.add_development_dependency('activesupport', '~> 3.2.13') + s.add_development_dependency('jekyll_test_plugin') # = MANIFEST = s.files = %w[ diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index de903a96..442fa5e6 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -12,6 +12,7 @@ module Jekyll 'layouts' => '_layouts', 'data_source' => '_data', 'keep_files' => ['.git','.svn'], + 'gems' => [], 'timezone' => nil, # use the local timezone @@ -26,7 +27,7 @@ module Jekyll 'pygments' => true, 'relative_permalinks' => true, # backwards-compatibility with < 1.0 - # will be set to false once 1.1 hits + # will be set to false once 2.0 hits 'markdown' => 'maruku', 'permalink' => 'date', diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 80cd7653..b892a31a 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -3,7 +3,7 @@ module Jekyll attr_accessor :config, :layouts, :posts, :pages, :static_files, :categories, :exclude, :include, :source, :dest, :lsi, :pygments, :permalink_style, :tags, :time, :future, :safe, :plugins, :limit_posts, - :show_drafts, :keep_files, :baseurl, :data, :file_read_opts + :show_drafts, :keep_files, :baseurl, :data, :file_read_opts, :gems attr_accessor :converters, :generators @@ -13,7 +13,7 @@ module Jekyll def initialize(config) self.config = config.clone - %w[safe lsi pygments baseurl exclude include future show_drafts limit_posts keep_files].each do |opt| + %w[safe lsi pygments baseurl exclude include future show_drafts limit_posts keep_files gems].each do |opt| self.send("#{opt}=", config[opt]) end @@ -77,6 +77,9 @@ module Jekyll require f end end + self.gems.each do |gem| + require gem + end end self.converters = instantiate_subclasses(Jekyll::Converter) @@ -388,7 +391,7 @@ module Jekyll def relative_permalinks_deprecation_method if config['relative_permalinks'] && has_relative_page? $stderr.puts # Places newline after "Generating..." - Jekyll.logger.warn "Deprecation:", "Starting in 1.1, permalinks for pages" + + Jekyll.logger.warn "Deprecation:", "Starting in 2.0, permalinks for pages" + " in subfolders must be relative to the" + " site source directory, not the parent" + " directory. Check http://jekyllrb.com/docs/upgrading/"+ diff --git a/site/docs/upgrading.md b/site/docs/upgrading.md index c15218fb..3cf5a1ef 100644 --- a/site/docs/upgrading.md +++ b/site/docs/upgrading.md @@ -42,7 +42,7 @@ rebuild each time a file changes, just add the `--watch` flag at the end. ### Absolute Permalinks In Jekyll v1.0, we introduced absolute permalinks for pages in subdirectories. -Until v1.1, it is **opt-in**. Starting with v1.1, however, absolute permalinks +Until v2.0, it is **opt-in**. Starting with v2.0, however, absolute permalinks will become **opt-out**, meaning Jekyll will default to using absolute permalinks instead of relative permalinks. @@ -50,9 +50,9 @@ instead of relative permalinks. * To continue using relative permalinks, set `relative_permalinks: true` in your configuration file.- Starting with Jekyll v1.1.0, `relative_permalinks` will default to `false`, + Starting with Jekyll v2.0, `relative_permalinks` will default to `false`, meaning all pages will be built using the absolute permalink behaviour. The switch will still exist until v2.0.