Skip to content

Commit

Permalink
Merge branch 'master' into pr/url-doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyF committed Jan 20, 2017
2 parents 8875bdf + 9fe73be commit fd13545
Show file tree
Hide file tree
Showing 75 changed files with 654 additions and 480 deletions.
14 changes: 14 additions & 0 deletions .rubocop.yml
Expand Up @@ -22,6 +22,8 @@ Metrics/BlockLength:
Exclude:
- test/**/*.rb
- lib/jekyll/configuration.rb
- rake/*.rake
- jekyll.gemspec
Metrics/ClassLength:
Exclude:
- !ruby/regexp /features\/.*.rb$/
Expand All @@ -32,6 +34,8 @@ Metrics/CyclomaticComplexity:
Metrics/LineLength:
Exclude:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
Max: 90
Severity: warning
Metrics/MethodLength:
Expand All @@ -44,6 +48,14 @@ Metrics/ParameterLists:
Max: 4
Metrics/PerceivedComplexity:
Max: 8
Security/MarshalLoad:
Exclude:
- !ruby/regexp /test\/.*.rb$/
- lib/jekyll/regenerator.rb
Security/YAMLLoad:
Exclude:
- !ruby/regexp /features\/.*.rb/
- !ruby/regexp /test\/.*.rb$/
Style/Alias:
Enabled: false
Style/AlignArray:
Expand Down Expand Up @@ -127,5 +139,7 @@ Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/UnneededCapitalW:
Enabled: false
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -5,10 +5,10 @@ language: ruby
sudo: false

rvm:
- &ruby1 2.3.1
- &ruby2 2.2.5
- &ruby1 2.3.3
- &ruby2 2.2.6
- &ruby3 2.1.9
- &jruby jruby-9.1.2.0
- &jruby jruby-9.1.7.0

matrix:
include:
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Expand Up @@ -25,7 +25,7 @@ group :test do
gem "nokogiri"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.44.1"
gem "rubocop", "~> 0.47"
gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))

gem "jruby-openssl" if RUBY_ENGINE == "jruby"
Expand Down Expand Up @@ -69,7 +69,7 @@ group :jekyll_optional_dependencies do
gem "jekyll-redirect-from"
gem "kramdown", "~> 1.9"
gem "mime-types", "~> 3.0"
gem "rdoc", "~> 4.2"
gem "rdoc", "~> 5.0"
gem "toml", "~> 0.1.0"

platform :ruby, :mswin, :mingw, :x64_mingw do
Expand All @@ -88,12 +88,12 @@ end

group :site do
if ENV["PROOF"]
gem "html-proofer", "~> 2.0"
gem "html-proofer", "~> 3.4"
end

gem "jekyll-avatar"
gem "jekyll-mentions"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
gem "jemoji", "0.5.1"
gem "jemoji"
end
24 changes: 24 additions & 0 deletions History.markdown
Expand Up @@ -7,13 +7,18 @@
* Use the current year for the LICENSE of theme (#5712)
* Update License (#5713)
* Use Addressable instead of URI to decode (#5726)
* throw IncludeTagError if error occurs in included file (#5767)
* Write Jekyll::Utils::Exec.run for running shell commands. (#5640)

### Bug Fixes

* Escaped regular expressions when using `post_url`. (#5605)
* fix date parsing in file names to be stricter (#5609)
* Add a module to re-define `ENV["TZ"]` in Windows (#5612)
* Use each instead of map to actually return nothing (#5668)
* include: fix 'no implicit conversion of nil to String' (#5750)
* Don't include the theme's includes_path if it is nil. (#5780)
* test double slash when input = '/' (#5542)

### Site Enhancements

Expand All @@ -33,6 +38,10 @@
* Docs: move permalinks from documents into config (#5544)
* Sort gems in `docs/_config.yml` (#5746)
* [site] Use defaults for docs and news-items (#5744)
* Improve collections docs (#5691)
* Fix #5730: add gcc and make to the list of requirements (#5731)
* Add missing class (#5791)
* Improve template docs (#5694)

### Development Fixes

Expand All @@ -46,6 +55,14 @@
* Rubocop: fix Rakefile and gemspec (#5745)
* Use `assert_nil` (#5725)
* Sort gems in `jekyll.gemspec` (#5746)
* Rubocop: Require consistent comma in multiline literals (#5761)
* Bump rubocop (#5765)
* New rubocop security checks (#5768)
* test/helper: fix flaky plugin path test by removing calls to Dir.chdir without a block (#5779)
* Use latest jemoji gem (#5782)
* Bump htmlproofer (#5781)
* Bump rubies we test against (#5784)
* Bump rdoc to v5.0 (#5797)

### Documentation

Expand All @@ -66,6 +83,13 @@
* Fix a minor grammatical mistake on themes' document ### -dev (#5748)
* Correct comments in data_reader.rb (#5621)
* Add jekyll-pre-commit to plugins list (#5752)
* Update quickstart.md (#5758)
* Correct minor typo (#5764)
* Fix a markdown link to look properly on the web (#5769)
* [docs] Info about the help command usage (#5312)
* Add missing merge labels for jekyllbot (#5753)
* Fix broken links in documentation (#5736)
* Docs: add `match_regex` and `replace_regex` filters (#5799)

## 3.3.1 / 2016-11-14

Expand Down
133 changes: 109 additions & 24 deletions docs/_docs/collections.md
Expand Up @@ -11,7 +11,13 @@ namespace.

## Using Collections

### Step 1: Tell Jekyll to read in your collection
To start using collections, follow these 3 steps:

* [Step 1: Tell Jekyll to read in your collection](#step1)
* [Step 2: Add your content](#step2)
* [Step 3: Optionally render your collection's documents into independent files](#step3)

### Step 1: Tell Jekyll to read in your collection {#step1}

Add the following to your site's `_config.yml` file, replacing `my_collection`
with the name of your collection:
Expand Down Expand Up @@ -40,12 +46,12 @@ defaults:
layout: page
```

### Step 2: Add your content
### Step 2: Add your content {#step2}

Create a corresponding folder (e.g. `<source>/_my_collection`) and add
documents. YAML Front Matter is read in as data if it exists, and everything
after it is stuck in the Document's `content` attribute. If no YAML Front
Matter is provided, Jekyll will not generate the file in your collection.
documents. YAML front matter is processed if the front matter exists, and everything
after the front matter is pushed into the document's `content` attribute. If no YAML front
matter is provided, Jekyll will not generate the file in your collection.

<div class="note info">
<h5>Be sure to name your directories correctly</h5>
Expand All @@ -55,7 +61,7 @@ your <code>_config.yml</code> file, with the addition of the preceding <code>_</
</p>
</div>

### Step 3: Optionally render your collection's documents into independent files
### Step 3: Optionally render your collection's documents into independent files {#step3}

If you'd like Jekyll to create a public-facing, rendered version of each
document in your collection, set the `output` key to `true` in your collection
Expand All @@ -72,19 +78,6 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`,
it will be rendered using Liquid and the Markdown converter of your
choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.

As for posts with [Permalinks](../permalinks/), the document
URL can be customized by setting `permalink` metadata for the collection:

```yaml
collections:
my_collection:
output: true
permalink: /awesome/:path/
```

For example, if you have `_my_collection/some_subdir/some_doc.md`, it will be
written out to `<dest>/awesome/some_subdir/some_doc/index.html`.

<div class="note info">
<h5>Don't forget to add YAML for processing</h5>
<p>
Expand All @@ -94,6 +87,21 @@ written out to `<dest>/awesome/some_subdir/some_doc/index.html`.
</p>
</div>

## Configuring permalinks for collections {#permalinks}

You can customize the [Permalinks](../permalinks/) for your collection's documents by setting `permalink` property in the collection's configuration as follows:

```yaml
collections:
my_collection:
output: true
permalink: /awesome/:path/:title.:output_ext
```

In this example, the collection documents will the have the URL of `awesome` followed by the path to the document and its file extension.

Collections have the following template variables available for permalinks:

<div class="mobile-side-scroller">
<table>
<thead>
Expand Down Expand Up @@ -148,15 +156,92 @@ written out to `<dest>/awesome/some_subdir/some_doc/index.html`.
</table>
</div>

## Permalink examples for collections

Depending on how you declare the permalinks in your configuration file, the permalinks and paths get written differently in the `_site` folder. A few examples will help clarify the options.

Let's say your collection is called `apidocs` with `doc1.md` in your collection. `doc1.md` is grouped inside a folder called `mydocs`. Your project's source directory for the collection looks this:

```
├── \_apidocs
│   └── mydocs
│   └── doc1.md
```

Based on this scenario, here are a few permalink options.

**Permalink configuration 1**: [Nothing configured] <br/>
**Output**:

```
├── apidocs
│   └── mydocs
│   └── doc1.html
```

**Permalink configuration 2**: `/:collection/:path/:title:output_ext` <br/>
**Output**:

```
├── apidocs
│   └── mydocs
│   └── doc1.html
```

**Permalink configuration 3**: No collection permalinks configured, but `pretty` configured for pages/posts. <br/>
**Output**:

```
├── apidocs
│   └── mydocs
│   └── doc1
│   └── index.html
```

**Permalink configuration 4**: `/awesome/:path/:title.html` <br/>
**Output**:

```
├── awesome
│   └── mydocs
│   └── doc1.html
```

**Permalink configuration 5**: `/awesome/:path/:title/` <br/>
**Output**:

```
├── awesome
│   └── mydocs
│   └── doc1
│   └── index.html
```

**Permalink configuration 6**: `/awesome/:title.html` <br/>
**Output**:

```
├── awesome
│   └── doc1.html
```

**Permalink configuration 7**: `:title.html`
**Output**:

```
├── doc1.html
```

## Liquid Attributes

### Collections

Each collection is accessible via the `site` Liquid variable. For example, if
Each collection is accessible as a field on the `site` variable. For example, if
you want to access the `albums` collection found in `_albums`, you'd use
`site.albums`. Each collection is itself an array of documents
(e.g. `site.albums` is an array of documents, much like `site.pages` and
`site.posts`). See below for how to access attributes of those documents.
`site.albums`.

Each collection is itself an array of documents (e.g., `site.albums` is an array of documents, much like `site.pages` and
`site.posts`). See the table below for how to access attributes of those documents.

The collections are also available under `site.collections`, with the metadata
you specified in your `_config.yml` (if present) and the following information:
Expand Down Expand Up @@ -334,7 +419,7 @@ file, each document has the following attributes:

Attributes from the YAML front matter can be accessed as data anywhere in the
site. Using the above example for configuring a collection as `site.albums`,
one might have front matter in an individual file structured as follows (which
you might have front matter in an individual file structured as follows (which
must use a supported markup format, and cannot be saved with a `.yaml`
extension):

Expand Down
3 changes: 1 addition & 2 deletions docs/_docs/deployment-methods.md
Expand Up @@ -167,7 +167,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://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku) 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

Expand Down Expand Up @@ -206,4 +206,3 @@ Setting up Kickster is very easy, just install the gem and you are good to go. M
[Aerobatic](https://www.aerobatic.com) is an add-on for Bitbucket that brings GitHub Pages style functionality to Bitbucket users. It includes continuous deployment, custom domains with a wildcard SSL cert, CDN, basic auth, and staging branches all in the box.

Automating the build and deployment of a Jekyll site is just as simple as GitHub Pages - push your changes to your repo (excluding the `_site` directory) and within seconds a build will be triggered and your built site deployed to our highly- available, globally distributed hosting service. The build process will even install and execute custom Ruby plugins. See our [Jekyll docs](https://www.aerobatic.com/docs/static-generators#jekyll) for more details.

2 changes: 1 addition & 1 deletion docs/_docs/extras.md
Expand Up @@ -14,7 +14,7 @@ Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](ht
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
```

For more information about getting started, check out [this excellent blog post](https://web.archive.org/web/20160522225559/http://gastonsanchez.com/opinion/2014/02/16/Mathjax-with-jekyll).
For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/visually-enforced/opinion/2014/02/16/Mathjax-with-jekyll/).

## Alternative Markdown Processors

Expand Down
10 changes: 4 additions & 6 deletions docs/_docs/github-pages.md
Expand Up @@ -11,15 +11,13 @@ content, they’re also a great way to host your Jekyll-powered website for free

Never built a website with GitHub Pages before? [See this marvelous guide by
Jonathan McGlone to get you up and running](http://jmcglone.com/guides/github-pages/).
This guide will teach you what you need to know about Git, GitHub, and Jekyll to
create your very own website on GitHub Pages.
This guide will teach you what you need to know about Git, GitHub, and Jekyll to create your very own website on GitHub Pages.

### Project Page URL Structure

Sometimes it's nice to preview your Jekyll site before you push your `gh-pages`
branch to GitHub. However, the subdirectory-like URL structure GitHub uses for
Project Pages complicates the proper resolution of URLs. In order to assure your
site builds properly, use `site.github.url` in your URL's.
Project Pages complicates the proper resolution of URLs. In order to assure your site builds properly, use `site.github.url` in your URL's.

```html
{% raw %}
Expand Down Expand Up @@ -90,7 +88,7 @@ gem 'github-pages'
And be sure to run `bundle update` often.

If you like to install `pages-gem` on Windows you can find instructions by Jens Willmer on
[how to install github-pages gem on Windows (x64)]("https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46#github-pages-and-plugins").
[how to install github-pages gem on Windows (x64)](https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46#github-pages-and-plugins).
</div>

<div class="note info">
Expand Down Expand Up @@ -138,7 +136,7 @@ looking at right now is contained in the [docs
folder]({{ site.repository }}/tree/master/docs) of the same repository.

Please refer to GitHub official documentation on
[user, organization and projets pages](https://help.github.com/articles/user-organization-and-project-pages/)
[user, organization and project pages](https://help.github.com/articles/user-organization-and-project-pages/)
to see more detailed examples.

<div class="note warning">
Expand Down

0 comments on commit fd13545

Please sign in to comment.