Merge branch 'master' into percent_r

* master: (22 commits)
  Update history to reflect merge of #4980 [ci skip]
  werdz
  Use jekyll-mentions and restructure
  Add post about GSoC project.
  Update history to reflect merge of #4976 [ci skip]
  Amend WEBrick default headers documentation
  Update history to reflect merge of #4966 [ci skip]
  .rubocop.yml - remove lib/jekyll.rb
  lib/jekyll.rb - fix offenses reported by rubocop method set_timezone is ignored using rubocop:disable Style/AccessorMethodName
  Update history to reflect merge of #4977 [ci skip]
  Update history to reflect merge of #4962 [ci skip]
  Update history to reflect merge of #4959 [ci skip]
  Fixed typo
  Changed github-gem to github-pages
  Included installation instructions
  Installation instructions for github-pages gem
  Added link to windows doc page
  Fix inaccurate HTTP response header field name
  Minor tweak to fix missing apostrophne
  Feedback for flubbed regex and prefer File's directory check
  ...
This commit is contained in:
Parker Moore 2016-06-03 22:09:15 -07:00
commit 8917fa8282
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
11 changed files with 212 additions and 100 deletions

View File

@ -15,10 +15,7 @@ AllCops:
- lib/jekyll/renderer.rb
- lib/jekyll/site.rb
- lib/jekyll/static_file.rb
- lib/jekyll/theme.rb
- lib/jekyll/url.rb
- lib/jekyll/utils.rb
- lib/jekyll.rb
- bin/**/*
- benchmark/**/*
- script/**/*

View File

@ -86,4 +86,5 @@ group :site do
gem "jekyll-sitemap"
gem "jekyll-seo-tag", "~> 1.1"
gem "jekyll-avatar"
gem "jekyll-mentions"
end

View File

@ -84,6 +84,8 @@
* Rubocop: Readers (#4932)
* rubocop: jekyll/lib/frontmatter_defaults.rb (#4974)
* rubocop: features/step_definitions.rb (#4956)
* Rubocop theme and url jekyll libs (#4959)
* Rubocop jekyll.rb (#4966)
### Site Enhancements
@ -128,6 +130,10 @@
* Corrected pagination docs for hidden: true feature (#4903)
* Remove a Broken Link for Refheap Plugin (#4971)
* Instructions on how to install github-gem on Windows (#4975)
* Minor tweak to fix missing apostrophne (#4962)
* Instructions on how to install github-gem on Windows (v2) (#4977)
* Fix inaccurate HTTP response header field name (#4976)
* Add post about GSoC project (#4980)
## 3.1.6 / 2016-05-19

View File

@ -6,79 +6,79 @@ $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is insta
#
# Returns nothing.
def require_all(path)
glob = File.join(File.dirname(__FILE__), path, '*.rb')
glob = File.join(File.dirname(__FILE__), path, "*.rb")
Dir[glob].sort.each do |f|
require f
end
end
# rubygems
require 'rubygems'
require "rubygems"
# stdlib
require "pathutil"
require 'forwardable'
require 'fileutils'
require 'time'
require 'English'
require 'pathname'
require 'logger'
require 'set'
require "forwardable"
require "fileutils"
require "time"
require "English"
require "pathname"
require "logger"
require "set"
# 3rd party
require 'safe_yaml/load'
require 'liquid'
require 'kramdown'
require 'colorator'
require "safe_yaml/load"
require "liquid"
require "kramdown"
require "colorator"
SafeYAML::OPTIONS[:suppress_warnings] = true
module Jekyll
# internal requires
autoload :Cleaner, 'jekyll/cleaner'
autoload :Collection, 'jekyll/collection'
autoload :Configuration, 'jekyll/configuration'
autoload :Convertible, 'jekyll/convertible'
autoload :Deprecator, 'jekyll/deprecator'
autoload :Document, 'jekyll/document'
autoload :Draft, 'jekyll/draft'
autoload :EntryFilter, 'jekyll/entry_filter'
autoload :Errors, 'jekyll/errors'
autoload :Excerpt, 'jekyll/excerpt'
autoload :External, 'jekyll/external'
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
autoload :Hooks, 'jekyll/hooks'
autoload :Layout, 'jekyll/layout'
autoload :CollectionReader, 'jekyll/readers/collection_reader'
autoload :DataReader, 'jekyll/readers/data_reader'
autoload :LayoutReader, 'jekyll/readers/layout_reader'
autoload :PostReader, 'jekyll/readers/post_reader'
autoload :PageReader, 'jekyll/readers/page_reader'
autoload :StaticFileReader, 'jekyll/readers/static_file_reader'
autoload :LogAdapter, 'jekyll/log_adapter'
autoload :Page, 'jekyll/page'
autoload :PluginManager, 'jekyll/plugin_manager'
autoload :Publisher, 'jekyll/publisher'
autoload :Reader, 'jekyll/reader'
autoload :Regenerator, 'jekyll/regenerator'
autoload :RelatedPosts, 'jekyll/related_posts'
autoload :Renderer, 'jekyll/renderer'
autoload :LiquidRenderer, 'jekyll/liquid_renderer'
autoload :Site, 'jekyll/site'
autoload :StaticFile, 'jekyll/static_file'
autoload :Stevenson, 'jekyll/stevenson'
autoload :Theme, 'jekyll/theme'
autoload :ThemeBuilder, 'jekyll/theme_builder'
autoload :URL, 'jekyll/url'
autoload :Utils, 'jekyll/utils'
autoload :VERSION, 'jekyll/version'
autoload :Cleaner, "jekyll/cleaner"
autoload :Collection, "jekyll/collection"
autoload :Configuration, "jekyll/configuration"
autoload :Convertible, "jekyll/convertible"
autoload :Deprecator, "jekyll/deprecator"
autoload :Document, "jekyll/document"
autoload :Draft, "jekyll/draft"
autoload :EntryFilter, "jekyll/entry_filter"
autoload :Errors, "jekyll/errors"
autoload :Excerpt, "jekyll/excerpt"
autoload :External, "jekyll/external"
autoload :FrontmatterDefaults, "jekyll/frontmatter_defaults"
autoload :Hooks, "jekyll/hooks"
autoload :Layout, "jekyll/layout"
autoload :CollectionReader, "jekyll/readers/collection_reader"
autoload :DataReader, "jekyll/readers/data_reader"
autoload :LayoutReader, "jekyll/readers/layout_reader"
autoload :PostReader, "jekyll/readers/post_reader"
autoload :PageReader, "jekyll/readers/page_reader"
autoload :StaticFileReader, "jekyll/readers/static_file_reader"
autoload :LogAdapter, "jekyll/log_adapter"
autoload :Page, "jekyll/page"
autoload :PluginManager, "jekyll/plugin_manager"
autoload :Publisher, "jekyll/publisher"
autoload :Reader, "jekyll/reader"
autoload :Regenerator, "jekyll/regenerator"
autoload :RelatedPosts, "jekyll/related_posts"
autoload :Renderer, "jekyll/renderer"
autoload :LiquidRenderer, "jekyll/liquid_renderer"
autoload :Site, "jekyll/site"
autoload :StaticFile, "jekyll/static_file"
autoload :Stevenson, "jekyll/stevenson"
autoload :Theme, "jekyll/theme"
autoload :ThemeBuilder, "jekyll/theme_builder"
autoload :URL, "jekyll/url"
autoload :Utils, "jekyll/utils"
autoload :VERSION, "jekyll/version"
# extensions
require 'jekyll/plugin'
require 'jekyll/converter'
require 'jekyll/generator'
require 'jekyll/command'
require 'jekyll/liquid_extensions'
require "jekyll/plugin"
require "jekyll/converter"
require "jekyll/generator"
require "jekyll/command"
require "jekyll/liquid_extensions"
require "jekyll/filters"
class << self
@ -94,19 +94,20 @@ module Jekyll
# options with anything in _config.yml, and adding the given options on top.
#
# override - A Hash of config directives that override any options in both
# the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
# the defaults and the config file.
# See Jekyll::Configuration::DEFAULTS for a
# list of option names and their defaults.
#
# Returns the final configuration Hash.
def configuration(override = Hash.new)
def configuration(override = {})
config = Configuration.new
unless override.delete('skip_config_files')
unless override.delete("skip_config_files")
config = config.read_config_files(config.config_files(override))
end
# Merge DEFAULTS < _config.yml < override
Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |config|
set_timezone(config['timezone']) if config['timezone']
Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |obj|
set_timezone(obj["timezone"]) if obj["timezone"]
end
end
@ -115,9 +116,11 @@ module Jekyll
# timezone - the IANA Time Zone
#
# Returns nothing
# rubocop:disable Style/AccessorMethodName
def set_timezone(timezone)
ENV['TZ'] = timezone
ENV["TZ"] = timezone
end
# rubocop:enable Style/AccessorMethodName
# Public: Fetch the logger instance for this Jekyll process.
#
@ -154,11 +157,11 @@ module Jekyll
def sanitized_path(base_directory, questionable_path)
return base_directory if base_directory.eql?(questionable_path)
questionable_path.insert(0, '/') if questionable_path.start_with?('~')
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
clean_path = File.expand_path(questionable_path, "/")
clean_path.sub!(/\A\w\:\//, '/')
clean_path.sub!(%r!\A\w:/!, "/")
if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
if clean_path.start_with?(base_directory.sub(%r!\A\w:/!, "/"))
clean_path
else
File.join(base_directory, clean_path)
@ -166,17 +169,17 @@ module Jekyll
end
# Conditional optimizations
Jekyll::External.require_if_present('liquid-c')
Jekyll::External.require_if_present("liquid-c")
end
end
require "jekyll/drops/drop"
require "jekyll/drops/document_drop"
require_all 'jekyll/commands'
require_all 'jekyll/converters'
require_all 'jekyll/converters/markdown'
require_all 'jekyll/drops'
require_all 'jekyll/generators'
require_all 'jekyll/tags'
require_all "jekyll/commands"
require_all "jekyll/converters"
require_all "jekyll/converters/markdown"
require_all "jekyll/drops"
require_all "jekyll/generators"
require_all "jekyll/tags"
require 'jekyll-sass-converter'
require "jekyll-sass-converter"

View File

@ -27,7 +27,7 @@ module Jekyll
def configure_sass
return unless sass_path
require 'sass'
require "sass"
Sass.load_paths << sass_path
end
@ -38,7 +38,7 @@ module Jekyll
return unless resolved_dir
path = Jekyll.sanitized_path(root, resolved_dir)
path if Dir.exists?(path)
path if File.directory?(path)
end
def realpath_for(folder)
@ -50,7 +50,8 @@ module Jekyll
def gemspec
@gemspec ||= Gem::Specification.find_by_name(name)
rescue Gem::LoadError
raise Jekyll::Errors::MissingDependencyException, "The #{name} theme could not be found."
raise Jekyll::Errors::MissingDependencyException,
"The #{name} theme could not be found."
end
end
end

View File

@ -1,4 +1,4 @@
require 'uri'
require "uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
@ -67,10 +67,10 @@ module Jekyll
def generate_url_from_hash(template)
@placeholders.inject(template) do |result, token|
break result if result.index(':').nil?
break result if result.index(":").nil?
if token.last.nil?
# Remove leading '/' to avoid generating urls with `//`
result.gsub(/\/:#{token.first}/, '')
# Remove leading "/" to avoid generating urls with `//`
result.gsub(%r!/:#{token.first}!, "")
else
result.gsub(/:#{token.first}/, self.class.escape_path(token.last))
end
@ -78,21 +78,21 @@ module Jekyll
end
def generate_url_from_drop(template)
template.gsub(/:([a-z_]+)/.freeze) do |match|
replacement = @placeholders.public_send(match.sub(':'.freeze, ''.freeze))
template.gsub(/:([a-z_]+)/) do |match|
replacement = @placeholders.public_send(match.sub(":".freeze, "".freeze))
if replacement.nil?
''.freeze
"".freeze
else
self.class.escape_path(replacement)
end
end.gsub(/\/\//.freeze, '/'.freeze)
end.gsub(%r!//!, "/".freeze)
end
# Returns a sanitized String URL, stripping "../../" and multiples of "/",
# as well as the beginning "/" so we can enforce and ensure it.
def sanitize_url(str)
"/" + str.gsub(/\/{2,}/, "/").gsub(/\.+\/|\A\/+/, "")
"/" + str.gsub(%r!/{2,}!, "/").gsub(%r!\.+/|\A/+!, "")
end
# Escapes a path to be a valid URL path segment
@ -106,7 +106,7 @@ module Jekyll
#
# Returns the escaped path.
def self.escape_path(path)
# Because URI.escape doesn't escape '?', '[' and ']' by default,
# Because URI.escape doesn't escape "?", "[" and "]" by default,
# specify unsafe string (except unreserved, sub-delims, ":", "@" and "/").
#
# URI path segment is defined in RFC 3986 as follows:
@ -116,7 +116,7 @@ module Jekyll
# pct-encoded = "%" HEXDIG HEXDIG
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*" / "+" / "," / ";" / "="
URI.escape(path, /[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]/).encode('utf-8')
URI.escape(path, %r{[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]}).encode("utf-8")
end
# Unescapes a URL path segment
@ -130,7 +130,7 @@ module Jekyll
#
# Returns the unescaped path.
def self.unescape_path(path)
URI.unescape(path.encode('utf-8'))
URI.unescape(path.encode("utf-8"))
end
end
end

View File

@ -32,3 +32,4 @@ gems:
- jekyll-sitemap
- jekyll-seo-tag
- jekyll-avatar
- jekyll-mentions

View File

@ -383,7 +383,7 @@ before your site is served.
</p>
</div>
## Custom WEBRick Headers
## Custom WEBrick Headers
You can provide custom headers for your site by adding them to `_config.yml`
@ -397,9 +397,10 @@ webrick:
### Defaults
We only provide one default and that's a Content-Type header that disables
caching in development so that you don't have to fight with Chrome's aggressive
caching when you are in development mode.
We provide by default `Content-Type` and `Cache-Control` response headers: one
dynamic in order to specify the nature of the data being served, the other
static in order to disable caching so that you don't have to fight with Chrome's
aggressive caching when you are in development mode.
## Specifying a Jekyll environment at build time
@ -462,7 +463,7 @@ defaults:
</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.
Here, we are scoping the `values` to any file that exists in the path `scope`. 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 %}
defaults:

View File

@ -81,6 +81,16 @@ gem 'github-pages'
</p>
</div>
<div class="note info">
<h5>Installing <code>github-pages</code> gem on Windows</h5>
<p>
While Windows is not officially supported, it is possible
to install <code>github-pages</code> gem on Windows.
Special instructions can be found on our
<a href="../windows/#installation">Windows-specific docs page</a>.
</p>
</div>
### User and Organization Pages
User and organization pages live in a special GitHub repository dedicated to

View File

@ -10,12 +10,14 @@ knowledge and lessons that have been unearthed by Windows users.
## Installation
Julian Thilo has written up instructions to get
[Jekyll running on Windows][windows-installation] and it seems to work for most
people. The instructions were written for Ruby 2.0.0, but should work for later
versions [prior to 2.2][hitimes-issue].
A quick way to install Jekyll is to follow the [installation instructions by David Burela](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/):
Alternatively David Burela has written instructions on [how to install Jekyll via Chocolatey with 3 command prompt entries](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/).
1. Install a package manager for Windows called [Chocolatey](https://chocolatey.org/install)
2. Install Ruby via Chocolatey: `choco install ruby -y`
3. Reopen a command prompt and install Jekyll: `gem install jekyll`
For a more conventional way of installing Jekyll you can follow the [installation instruction by Julian Thilo][windows-installation]. The instructions were written for Ruby 2.0.0, but should work for later
versions [prior to 2.2][hitimes-issue].
## Encoding
@ -44,3 +46,74 @@ with Windows. Add the following to the Gemfile for your site:
{% highlight ruby %}
gem 'wdm', '~> 0.1.0' if Gem.win_platform?
{% endhighlight %}
### How to install github-pages
This section is part of an article written by [Jens Willmer][jwillmerPost]. To follow the instructions you need to have [Chocolatey][] installed on your system. If you already have a version of Ruby installed you need to uninstall it before you can continue.
#### Install Ruby and Ruby development kit
Open a command prompt and execute the following commands:
* `choco install ruby -version 2.2.4`
* `choco install ruby2.devkit` - _needed for compilation of json gem_
#### Configure Ruby development kit
The development kit did not set the environment path for Ruby so we need to do it.
* Open command prompt in `C:\tools\DevKit2`
* Execute `ruby dk.rb init` to create a file called `config.yml`
* Edit the `config.yml` file and include the path to Ruby `- C:/tools/ruby22`
* Execute the following command to set the path: `ruby dk.rb install`
#### Nokogiri gem installation
This gem is also needed in the github-pages and to get it running on Windows x64 we have to install a few things.
**Note:** In the current [pre release][nokogiriFails] it works out of the box with Windows x64 but this version is not referenced in the github-pages.
`cinst -Source "https://go.microsoft.com/fwlink/?LinkID=230477" libxml2`{:.language-ruby}
`cinst -Source "https://go.microsoft.com/fwlink/?LinkID=230477" libxslt`{:.language-ruby}
`cinst -Source "https://go.microsoft.com/fwlink/?LinkID=230477" libiconv`{:.language-ruby}
```language-ruby
gem install nokogiri --^
--with-xml2-include=C:\Chocolatey\lib\libxml2.2.7.8.7\build\native\include^
--with-xml2-lib=C:\Chocolatey\lib\libxml2.redist.2.7.8.7\build\native\bin\v110\x64\Release\dynamic\cdecl^
--with-iconv-include=C:\Chocolatey\lib\libiconv.1.14.0.11\build\native\include^
--with-iconv-lib=C:\Chocolatey\lib\libiconv.redist.1.14.0.11\build\native\bin\v110\x64\Release\dynamic\cdecl^
--with-xslt-include=C:\Chocolatey\lib\libxslt.1.1.28.0\build\native\include^
--with-xslt-lib=C:\Chocolatey\lib\libxslt.redist.1.1.28.0\build\native\bin\v110\x64\Release\dynamic
```
#### Install github-pages
* Open command prompt and install [Bundler][]: `gem install bundler`
* Create a file called `Gemfile` without any extension in your root directory of your blog
* Copy & past the two lines into the file:
```language-ruby
source 'http://rubygems.org'
gem 'github-pages'
```
* **Note:** We use an unsecure connection because SSL throws exceptions in the version of Ruby
* Open a command prompt and install github-pages: `bundle install`
After this process you should have github-pages installed on your system and you can host your blog again with `jekyll s`. \\
There will be a warning on startup that you should include `gem 'wdm', '>= 0.1.0' if Gem.win_platform?` to your `Gemfile` but I could not get `jekyll s` working if I include that line so for the moment I ignore that warning.
In the future the installation process of the github-pages should be as simple as the setup of the blog. But as long as the new version of the Nokogiri ([v1.6.8][nokogiriReleases]) is not stable and referenced, it is work to get it up and running on Windows.
[jwillmerPost]: http://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46 "Installation instructions by Jens Willmer"
[Chocolatey]: https://chocolatey.org/install "Package manager for Windows"
[Bundler]: http://bundler.io/ "Ruby Dependencie Manager"
[nokogiriReleases]: https://github.com/sparklemotion/nokogiri/releases "Nokogiri Releases"
[nokogiriFails]: https://github.com/sparklemotion/nokogiri/issues/1456#issuecomment-206481794 "Nokogiri fails to install on Ruby 2.3 for Windows"

View File

@ -0,0 +1,19 @@
---
layout: news_item
title: "Jekyll's Google Summer of Code Project: The CMS You Always Wanted"
date: "2016-06-03 13:21:02 -0700"
author: parkr
categories: [community]
---
This year, Jekyll applied to be a part of [Google Summer of Code](https://summerofcode.withgoogle.com/how-it-works/). Students were able to propose any project related to Jekyll. With a gracious sponsorship from GitHub and the participation of myself, @benbalter and @jldec, Jekyll was able to accept two students for the 2016 season, @mertkahyaoglu and @rush-skills.
These students are working on a project that fills a huge need for the community: _a graphical solution for managing your site's content._ Current plans include a fully-integrated admin which spins up when you run jekyll serve and provides a friendly web interface for creating and editing your content. The server and web interface will speak a common HTTP interface so either piece could be switched out for, e.g. a server which writes directly to a repository on GitHub.
The strength of text files as the storage medium for content has been part of Jekyll's success. [Our homepage](/) lauds the absence of a traditional SQL database when using Jekyll your content should be what demands your time, not pesky database downtime. Unfortunately, understanding of the structure of a Jekyll site takes some work, enough that for some users, it's prohibitive to using Jekyll to accomplish their publishing goals.
Mert and Ankur both applied to take on this challenge and agreed to split the project, one taking on the web interface and the other taking on the backend. We're very excited to see a fully-functional CMS for Jekyll at the end of the summer produced by these excellent community members, and we hope you'll join us in cheering them on and sharing our gratitude for all their hard work.
Thanks, as always, for being part of such a wonderful community that made this all possible. I'm honored to work with each of you to create something folks all around the globe find a joy to use. I look forward to our continued work to move Jekyll forward.
As always, Happy Jekylling!