Merge branch 'master' into themes

* master: (58 commits)
  Update history to reflect merge of #4792 [ci skip]
  Update history to reflect merge of #4793 [ci skip]
  Update history to reflect merge of #4804 [ci skip]
  Update history to reflect merge of #4754 [ci skip]
  Update history to reflect merge of #4813 [ci skip]
  Added missing single quote on rsync client side command
  Add v3.0.4 and v3.1.3 to the history.
  Fixed typo
  Add jekyll-autoprefixer plugin
  Explicitly require Filters rather than implicitly.
  Update history to reflect merge of #4786 [ci skip]
  Update history to reflect merge of #4789 [ci skip]
  updates example domain in config template
  Globalize Jekyll's Filters.
  Update JRuby to 9.0.5.0; Drop the double digit test.
  Update Rack-Jekyll Heroku deployment blog post url
  convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files
  Update history to reflect merge of #4734 [ci skip]
  Update history to reflect merge of #4478 [ci skip]
  Fix rubocop warning.
  ...
This commit is contained in:
Parker Moore 2016-04-21 11:43:35 -07:00
commit 42cc2445a5
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
38 changed files with 264 additions and 73 deletions

View File

@ -6,8 +6,8 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
## Ways to contribute
@ -28,7 +28,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/)
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
@ -36,7 +36,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
Many small changes can be made entirely through the github.com web interface.
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit.
2. Click the pencil icon in the top right corner to edit the file
3. Make your proposed changes
4. Click "Propose file change"
@ -48,13 +48,13 @@ That's it! You'll be automatically subscribed to receive updates as others revie
### Submitting a pull request via Git command line
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll)
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
4. Hack away, add tests. Not necessarily in that order.
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
6. Push the branch up ( `git push origin my-awesome-feature` ).
7. Create a pull request by visiting https://github.com/<your-username>/jekyll/ and following the instructions at the top of the screen.
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
## Proposing updates to the documentation
@ -84,7 +84,7 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
#### Tests
* If you're creating a small fix or patch to an existing feature, a simple test if more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need to can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
* If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
* If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.

View File

@ -9,7 +9,7 @@ rvm:
- &ruby1 2.3.0
- &ruby2 2.2.4
- &ruby3 2.1.8
- &jruby jruby-9.0.4.0
- &jruby jruby-9.0.5.0
- &rhead ruby-head
matrix:

View File

@ -1,7 +1,7 @@
source "https://rubygems.org"
gemspec :name => "jekyll"
gem "rake", "~> 10.1"
gem "rake", "~> 11.0"
group :development do
gem "launchy", "~> 2.3"
gem "rubocop", :branch => :master, :github => "bbatsov/rubocop"

View File

@ -18,6 +18,9 @@
* Adds `link` Liquid tag to make generation of URL's easier (#4624)
* Allow static files to be symlinked in unsafe mode or non-prod environments (#4640)
* Add `:after_init` hook & add `Site#config=` to make resetting config easy (#4703)
* DocumentDrop: add `#<=>` which sorts by date (falling back to path) (#4741)
* Add a where_exp filter for filtering by expression (#4478)
* Globalize Jekyll's Filters. (#4792)
### Bug Fixes
@ -29,6 +32,9 @@
* Ensures related_posts are only set for a post (#4620)
* EntryFilter#special?: ignore filenames which begin with '~' (#4491)
* Cleaner: `keep_files` should only apply to the beginning of paths, not substrings with index > 0 (#3849)
* Use SSLEnable instead of EnableSSL and make URL HTTPS. (#4693)
* convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files (#4786)
* Example in the site template should be IANA-approved example.com (#4793)
### Development Fixes
@ -37,6 +43,10 @@
* Unify method for copying special files from repo to site (#4601)
* Refresh the contributing file (#4596)
* change smartify doc from copy/paste of mardownify doc (#4653)
* Update Rake & disable warnings when running tests (#4720)
* Fix many warnings (#4537)
* Don't blindly assume the last system when determining "open" cmd (#4717)
* Fix "locally" typo in contributing documentation (#4756)
### Site Enhancements
@ -58,6 +68,23 @@
* Add jekyll-paspagon plugin (#4700)
* Bold-italicize note in assets documentation about needing yaml front matter (#4706)
* Highlight the `script/` calls in the Contributing documentation (#4712)
* Add Hawkins to the list of third-party plugins (#4755)
* Fix a typo in pagination doc (#4763)
* Switch second GitHub Pages link to HTTPS (#4760)
* Explain data file format requirements more clearly in documentation (#4781)
* Add jekyll-i18n_tags to list of third-party plugins (#4775)
* Remove Leonard Lamprecht's website from Sites page (#4771)
* Updates documentation for collections to include `date` property (#4769)
* Added an explicit rerun note to configuration.md, defaults section (#4734)
* Update Rack-Jekyll Heroku deployment blog post url (#4789)
* Added missing single quote on rsync client side command (#4813)
* Organize Form Platforms-as-a-Service into unified list & add FormSpree.io (#4754)
* Fixed typo on Configuration page (#4804)
## 3.1.3 / 2016-04-18
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4807)
* Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) (#4693)
## 3.1.2 / 2016-02-19
@ -206,6 +233,11 @@
* Add Contentful Extension to list of third-party plugins (#4390)
* Correct Minor spelling error (#4394)
## 3.0.4 / 2016-04-18
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4806)
* Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it (#4753)
## 3.0.3 / 2016-02-08
### Bug Fixes

View File

@ -45,7 +45,6 @@ module Jekyll
autoload :Errors, 'jekyll/errors'
autoload :Excerpt, 'jekyll/excerpt'
autoload :External, 'jekyll/external'
autoload :Filters, 'jekyll/filters'
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
autoload :Hooks, 'jekyll/hooks'
autoload :Layout, 'jekyll/layout'
@ -78,6 +77,7 @@ module Jekyll
require 'jekyll/generator'
require 'jekyll/command'
require 'jekyll/liquid_extensions'
require "jekyll/filters"
class << self
# Public: Tells you which Jekyll environment you are building in so you can skip tasks

View File

@ -116,26 +116,24 @@ module Jekyll
private
def server_address(server, opts)
address = server.config[:BindAddress]
baseurl = "#{opts["baseurl"]}/" if opts["baseurl"]
port = server.config[:Port]
"http://#{address}:#{port}#{baseurl}"
"%{prefix}://%{address}:%{port}%{baseurl}" % {
:prefix => server.config[:SSLEnable] ? "https" : "http",
:baseurl => opts["baseurl"] ? "#{opts["baseurl"]}/" : "",
:address => server.config[:BindAddress],
:port => server.config[:Port]
}
end
#
private
def launch_browser(server, opts)
command =
if Utils::Platforms.windows?
"start"
elsif Utils::Platforms.osx?
"open"
else
"xdg-open"
end
system command, server_address(server, opts)
address = server_address(server, opts)
return system "start", address if Utils::Platforms.windows?
return system "xdg-open", address if Utils::Platforms.linux?
return system "open", address if Utils::Platforms.osx?
Jekyll.logger.error "Refusing to launch browser; " \
"Platform launcher unknown."
end
# Keep in our area with a thread or detach the server as requested
@ -185,7 +183,7 @@ module Jekyll
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
opts[:EnableSSL] = true
opts[:SSLEnable] = true
end
private

View File

@ -149,7 +149,7 @@ module Jekyll
Jekyll.logger.info "Configuration file:", file
next_config
rescue SystemCallError
if @default_config_file
if @default_config_file ||= nil
Jekyll.logger.warn "Configuration file:", "none"
{}
else

View File

@ -8,7 +8,9 @@ module Jekyll
#
# Returns the String prefix.
def self.highlighter_prefix(highlighter_prefix = nil)
@highlighter_prefix = highlighter_prefix if highlighter_prefix
if !defined?(@highlighter_prefix) || !highlighter_prefix.nil?
@highlighter_prefix = highlighter_prefix
end
@highlighter_prefix
end
@ -20,7 +22,9 @@ module Jekyll
#
# Returns the String suffix.
def self.highlighter_suffix(highlighter_suffix = nil)
@highlighter_suffix = highlighter_suffix if highlighter_suffix
if !defined?(@highlighter_suffix) || !highlighter_suffix.nil?
@highlighter_suffix = highlighter_suffix
end
@highlighter_suffix
end

View File

@ -6,7 +6,7 @@ module Jekyll
safe true
def setup
return if @setup
return if @setup ||= false
unless (@parser = get_processor)
Jekyll.logger.error "Invalid Markdown processor given:", @config["markdown"]
Jekyll.logger.info "", "Custom processors are not loaded in safe mode" if @config["safe"]

View File

@ -18,6 +18,7 @@ module Jekyll
Jekyll::External.require_with_graceful_fail "kramdown"
@main_fallback_highlighter = config["highlighter"] || "rouge"
@config = config["kramdown"] || {}
@highlighter = nil
setup
end

View File

@ -41,7 +41,7 @@ module Jekyll
begin
self.content = File.read(site.in_source_dir(base, name),
Utils.merged_file_read_opts(site, opts))
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
if content =~ Document::YAML_FRONT_MATTER_REGEXP
self.content = $POSTMATCH
self.data = SafeYAML.load(Regexp.last_match(1))
end

View File

@ -20,6 +20,13 @@ module Jekyll
fallback_data['excerpt'].to_s
end
def <=>(other)
return nil unless other.is_a? DocumentDrop
cmp = self['date'] <=> other['date']
cmp = self['path'] <=> other['path'] if cmp.nil? || cmp == 0
cmp
end
private
def_delegator :@obj, :data, :fallback_data
end

View File

@ -1,6 +1,7 @@
require 'uri'
require 'json'
require 'date'
require 'liquid'
module Jekyll
module Filters
@ -225,6 +226,26 @@ module Jekyll
input.select { |object| Array(item_property(object, property)).map(&:to_s).include?(value.to_s) }
end
# Filters an array of objects against an expression
#
# input - the object array
# variable - the variable to assign each item to in the expression
# expression - a Liquid comparison expression passed in as a string
#
# Returns the filtered array of objects
def where_exp(input, variable, expression)
return input unless input.is_a?(Enumerable)
input = input.values if input.is_a?(Hash) # FIXME
condition = parse_condition(expression)
@context.stack do
input.select do |object|
@context[variable] = object
condition.evaluate(@context)
end
end
end
# Sort an array of objects
#
# input - the object array
@ -363,5 +384,25 @@ module Jekyll
end
end
end
# Parse a string to a Liquid Condition
def parse_condition(exp)
parser = Liquid::Parser.new(exp)
left_expr = parser.expression
operator = parser.consume?(:comparison)
condition =
if operator
Liquid::Condition.new(left_expr, operator, parser.expression)
else
Liquid::Condition.new(left_expr)
end
parser.consume(:end_of_string)
condition
end
end
end
Liquid::Template.register_filter(
Jekyll::Filters
)

View File

@ -94,8 +94,8 @@ module Jekyll
return true if !scope.key?('path') || scope['path'].empty?
scope_path = Pathname.new(scope['path'])
Pathname.new(sanitize_path(path)).ascend do |path|
if path.to_s == scope_path.to_s
Pathname.new(sanitize_path(path)).ascend do |ascended_path|
if ascended_path.to_s == scope_path.to_s
return true
end
end

View File

@ -60,7 +60,7 @@ module Jekyll
#
# Returns the safety Boolean.
def self.safe(safe = nil)
if safe
if !defined?(@safe) || !safe.nil?
@safe = safe
end
@safe || false

View File

@ -1,6 +1,8 @@
module Jekyll
class Regenerator
attr_reader :site, :metadata, :cache
attr_accessor :disabled
private :disabled, :disabled=
def initialize(site)
@site = site
@ -115,7 +117,7 @@ module Jekyll
#
# Returns nothing.
def add_dependency(path, dependency)
return if metadata[path].nil? || @disabled
return if metadata[path].nil? || disabled
unless metadata[path]["deps"].include? dependency
metadata[path]["deps"] << dependency
@ -144,8 +146,8 @@ module Jekyll
#
# Returns a Boolean (true for disabled, false for enabled).
def disabled?
@disabled = !site.incremental? if @disabled.nil?
@disabled
self.disabled = !site.incremental? if disabled.nil?
disabled
end
private

View File

@ -52,7 +52,6 @@ module Jekyll
document.trigger_hooks(:pre_render, payload)
info = {
:filters => [Jekyll::Filters],
:registers => { :site => site, :page => payload['page'] }
}

View File

@ -19,7 +19,7 @@ description: > # this means to ignore newlines until "baseurl:"
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://yourdomain.com" # the base hostname & protocol for your site
url: "http://example.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll

View File

@ -317,6 +317,16 @@ file, each document has the following attributes:
</p>
</td>
</tr>
<tr>
<td>
<p><code>date</code></p>
</td>
<td>
<p>
The date of the document's collection.
</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@ -435,7 +435,7 @@ Using [YAML Front Matter](../frontmatter/) is one way that you can specify confi
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your projects root directory.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
@ -450,6 +450,18 @@ defaults:
layout: "default"
{% endhighlight %}
<div class="note info">
<h5>Please stop and rerun `jekyll serve` command.</h5>
<p>
The <code>_config.yml</code> master configuration file contains global configurations
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
during automatic regeneration are not loaded until the next execution.
</p>
<p>
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
</p>
</div>
Here, we are scoping the `values` to any file that exists in the scopes path. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
{% highlight yaml %}

View File

@ -230,4 +230,4 @@ This entire guide is open-source. Go ahead and [edit it][3] if you have a
fix or [ask for help][4] if you run into trouble and need some help.
[3]: https://github.com/jekyll/jekyll/edit/master/site/_docs/continuous-integration.md
[4]: http://jekyllrb.com/help/
[4]: https://jekyllrb.com/help/

View File

@ -11,8 +11,8 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
## Ways to contribute
@ -33,7 +33,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/)
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
@ -41,7 +41,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
Many small changes can be made entirely through the github.com web interface.
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit.
2. Click the pencil icon in the top right corner to edit the file
3. Make your proposed changes
4. Click "Propose file change"
@ -53,13 +53,13 @@ That's it! You'll be automatically subscribed to receive updates as others revie
### Submitting a pull request via Git command line
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll)
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
4. Hack away, add tests. Not necessarily in that order.
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
6. Push the branch up ( `git push origin my-awesome-feature` ).
7. Create a pull request by visiting https://github.com/<your-username>/jekyll/ and following the instructions at the top of the screen.
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
## Proposing updates to the documentation
@ -89,7 +89,7 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
#### Tests
* If you're creating a small fix or patch to an existing feature, a simple test if more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need to can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
* If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
* If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.

View File

@ -21,8 +21,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
As explained on the [directory structure](../structure/) page, the `_data`
folder is where you can store additional data for Jekyll to use when generating
your site. These files must be YAML files
(using either the `.yml`, `.yaml`, `.json` or `csv` extension) and they will be
your site. These files must be YAML, JSON, or CSV files (using either
the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be
accessible via `site.data`.
## Example: List of members

View File

@ -142,7 +142,7 @@ Add the `deploy` script to the site source folder:
{% highlight bash %}
#!/bin/sh
rsync -crvz --rsh=ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
{% endhighlight %}
Command line parameters are:
@ -186,7 +186,7 @@ script executes.
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
Read [this post](http://blog.crowdint.com/2010/08/02/instant-blog-using-jekyll-and-heroku.html) on how to deploy to Heroku using Rack-Jekyll.
Read [this post](http://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku) on how to deploy to Heroku using Rack-Jekyll.
## Jekyll-Admin for Rails

View File

@ -858,6 +858,7 @@ LESS.js files during generation.
- [Jekyll Flickr Plugin](https://github.com/lawmurray/indii-jekyll-flickr) by [Lawrence Murray](http://www.indii.org): Embeds Flickr photosets (albums) as a gallery of thumbnails, with lightbox links to larger images.
- [jekyll-figure](https://github.com/paulrobertlloyd/jekyll-figure): A liquid tag for Jekyll that generates `<figure>` elements.
- [Jekyll Video Embed](https://github.com/eug/jekyll-video-embed): It provides several tags to easily embed videos (e.g. Youtube, Vimeo, UStream and Ted Talks)
- [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags): Translate your templates.
#### Collections
@ -898,6 +899,8 @@ LESS.js files during generation.
- [Jekyll Deploy](https://github.com/vwochnik/jekyll-deploy): Adds a `deploy` sub-command to Jekyll.
- [Official Contentful Jekyll Plugin](https://github.com/contentful/jekyll-contentful-data-import): Adds a `contentful` sub-command to Jekyll to import data from Contentful.
- [jekyll-paspagon](https://github.com/KrzysiekJ/jekyll-paspagon): Sell your posts in various formats for cryptocurrencies.
- [Hawkins](https://github.com/awood/hawkins): Adds a `liveserve` sub-command to Jekyll that incorporates [LiveReload](http://livereload.com/) into your pages while you preview them. No more hitting the refresh button in your browser!
- [Jekyll Autoprefixer](https://github.com/vwochnik/jekyll-autoprefixer): Autoprefixer integration for Jekyll
#### Editors

View File

@ -16,8 +16,10 @@ Jekylls growing use is producing a wide variety of tutorials, frameworks, ext
### Integrations
- [Use FormKeep as a backend for forms (contact forms, hiring forms, etc.)](https://formkeep.com/guides/how-to-make-a-contact-form-in-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
- [Use Simple Form to add a simple contact form](http://getsimpleform.com/)
- Use a saas service as a backend for forms (contact forms, hiring forms, etc.)
- [Formspree (also open source)](http://formspree.io/)
- [FormKeep](https://formkeep.com/guides/how-to-make-a-contact-form-in-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
- [Simple Form](http://getsimpleform.com/)
- [Jekyll Bootstrap](http://jekyllbootstrap.com), 0 to Blog in 3 minutes. Provides detailed explanations, examples, and helper-code to make getting started with Jekyll easier.
- [Integrating Twitter with Jekyll](http://www.justkez.com/integrating-twitter-with-jekyll/)
> “Having migrated Justkez.com to be based on Jekyll, I was pondering how I might include my recent twitterings on the front page of the site. In the WordPress world, this would have been done via a plugin which may or may not have hung the loading of the page, might have employed caching, but would certainly have had some overheads. … Not in Jekyll.”

View File

@ -14,8 +14,6 @@ learning purposes.
([source](https://github.com/github/training-kit))
- [Rasmus Andersson](http://rsms.me/)
([source](https://github.com/rsms/rsms.github.com))
- [Leonard Lamprecht](http://leo.im)
([source](https://github.com/leo/leo.github.io))
If you would like to explore more examples, you can find a list of sites
and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].

View File

@ -88,6 +88,22 @@ common tasks easier.
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Where Expression</strong></p>
<p>Select all the objects in an array where the expression is true.</p>
</td>
<td class="align-center">
<p>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.graduation_year == 2014" }}{% endraw %}</code>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.graduation_year < 2014" }}{% endraw %}</code>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.projects contains 'foo'" }}{% endraw %}</code>
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Group By</strong></p>

View File

@ -353,7 +353,7 @@ following is a reference of the available data.
</tr>
<tr>
<td><p><code>paginator.total_pages</code></p></td>
<td><p>Total number of Pages.</p></td>
<td><p>Total number of pages.</p></td>
</tr>
<tr>
<td><p><code>paginator.page</code></p></td>

View File

@ -79,7 +79,7 @@ overview: true
<div class="pane-content">
<h2 class="center-on-mobiles"><strong>Free hosting</strong> with GitHub Pages</h2>
<p>Sick of dealing with hosting companies? <a href="https://pages.github.com/">GitHub Pages</a> are <em>powered by Jekyll</em>, so you can easily deploy your site using GitHub for free&mdash;<a href="https://help.github.com/articles/about-supported-custom-domains/">custom domain name</a> and&nbsp;all.</p>
<a href="http://pages.github.com/">Learn more about GitHub Pages &rarr;</a>
<a href="https://pages.github.com/">Learn more about GitHub Pages &rarr;</a>
</div>
</div>
<div class="clear"></div>

View File

@ -1,3 +1,10 @@
$stdout.puts "# -------------------------------------------------------------"
$stdout.puts "# SPECS AND TESTS ARE RUNNING WITH WARNINGS OFF."
$stdout.puts "# SEE: https://github.com/Shopify/liquid/issues/730"
$stdout.puts "# SEE: https://github.com/jekyll/jekyll/issues/4719"
$stdout.puts "# -------------------------------------------------------------"
$VERBOSE = nil
def jruby?
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
end

View File

@ -110,7 +110,7 @@ class TestCommandsServe < JekyllUnitTest
"ssl_key" => "bar"
})
assert result[:EnableSSL]
assert result[:SSLEnable]
assert_equal result[:SSLPrivateKey ], "c2"
assert_equal result[:SSLCertificate], "c1"
end

View File

@ -37,7 +37,7 @@ class TestConvertible < JekyllUnitTest
out = capture_stderr do
@convertible.read_yaml(@base, 'exploit_front_matter.erb')
end
refute_match /undefined class\/module DoesNotExist/, out
refute_match(/undefined class\/module DoesNotExist/, out)
end
should "not parse if there is encoding error in file" do

View File

@ -158,7 +158,7 @@ class TestFilters < JekyllUnitTest
end
should "format a time with xmlschema" do
assert_match /2014-05-10T00:10:07/, @filter.date_to_xmlschema(@time_as_numeric)
assert_match(/2014-05-10T00:10:07/, @filter.date_to_xmlschema(@time_as_numeric))
end
should "format a time according to RFC-822" do
@ -354,6 +354,64 @@ class TestFilters < JekyllUnitTest
end
end
context "where_exp filter" do
should "return any input that is not an array" do
assert_equal "some string", @filter.where_exp("some string", "la", "le")
end
should "filter objects in a hash appropriately" do
hash = {"a"=>{"color"=>"red"}, "b"=>{"color"=>"blue"}}
assert_equal 1, @filter.where_exp(hash, "item", "item.color == 'red'").length
assert_equal [{"color"=>"red"}], @filter.where_exp(hash, "item", "item.color == 'red'")
end
should "filter objects appropriately" do
assert_equal 2, @filter.where_exp(@array_of_objects, "item", "item.color == 'red'").length
end
should "stringify during comparison for compatibility with liquid parsing" do
hash = {
"The Words" => {"rating" => 1.2, "featured" => false},
"Limitless" => {"rating" => 9.2, "featured" => true},
"Hustle" => {"rating" => 4.7, "featured" => true},
}
results = @filter.where_exp(hash, "item", "item.featured == true")
assert_equal 2, results.length
assert_equal 9.2, results[0]["rating"]
assert_equal 4.7, results[1]["rating"]
results = @filter.where_exp(hash, "item", "item.rating == 4.7")
assert_equal 1, results.length
assert_equal 4.7, results[0]["rating"]
end
should "filter with other operators" do
assert_equal [3, 4, 5], @filter.where_exp([ 1, 2, 3, 4, 5 ], "n", "n >= 3")
end
objects = [
{ "id" => "a", "groups" => [1, 2] },
{ "id" => "b", "groups" => [2, 3] },
{ "id" => "c" },
{ "id" => "d", "groups" => [1, 3] }
]
should "filter with the contains operator over arrays" do
results = @filter.where_exp(objects, "obj", "obj.groups contains 1")
assert_equal 2, results.length
assert_equal "a", results[0]["id"]
assert_equal "d", results[1]["id"]
end
should "filter with the contains operator over hash keys" do
results = @filter.where_exp(objects, "obj", "obj contains 'groups'")
assert_equal 3, results.length
assert_equal "a", results[0]["id"]
assert_equal "b", results[1]["id"]
assert_equal "d", results[2]["id"]
end
end
context "sort filter" do
should "raise Exception when input is nil" do
err = assert_raises ArgumentError do

View File

@ -91,7 +91,7 @@ class TestNewCommand < JekyllUnitTest
should 'force created folder' do
capture_stdout { Jekyll::Commands::New.process(@args) }
output = capture_stdout { Jekyll::Commands::New.process(@args, '--force') }
assert_match /New jekyll site installed in/, output
assert_match(/New jekyll site installed in/, output)
end
end

View File

@ -232,13 +232,13 @@ class TestSite < JekyllUnitTest
context 'error handling' do
should "raise if destination is included in source" do
assert_raises Jekyll::Errors::FatalException do
site = Site.new(site_configuration('destination' => source_dir))
Site.new(site_configuration('destination' => source_dir))
end
end
should "raise if destination is source" do
assert_raises Jekyll::Errors::FatalException do
site = Site.new(site_configuration('destination' => File.join(source_dir, "..")))
Site.new(site_configuration('destination' => File.join(source_dir, "..")))
end
end
end
@ -520,7 +520,6 @@ class TestSite < JekyllUnitTest
contacts_html = @site.pages.find { |p| p.name == "contacts.html" }
@site.process
source = @site.in_source_dir(contacts_html.path)
dest = File.expand_path(contacts_html.destination(@site.dest))
mtime1 = File.stat(dest).mtime.to_i # first run must generate dest file

View File

@ -149,7 +149,7 @@ CONTENT
end
should "not cause a markdown error" do
refute_match /markdown\-html\-error/, @result
refute_match(/markdown\-html\-error/, @result)
end
should "render markdown with pygments" do
@ -442,7 +442,7 @@ CONTENT
end
should "not cause an error" do
refute_match /markdown\-html\-error/, @result
refute_match(/markdown\-html\-error/, @result)
end
should "have the url to the \"complex\" post from 2008-11-21" do
@ -466,7 +466,7 @@ CONTENT
end
should "not cause an error" do
refute_match /markdown\-html\-error/, @result
refute_match(/markdown\-html\-error/, @result)
end
should "have the url to the \"complex\" post from 2008-11-21" do
@ -600,7 +600,8 @@ title: Include symlink
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
refute_match /SYMLINK TEST/, @result
@result ||= ''
refute_match(/SYMLINK TEST/, @result)
end
should "not expose the existence of symlinked files" do
@ -877,7 +878,8 @@ title: Include symlink
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
refute_match /SYMLINK TEST/, @result
@result ||= ''
refute_match(/SYMLINK TEST/, @result)
end
should "not expose the existence of symlinked files" do

View File

@ -63,12 +63,12 @@ class TestURL < JekyllUnitTest
},
})
site.read
doc = site.collections["methods"].docs.find do |doc|
matching_doc = site.collections["methods"].docs.find do |doc|
doc.relative_path == "_methods/escape-+ #%20[].md"
end
assert_equal '/methods/escape-+-20/escape-20.html', URL.new(
:template => '/methods/:title/:name:output_ext',
:placeholders => doc.url_placeholders
:placeholders => matching_doc.url_placeholders
).to_s
end