Merge branch 'master' into patch-19

This commit is contained in:
Pat Hawks 2017-03-24 17:27:01 -05:00
commit 01c95e85dd
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
15 changed files with 242 additions and 9 deletions

View File

@ -20,13 +20,21 @@
* Fix typo in contribution information (#5910)
* update plugin repo URL to reflect repo move (#5916)
* Update exclude array in configuration.md (#5947)
* Fixed path in "Improve this page" link in Tutorials section (#5951)
* Corrected permalink (#5949)
* Included more details about adding defaults to static files (#5971)
* Create buddyworks (#5962)
* added (buddyworks) to ci list (#5965)
* Add a tutorial on serving custom Error 404 page (#5946)
* add custom 404 to tutorial navigation (#5978)
### Development Fixes
* [Rubocop] add missing comma (#5835)
* Appease classifier-reborn (#5934)
* Allow releases & development on *-stable branches (#5926)
* Allow releases & development on `*-stable` branches (#5926)
* Add script/backport-pr (#5925)
* Prefer .yaml over .toml (#5966)
### Site Enhancements
@ -43,6 +51,11 @@
* Convertible#validate_permalink!: ensure the return value of data["permalink"] is a string before asking if it is empty (#5878)
* Allow abbreviated post dates (#5920)
* Remove dependency on include from default about.md (#5903)
* Allow colons in `uri_escape` filter (#5957)
## 3.4.3 / 2017-03-21
* Backport #5957 for v3.4.x: Allow colons in `uri_escape` filter (#5968)
## 3.4.2 / 2017-03-09

View File

@ -3,6 +3,7 @@
- home
- navigation
- orderofinterpretation
- custom-404-page
#- title: Another section
# tutorials:

View File

@ -0,0 +1,62 @@
---
title: "BuddyWorks"
---
[BuddyWorks][buddyworks-homepage] is a [Docker][docker-homepage]-based CI server that you can set up in 15-20 minutes to build, test, and deploy your Jekyll websites. It supports [GitHub][github-homepage], [Bitbucket][bitbucket-homepage], and [GitLab][gitlab-homepage] repositories, and can be installed on-premises or used in cloud. The following guide will show you how to set up a free environment to build and test your Jekyll project.
[buddyworks-homepage]: https://buddy.works
[docker-homepage]: https://www.docker.com/
[github-homepage]: https://github.com
[bitbucket-homepage]: https://bitbucket.org/
[gitlab-homepage]: https://gitlab.com
## 1. Getting started
1. Log in at https://buddy.works with your GitHub/Bitbucket account or email
2. Choose your Git provider and select or push your Jekyll Project
3. Create a new pipeline and set the trigger mode to 'On every push'
4. Add and configure the Jekyll action and save the pipeline
## 2. How it works
Whenever you make a push to the selected branch, the Jekyll action runs `jekyll build` in an isolated [Jekyll Docker image][jekyll-docker-image]. The output is generated to the `/filesystem` directory, and can be further deployed to FTP/SFTP and IaaS services. You can add your own commands, install additional packages, attach services, and run Selenium tests, as well as add other actions down the pipeline, eg. a Slack notification or an SSH script that will restart your server.
![Jekyll Build](https://buddy.works/data/blog/_images/buddyworks-jekyll-small.png)
[jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/
## 3. Using YAML for configuration
If you prefer configuration as code over GUI, you can generate a `buddy.yml` that will create a pipeline with the Jekyll action once you push it to the target branch:
```ruby
- pipeline: "Build and Deploy Jekyll site"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "master"
actions:
- action: "Execute: jekyll build"
type: "BUILD"
docker_image_name: "jekyll/jekyll"
docker_image_tag: "latest"
execute_commands:
- "chown jekyll:jekyll $WORKING_DIR"
- "jekyll build"
```
## 4. Setting up on-premises server
The self-hosted version of BuddyWorks can be installed on any type of server supporting Docker, including [Linux][bw-linux], [Mac][bw-mac], [AWS EC2][bw-aws-ec2], [DigitalOcean][bw-digitalocean], and [Microsoft Azure][bw-azure].
[bw-linux]: https://buddy.works/knowledge/standalone/installation-linux
[bw-mac]: https://buddy.works/knowledge/standalone/installation-mac-osx
[bw-aws-ec2]: https://buddy.works/knowledge/standalone/installation-amazon-ec2
[bw-digitalocean]: https://buddy.works/knowledge/standalone/installation-digitalocean
[bw-azure]: https://buddy.works/knowledge/standalone/installation-azure
## 5. Questions?
This entire guide is open-source. Go ahead and [edit it][jekyll-docs-ci-buddyworks] if you want to expand it or have a fix or [ask for help][jekyll-help] if you run into trouble and need assistance. BuddyWorks also has an [online community][buddyworks-forum] for help.
[jekyll-docs-ci-buddyworks]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/buddyworks.md
[jekyll-help]: https://jekyllrb.com/help/
[buddyworks-forum]: http://forum.buddy.works/

View File

@ -7,3 +7,4 @@ Continuous Integration (CI) enables you to publish your Jekyll generated website
* [Travis CI](travis-ci)
* [CircleCI](circleci)
* [BuddyWorks](buddyworks)

View File

@ -153,4 +153,4 @@ author: dave
{% endraw %}
```
For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see [Navigation](../navigation).
For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see [Navigation](/tutorials/navigation).

View File

@ -4,11 +4,16 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.4.3 / 2017-03-21
{: #v3-4-3}
- Backport [#5957]({{ site.repository }}/issues/5957) for v3.4.x: Allow colons in `uri_escape` filter ([#5968]({{ site.repository }}/issues/5968))
## 3.4.2 / 2017-03-09
{: #v3-4-2}
- Backport [#5871]({{ site.repository }}/issues/5871) for v3.4.x: Convert StaticFile liquid representation to
a Drop & add front matter defaults support to StaticFiles ([#5940]({{ site.repository }}/issues/5940))
- Backport [#5871]({{ site.repository }}/issues/5871) for v3.4.x: Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles ([#5940]({{ site.repository }}/issues/5940))
## 3.4.1 / 2017-03-02

View File

@ -65,3 +65,34 @@ following metadata:
</tbody>
</table>
</div>
Note that in the above table, `file` can be anything. It's simply an arbitrarily set variable used in your own logic (such as in a for loop). It isn't a global site or page variable.
## Add front matter to static files
Although you can't directly add front matter values to static files, you can set front matter values through the [defaults property](../configuration/#front-matter-defaults) in your configuration file. When Jekyll builds the site, it will use the front matter values you set.
Here's an example:
In your `_config.yml` file, add the following values to the `defaults` property:
```yaml
defaults:
- scope:
path: "assets/img"
values:
image: true
```
This assumes that your Jekyll site has a folder path of `assets/img` where you have images (static files) stored. When Jekyll builds the site, it will treat each image as if it had the front matter value of `image: true`.
Suppose you want to list all your image assets as contained in `assets/img`. You could use this for loop to look in the `static_files` object and get all static files that have this front matter property:
```liquid
{% raw %}{% assign image_files = site.static_files | where: "image", true %}
{% for myimage in image_files %}
{{ myimage.path }}
{% endfor %}{% endraw %}
```
When you build your site, the output will list the path to each file that meets this front matter condition.

View File

@ -10,7 +10,7 @@ layout: default
<div class="unit four-fifths">
<article>
<div class="improve right hide-on-mobiles">
<a href="https://github.com/jekyll/jekyll/edit/master/tutorials/{{ page.path }}"><i
<a href="https://github.com/jekyll/jekyll/edit/master/docs/{{ page.path }}"><i
class="fa fa-pencil"></i> &nbsp;Improve this page</a>
</div>
<h1>{{ page.title }}</h1>

View File

@ -0,0 +1,49 @@
---
title: 'Jekyll 3.4.3 Released'
date: 2017-03-21 08:52:53 -0500
author: pathawks
version: 3.4.3
categories: [release]
---
Another one-PR patch update as we continue our quest to destroy all bugs. A
fairly technical debriefing follows, but the TLDR is that we have updated the
`uri_escape` filter to more closely follow the pre-v3.4.0 behavior.
In [v3.4.0]({% link _posts/2017-01-18-jekyll-3-4-0-released.markdown %}), we
moved away from using the deprecated
[`URI.escape`](https://ruby-doc.org/stdlib-2.3.0/libdoc/uri/rdoc/URI/Escape.html#method-i-encode)
in favor of
[`Addressable::URI.encode`](http://www.rubydoc.info/gems/addressable/Addressable/URI#encode-class_method).
This is what powers our [`uri_escape`
filter](https://jekyllrb.com/docs/templates/).
While this transition was mostly a smooth one, the two methods are not
identical. While `URI.escape` was happy to escape any string,
`Addressable::URI.encode` first turns the string into an `Addressable::URI`
object, and will then escape each component of that object. In most cases, this
difference was insignificant, but there were a few cases where this caused some
unintended regressions when encoding colons.
While **Addressable** can understand that something like `"/example :page"` is a
relative URI, without the slash it cannot figure out how to turn
`"example :page"` into an `Addressable::URI` object. `URI.escape` had no such
objection. This lead to the following Liquid code working fine in Jekyll 3.3.x
but breaking in 3.4.0:
{% raw %}
```liquid
{{ "example :page" | uri_escape }}
```
{% endraw %}
This was not an intended consequence of switching to **Addressable**.
Fortunately, the solution was not complicated. **Addressable** has a method
[`Addressable::URI.normalize_component`](http://www.rubydoc.info/gems/addressable/Addressable/URI#normalize_component-class_method)
which will simply escape the characters in a string, much like `URI.escape`.
Thanks to @cameronmcefee and @FriesFlorian for reporting
[this issue](https://github.com/jekyll/jekyll/issues/5954).
Happy Jekylling!

View File

@ -0,0 +1,66 @@
---
layout: tutorials
permalink: /tutorials/custom-404-page/
title: Custom 404 Page
---
You can easily serve custom 404 error pages with Jekyll to replace the default **Error 404 -- File Not Found** page displayed when one tries to access a broken link on your site.
## On GitHub Pages
Any `404.html` at the **root of your `_site` directory** will be served automatically by GitHub Pages and the local WEBrick development server.
Simply add a `404.md` or `404.html` at the root of your site's source directory and include the YAML Front Matter data to use the theme's base layout.
If you plan to organize your files under subdirectories, the error page should have the following Front Matter Data, set: `permalink: /404.html`. This is to ensure that the compiled `404.html` resides at the root of your processed site, where it'll be picked by the server.
```
---
# example 404.md
layout: default
permalink: /404.html
---
# 404
Page not found! :(
```
## Hosting on Apache Web Servers
Apache Web Servers load a configuration file named [`.htaccess`](http://www.htaccess-guide.com/) that modifies the functionality of these servers.
Simply add the following to your `.htaccess` file.
```
ErrorDocument 404 /404.html
```
With an `.htaccess` file, you have the freedom to place your error page within a subdirectory.
```
ErrorDocument 404 /error_pages/404.html
```
Where the path is relative to your site's domain.
More info on configuring Apache Error Pages can found in [official documentation](https://httpd.apache.org/docs/current/mod/core.html#errordocument).
## Hosting on Nginx server
The procedure is just as simple as configuring Apache servers, but slightly different.
Add the following to the ngnix configuration file, `nginx.conf`, which is usually located inside `/etc/nginx/` or `/etc/nginx/conf/`:
```
server {
error_page 404 /404.html;
location /404.html {
internal;
}
}
```
The `location` directive prevents users from directly browsing the 404.html page.

View File

@ -1 +1 @@
3.4.2
3.4.3

View File

@ -137,7 +137,7 @@ module Jekyll
SafeYAML.load_file(filename) || {}
else
raise ArgumentError, "No parser for '#{filename}' is available.
Use a .toml or .y(a)ml file instead."
Use a .y(a)ml or .toml file instead."
end
end

View File

@ -152,7 +152,7 @@ module Jekyll
#
# Returns the escaped String.
def uri_escape(input)
Addressable::URI.encode(input)
Addressable::URI.normalize_component(input)
end
# Replace any whitespace in the input string with a single space

View File

@ -1,3 +1,3 @@
module Jekyll
VERSION = "3.4.2".freeze
VERSION = "3.4.3".freeze
end

View File

@ -317,6 +317,11 @@ class TestFilters < JekyllUnitTest
assert_equal "my%20things", @filter.uri_escape("my things")
end
should "allow colons in URI" do
assert_equal "foo:bar", @filter.uri_escape("foo:bar")
assert_equal "foo%20bar:baz", @filter.uri_escape("foo bar:baz")
end
context "absolute_url filter" do
should "produce an absolute URL from a page URL" do
page_url = "/about/my_favorite_page/"