jekyll 3.2.1 → 3.3.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -4
- data/exe/jekyll +1 -1
- data/lib/jekyll.rb +5 -3
- data/lib/jekyll/commands/build.rb +16 -5
- data/lib/jekyll/commands/new.rb +30 -4
- data/lib/jekyll/commands/new_theme.rb +4 -2
- data/lib/jekyll/commands/serve.rb +35 -10
- data/lib/jekyll/configuration.rb +1 -1
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/jekyll/convertible.rb +21 -82
- data/lib/jekyll/document.rb +116 -79
- data/lib/jekyll/excerpt.rb +1 -1
- data/lib/jekyll/filters.rb +3 -0
- data/lib/jekyll/filters/url_filters.rb +40 -0
- data/lib/jekyll/hooks.rb +2 -2
- data/lib/jekyll/page.rb +5 -1
- data/lib/jekyll/reader.rb +1 -0
- data/lib/jekyll/readers/theme_assets_reader.rb +47 -0
- data/lib/jekyll/renderer.rb +26 -6
- data/lib/jekyll/site.rb +10 -1
- data/lib/jekyll/static_file.rb +7 -2
- data/lib/jekyll/tags/highlight.rb +1 -1
- data/lib/jekyll/tags/link.rb +4 -2
- data/lib/jekyll/tags/post_url.rb +3 -2
- data/lib/jekyll/theme.rb +8 -4
- data/lib/jekyll/theme_builder.rb +1 -1
- data/lib/jekyll/utils.rb +13 -1
- data/lib/jekyll/utils/platforms.rb +39 -2
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_config.yml +7 -2
- data/lib/site_template/index.md +6 -0
- data/lib/theme_template/README.md.erb +1 -1
- data/lib/theme_template/gitignore.erb +1 -0
- data/lib/theme_template/theme.gemspec.erb +1 -1
- metadata +21 -7
- data/lib/site_template/css/main.scss +0 -39
- data/lib/site_template/feed.xml +0 -30
- data/lib/site_template/index.html +0 -23
data/lib/jekyll/site.rb
CHANGED
@@ -424,7 +424,16 @@ module Jekyll
|
|
424
424
|
private
|
425
425
|
def configure_theme
|
426
426
|
self.theme = nil
|
427
|
-
|
427
|
+
return if config["theme"].nil?
|
428
|
+
|
429
|
+
self.theme =
|
430
|
+
if config["theme"].is_a?(String)
|
431
|
+
Jekyll::Theme.new(config["theme"])
|
432
|
+
else
|
433
|
+
Jekyll.logger.warn "Theme:", "value of 'theme' in config should be " \
|
434
|
+
"String to use gem-based themes, but got #{config["theme"].class}"
|
435
|
+
nil
|
436
|
+
end
|
428
437
|
end
|
429
438
|
|
430
439
|
private
|
data/lib/jekyll/static_file.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Jekyll
|
2
2
|
class StaticFile
|
3
|
-
attr_reader :relative_path, :extname
|
3
|
+
attr_reader :relative_path, :extname, :name
|
4
4
|
|
5
5
|
class << self
|
6
6
|
# The cache of last modification times [path] -> mtime.
|
@@ -97,6 +97,8 @@ module Jekyll
|
|
97
97
|
|
98
98
|
def to_liquid
|
99
99
|
{
|
100
|
+
"basename" => File.basename(name, extname),
|
101
|
+
"name" => name,
|
100
102
|
"extname" => extname,
|
101
103
|
"modified_time" => modified_time,
|
102
104
|
"path" => File.join("", relative_path)
|
@@ -146,7 +148,10 @@ module Jekyll
|
|
146
148
|
else
|
147
149
|
FileUtils.copy_entry(path, dest_path)
|
148
150
|
end
|
149
|
-
|
151
|
+
|
152
|
+
unless File.symlink?(dest_path)
|
153
|
+
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
|
154
|
+
end
|
150
155
|
end
|
151
156
|
end
|
152
157
|
end
|
@@ -8,7 +8,7 @@ module Jekyll
|
|
8
8
|
# forms: name, name=value, or name="<quoted list>"
|
9
9
|
#
|
10
10
|
# <quoted list> is a space-separated list of numbers
|
11
|
-
SYNTAX = %r!^([a-zA-Z0-9
|
11
|
+
SYNTAX = %r!^([a-zA-Z0-9.+#_-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"))?)*)$!
|
12
12
|
|
13
13
|
def initialize(tag_name, markup, tokens)
|
14
14
|
super
|
data/lib/jekyll/tags/link.rb
CHANGED
@@ -16,8 +16,10 @@ module Jekyll
|
|
16
16
|
def render(context)
|
17
17
|
site = context.registers[:site]
|
18
18
|
|
19
|
-
site.
|
20
|
-
return
|
19
|
+
site.each_site_file do |item|
|
20
|
+
return item.url if item.relative_path == @relative_path
|
21
|
+
# This takes care of the case for static files that have a leading /
|
22
|
+
return item.url if item.relative_path == "/#{@relative_path}"
|
21
23
|
end
|
22
24
|
|
23
25
|
raise ArgumentError, <<eos
|
data/lib/jekyll/tags/post_url.rb
CHANGED
@@ -14,7 +14,8 @@ module Jekyll
|
|
14
14
|
"'#{name}' does not contain valid date and/or title."
|
15
15
|
end
|
16
16
|
|
17
|
-
@name_regex = %r
|
17
|
+
@name_regex = %r!^_posts/#{path}#{date}-#{slug}\.[^.]+|
|
18
|
+
^#{path}_posts/?#{date}-#{slug}\.[^.]+!x
|
18
19
|
end
|
19
20
|
|
20
21
|
def post_date
|
@@ -23,7 +24,7 @@ module Jekyll
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def ==(other)
|
26
|
-
other.
|
27
|
+
other.relative_path.match(@name_regex)
|
27
28
|
end
|
28
29
|
|
29
30
|
def deprecated_equality(other)
|
data/lib/jekyll/theme.rb
CHANGED
@@ -18,15 +18,19 @@ module Jekyll
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def includes_path
|
21
|
-
path_for
|
21
|
+
path_for "_includes".freeze
|
22
22
|
end
|
23
23
|
|
24
24
|
def layouts_path
|
25
|
-
path_for
|
25
|
+
path_for "_layouts".freeze
|
26
26
|
end
|
27
27
|
|
28
28
|
def sass_path
|
29
|
-
path_for
|
29
|
+
path_for "_sass".freeze
|
30
|
+
end
|
31
|
+
|
32
|
+
def assets_path
|
33
|
+
path_for "assets".freeze
|
30
34
|
end
|
31
35
|
|
32
36
|
def configure_sass
|
@@ -43,7 +47,7 @@ module Jekyll
|
|
43
47
|
end
|
44
48
|
|
45
49
|
def realpath_for(folder)
|
46
|
-
File.realpath(Jekyll.sanitized_path(root,
|
50
|
+
File.realpath(Jekyll.sanitized_path(root, folder.to_s))
|
47
51
|
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
|
48
52
|
nil
|
49
53
|
end
|
data/lib/jekyll/theme_builder.rb
CHANGED
data/lib/jekyll/utils.rb
CHANGED
@@ -6,10 +6,11 @@ module Jekyll
|
|
6
6
|
autoload :Ansi, "jekyll/utils/ansi"
|
7
7
|
|
8
8
|
# Constants for use in #slugify
|
9
|
-
SLUGIFY_MODES = %w(raw default pretty).freeze
|
9
|
+
SLUGIFY_MODES = %w(raw default pretty ascii).freeze
|
10
10
|
SLUGIFY_RAW_REGEXP = Regexp.new('\\s+').freeze
|
11
11
|
SLUGIFY_DEFAULT_REGEXP = Regexp.new("[^[:alnum:]]+").freeze
|
12
12
|
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
|
13
|
+
SLUGIFY_ASCII_REGEXP = Regexp.new("[^[A-Za-z0-9]]+").freeze
|
13
14
|
|
14
15
|
# Takes an indented string and removes the preceding spaces on each line
|
15
16
|
|
@@ -160,6 +161,9 @@ module Jekyll
|
|
160
161
|
# When mode is "pretty", some non-alphabetic characters (._~!$&'()+,;=@)
|
161
162
|
# are not replaced with hyphen.
|
162
163
|
#
|
164
|
+
# When mode is "ascii", some everything else except ASCII characters
|
165
|
+
# a-z (lowercase), A-Z (uppercase) and 0-9 (numbers) are not replaced with hyphen.
|
166
|
+
#
|
163
167
|
# If cased is true, all uppercase letters in the result string are
|
164
168
|
# replaced with their lowercase counterparts.
|
165
169
|
#
|
@@ -173,6 +177,9 @@ module Jekyll
|
|
173
177
|
# slugify("The _config.yml file", "pretty", true)
|
174
178
|
# # => "The-_config.yml file"
|
175
179
|
#
|
180
|
+
# slugify("The _config.yml file", "ascii")
|
181
|
+
# # => "the-config.yml-file"
|
182
|
+
#
|
176
183
|
# Returns the slugified string.
|
177
184
|
def slugify(string, mode: nil, cased: false)
|
178
185
|
mode ||= "default"
|
@@ -193,6 +200,11 @@ module Jekyll
|
|
193
200
|
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
194
201
|
# and is allowed in both extN and NTFS.
|
195
202
|
SLUGIFY_PRETTY_REGEXP
|
203
|
+
when "ascii"
|
204
|
+
# For web servers not being able to handle Unicode, the safe
|
205
|
+
# method is to ditch anything else but latin letters and numeric
|
206
|
+
# digits.
|
207
|
+
SLUGIFY_ASCII_REGEXP
|
196
208
|
end
|
197
209
|
|
198
210
|
# Strip according to the mode
|
@@ -13,18 +13,55 @@ module Jekyll
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
# --
|
17
|
+
# Allows you to detect "real" Windows, or what we would consider
|
18
|
+
# "real" Windows. That is, that we can pass the basic test and the
|
19
|
+
# /proc/version returns nothing to us.
|
20
|
+
# --
|
21
|
+
|
22
|
+
def really_windows?
|
23
|
+
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
|
24
|
+
!proc_version
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
|
29
|
+
def windows?
|
30
|
+
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i || \
|
31
|
+
proc_version =~ %r!microsoft!i
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
|
36
|
+
def linux?
|
37
|
+
RbConfig::CONFIG["host_os"] =~ %r!linux! && \
|
38
|
+
proc_version !~ %r!microsoft!i
|
39
|
+
end
|
40
|
+
|
16
41
|
# Provides windows?, linux?, osx?, unix? so that we can detect
|
17
42
|
# platforms. This is mostly useful for `jekyll doctor` and for testing
|
18
43
|
# where we kick off certain tests based on the platform.
|
19
44
|
|
20
|
-
{ :
|
21
|
-
:osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
|
45
|
+
{ :osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
|
22
46
|
define_method k do
|
23
47
|
!!(
|
24
48
|
RbConfig::CONFIG["host_os"] =~ v
|
25
49
|
)
|
26
50
|
end
|
27
51
|
end
|
52
|
+
|
53
|
+
#
|
54
|
+
|
55
|
+
private
|
56
|
+
def proc_version
|
57
|
+
@cached_proc_version ||= begin
|
58
|
+
Pathutil.new(
|
59
|
+
"/proc/version"
|
60
|
+
).read
|
61
|
+
rescue Errno::ENOENT
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
end
|
28
65
|
end
|
29
66
|
end
|
30
67
|
end
|
data/lib/jekyll/version.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# feature for the data you need to update frequently.
|
7
7
|
#
|
8
8
|
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
9
|
-
# 'jekyll serve'. If you change this file, please restart the server process.
|
9
|
+
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
|
10
10
|
|
11
11
|
# Site settings
|
12
12
|
# These are used to personalize your new site. If you look in the HTML files,
|
@@ -20,10 +20,15 @@ description: > # this means to ignore newlines until "baseurl:"
|
|
20
20
|
line in _config.yml. It will appear in your document head meta (for
|
21
21
|
Google search results) and in your feed.xml site description.
|
22
22
|
baseurl: "" # the subpath of your site, e.g. /blog
|
23
|
-
url: "
|
23
|
+
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
24
24
|
twitter_username: jekyllrb
|
25
25
|
github_username: jekyll
|
26
26
|
|
27
27
|
# Build settings
|
28
28
|
markdown: kramdown
|
29
29
|
theme: minima
|
30
|
+
gems:
|
31
|
+
- jekyll-feed
|
32
|
+
exclude:
|
33
|
+
- Gemfile
|
34
|
+
- Gemfile.lock
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
11
11
|
spec.license = "MIT"
|
12
12
|
|
13
|
-
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(<%= theme_directories.join("|") %>|LICENSE|README)
|
13
|
+
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(<%= theme_directories.join("|") %>|LICENSE|README)}i) }
|
14
14
|
|
15
15
|
spec.add_development_dependency "jekyll", "~> <%= jekyll_version_with_minor %>"
|
16
16
|
spec.add_development_dependency "bundler", "~> 1.12"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0.pre.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0.9'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: addressable
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.4'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '2.4'
|
139
153
|
description: Jekyll is a simple, blog aware, static site generator.
|
140
154
|
email: tom@mojombo.com
|
141
155
|
executables:
|
@@ -185,6 +199,7 @@ files:
|
|
185
199
|
- lib/jekyll/excerpt.rb
|
186
200
|
- lib/jekyll/external.rb
|
187
201
|
- lib/jekyll/filters.rb
|
202
|
+
- lib/jekyll/filters/url_filters.rb
|
188
203
|
- lib/jekyll/frontmatter_defaults.rb
|
189
204
|
- lib/jekyll/generator.rb
|
190
205
|
- lib/jekyll/hooks.rb
|
@@ -206,6 +221,7 @@ files:
|
|
206
221
|
- lib/jekyll/readers/page_reader.rb
|
207
222
|
- lib/jekyll/readers/post_reader.rb
|
208
223
|
- lib/jekyll/readers/static_file_reader.rb
|
224
|
+
- lib/jekyll/readers/theme_assets_reader.rb
|
209
225
|
- lib/jekyll/regenerator.rb
|
210
226
|
- lib/jekyll/related_posts.rb
|
211
227
|
- lib/jekyll/renderer.rb
|
@@ -227,9 +243,7 @@ files:
|
|
227
243
|
- lib/site_template/_config.yml
|
228
244
|
- lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb
|
229
245
|
- lib/site_template/about.md
|
230
|
-
- lib/site_template/
|
231
|
-
- lib/site_template/feed.xml
|
232
|
-
- lib/site_template/index.html
|
246
|
+
- lib/site_template/index.md
|
233
247
|
- lib/theme_template/CODE_OF_CONDUCT.md.erb
|
234
248
|
- lib/theme_template/Gemfile
|
235
249
|
- lib/theme_template/LICENSE.txt.erb
|
@@ -259,9 +273,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
273
|
version: 2.0.0
|
260
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
275
|
requirements:
|
262
|
-
- - "
|
276
|
+
- - ">"
|
263
277
|
- !ruby/object:Gem::Version
|
264
|
-
version:
|
278
|
+
version: 1.3.1
|
265
279
|
requirements: []
|
266
280
|
rubyforge_project:
|
267
281
|
rubygems_version: 2.5.1
|
@@ -1,39 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# Only the main Sass file needs front matter (the dashes are enough)
|
3
|
-
---
|
4
|
-
@charset "utf-8";
|
5
|
-
|
6
|
-
// Our variables
|
7
|
-
$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
8
|
-
$base-font-size: 16px;
|
9
|
-
$base-font-weight: 400;
|
10
|
-
$small-font-size: $base-font-size * 0.875;
|
11
|
-
$base-line-height: 1.5;
|
12
|
-
|
13
|
-
$spacing-unit: 30px;
|
14
|
-
|
15
|
-
$text-color: #111;
|
16
|
-
$background-color: #fdfdfd;
|
17
|
-
$brand-color: #2a7ae2;
|
18
|
-
|
19
|
-
$grey-color: #828282;
|
20
|
-
$grey-color-light: lighten($grey-color, 40%);
|
21
|
-
$grey-color-dark: darken($grey-color, 25%);
|
22
|
-
|
23
|
-
// Width of the content area
|
24
|
-
$content-width: 800px;
|
25
|
-
|
26
|
-
$on-palm: 600px;
|
27
|
-
$on-laptop: 800px;
|
28
|
-
|
29
|
-
// Minima also includes a mixin for defining media queries.
|
30
|
-
// Use media queries like this:
|
31
|
-
// @include media-query($on-palm) {
|
32
|
-
// .wrapper {
|
33
|
-
// padding-right: $spacing-unit / 2;
|
34
|
-
// padding-left: $spacing-unit / 2;
|
35
|
-
// }
|
36
|
-
// }
|
37
|
-
|
38
|
-
// Import partials from the `minima` theme.
|
39
|
-
@import "minima";
|
data/lib/site_template/feed.xml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: null
|
3
|
-
---
|
4
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
-
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
6
|
-
<channel>
|
7
|
-
<title>{{ site.title | xml_escape }}</title>
|
8
|
-
<description>{{ site.description | xml_escape }}</description>
|
9
|
-
<link>{{ site.url }}{{ site.baseurl }}/</link>
|
10
|
-
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
|
11
|
-
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
|
12
|
-
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
|
13
|
-
<generator>Jekyll v{{ jekyll.version }}</generator>
|
14
|
-
{% for post in site.posts limit:10 %}
|
15
|
-
<item>
|
16
|
-
<title>{{ post.title | xml_escape }}</title>
|
17
|
-
<description>{{ post.content | xml_escape }}</description>
|
18
|
-
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
|
19
|
-
<link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link>
|
20
|
-
<guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid>
|
21
|
-
{% for tag in post.tags %}
|
22
|
-
<category>{{ tag | xml_escape }}</category>
|
23
|
-
{% endfor %}
|
24
|
-
{% for cat in post.categories %}
|
25
|
-
<category>{{ cat | xml_escape }}</category>
|
26
|
-
{% endfor %}
|
27
|
-
</item>
|
28
|
-
{% endfor %}
|
29
|
-
</channel>
|
30
|
-
</rss>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: default
|
3
|
-
---
|
4
|
-
|
5
|
-
<div class="home">
|
6
|
-
|
7
|
-
<h1 class="page-heading">Posts</h1>
|
8
|
-
|
9
|
-
<ul class="post-list">
|
10
|
-
{% for post in site.posts %}
|
11
|
-
<li>
|
12
|
-
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
|
13
|
-
|
14
|
-
<h2>
|
15
|
-
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title | escape }}</a>
|
16
|
-
</h2>
|
17
|
-
</li>
|
18
|
-
{% endfor %}
|
19
|
-
</ul>
|
20
|
-
|
21
|
-
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
|
22
|
-
|
23
|
-
</div>
|