jekyll 3.2.0.pre.beta2 → 3.2.0
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/lib/jekyll/collection.rb +1 -1
- data/lib/jekyll/command.rb +2 -0
- data/lib/jekyll/commands/serve.rb +0 -1
- data/lib/jekyll/configuration.rb +1 -1
- data/lib/jekyll/convertible.rb +8 -8
- data/lib/jekyll/document.rb +1 -1
- data/lib/jekyll/drops/document_drop.rb +1 -1
- data/lib/jekyll/filters.rb +6 -6
- data/lib/jekyll/liquid_renderer.rb +7 -0
- data/lib/jekyll/liquid_renderer/file.rb +4 -0
- data/lib/jekyll/liquid_renderer/table.rb +1 -1
- data/lib/jekyll/renderer.rb +7 -6
- data/lib/jekyll/site.rb +2 -1
- data/lib/jekyll/theme_builder.rb +1 -13
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/about.md +2 -2
- data/lib/theme_template/README.md.erb +3 -1
- metadata +5 -6
- data/lib/theme_template/Rakefile.erb +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb6d09c543908a9e92a03dec3e709e25bb0a291f
|
4
|
+
data.tar.gz: 3b306c86e96b2cf1ec0a4f7bf00abc1ef5970d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4df49dea68ad05648ea7d75a7142b57948f11a011d78810150253190de4c17e074278394a0e757ff4ac868883ad0ca7d7cc8a868a4e2d9bdad7da3bb2fb00042
|
7
|
+
data.tar.gz: 6a31318b580d36092a51a128f2ad8e8cec93251ac5c83c2b9be8517e965515520914013938c1c2babe3a51afb2685f42fb0aea0e6b61ae84c6fb02b259d84ed6
|
data/lib/jekyll/collection.rb
CHANGED
@@ -25,7 +25,7 @@ module Jekyll
|
|
25
25
|
|
26
26
|
# Override of normal respond_to? to match method_missing's logic for
|
27
27
|
# looking in @data.
|
28
|
-
def
|
28
|
+
def respond_to_missing?(method, include_private = false)
|
29
29
|
docs.respond_to?(method.to_sym, include_private) || super
|
30
30
|
end
|
31
31
|
|
data/lib/jekyll/command.rb
CHANGED
@@ -55,6 +55,8 @@ module Jekyll
|
|
55
55
|
c.option "limit_posts", "--limit_posts MAX_POSTS", Integer,
|
56
56
|
"Limits the number of posts to parse and publish"
|
57
57
|
c.option "watch", "-w", "--[no-]watch", "Watch for changes and rebuild"
|
58
|
+
c.option "baseurl", "-b", "--baseurl URL",
|
59
|
+
"Serve the website from the given base URL"
|
58
60
|
c.option "force_polling", "--force_polling", "Force watch to use polling"
|
59
61
|
c.option "lsi", "--lsi", "Use LSI for improved related posts"
|
60
62
|
c.option "show_drafts", "-D", "--drafts", "Render posts in the _drafts folder"
|
@@ -9,7 +9,6 @@ module Jekyll
|
|
9
9
|
"detach" => ["-B", "--detach", "Run the server in the background"],
|
10
10
|
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
|
11
11
|
"port" => ["-P", "--port [PORT]", "Port to listen on"],
|
12
|
-
"baseurl" => ["-b", "--baseurl [URL]", "Base URL"],
|
13
12
|
"show_dir_listing" => ["--show-dir-listing",
|
14
13
|
"Show a directory listing instead of loading your index file."],
|
15
14
|
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
|
data/lib/jekyll/configuration.rb
CHANGED
@@ -374,7 +374,7 @@ module Jekyll
|
|
374
374
|
|
375
375
|
private
|
376
376
|
def check_maruku(config)
|
377
|
-
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku")
|
377
|
+
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku").zero?
|
378
378
|
Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " \
|
379
379
|
"Markdown processor, which has been removed as of 3.0.0. " \
|
380
380
|
"We recommend you switch to Kramdown. To do this, replace " \
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -114,16 +114,16 @@ module Jekyll
|
|
114
114
|
#
|
115
115
|
# Returns the converted content
|
116
116
|
def render_liquid(content, payload, info, path)
|
117
|
-
site.liquid_renderer.file(path).parse(content)
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
)
|
123
|
-
raise e
|
117
|
+
template = site.liquid_renderer.file(path).parse(content)
|
118
|
+
template.warnings.each do |e|
|
119
|
+
Jekyll.logger.warn "Liquid Warning:",
|
120
|
+
LiquidRenderer.format_error(e, path || self.path)
|
121
|
+
end
|
122
|
+
template.render!(payload, info)
|
124
123
|
# rubocop: disable RescueException
|
125
124
|
rescue Exception => e
|
126
|
-
Jekyll.logger.error "Liquid Exception:",
|
125
|
+
Jekyll.logger.error "Liquid Exception:",
|
126
|
+
LiquidRenderer.format_error(e, path || self.path)
|
127
127
|
raise e
|
128
128
|
end
|
129
129
|
# rubocop: enable RescueException
|
data/lib/jekyll/document.rb
CHANGED
@@ -367,7 +367,7 @@ module Jekyll
|
|
367
367
|
def <=>(other)
|
368
368
|
return nil unless other.respond_to?(:data)
|
369
369
|
cmp = data["date"] <=> other.data["date"]
|
370
|
-
cmp = path <=> other.path if cmp.nil? || cmp
|
370
|
+
cmp = path <=> other.path if cmp.nil? || cmp.zero?
|
371
371
|
cmp
|
372
372
|
end
|
373
373
|
|
@@ -25,7 +25,7 @@ module Jekyll
|
|
25
25
|
def <=>(other)
|
26
26
|
return nil unless other.is_a? DocumentDrop
|
27
27
|
cmp = self["date"] <=> other["date"]
|
28
|
-
cmp = self["path"] <=> other["path"] if cmp.nil? || cmp
|
28
|
+
cmp = self["path"] <=> other["path"] if cmp.nil? || cmp.zero?
|
29
29
|
cmp
|
30
30
|
end
|
31
31
|
|
data/lib/jekyll/filters.rb
CHANGED
@@ -233,11 +233,11 @@ module Jekyll
|
|
233
233
|
#
|
234
234
|
# Returns the filtered array of objects
|
235
235
|
def where(input, property, value)
|
236
|
-
return input unless input.
|
236
|
+
return input unless input.respond_to?(:select)
|
237
237
|
input = input.values if input.is_a?(Hash)
|
238
238
|
input.select do |object|
|
239
239
|
Array(item_property(object, property)).map(&:to_s).include?(value.to_s)
|
240
|
-
end
|
240
|
+
end || []
|
241
241
|
end
|
242
242
|
|
243
243
|
# Filters an array of objects against an expression
|
@@ -248,7 +248,7 @@ module Jekyll
|
|
248
248
|
#
|
249
249
|
# Returns the filtered array of objects
|
250
250
|
def where_exp(input, variable, expression)
|
251
|
-
return input unless input.
|
251
|
+
return input unless input.respond_to?(:select)
|
252
252
|
input = input.values if input.is_a?(Hash) # FIXME
|
253
253
|
|
254
254
|
condition = parse_condition(expression)
|
@@ -257,7 +257,7 @@ module Jekyll
|
|
257
257
|
@context[variable] = object
|
258
258
|
condition.evaluate(@context)
|
259
259
|
end
|
260
|
-
end
|
260
|
+
end || []
|
261
261
|
end
|
262
262
|
|
263
263
|
# Convert the input into integer
|
@@ -373,8 +373,8 @@ module Jekyll
|
|
373
373
|
when Numeric
|
374
374
|
Time.at(input)
|
375
375
|
else
|
376
|
-
|
377
|
-
|
376
|
+
raise Errors::InvalidDateError,
|
377
|
+
"Invalid Date: '#{input.inspect}' is not a valid datetime."
|
378
378
|
end.localtime
|
379
379
|
end
|
380
380
|
|
@@ -39,5 +39,12 @@ module Jekyll
|
|
39
39
|
def stats_table(n = 50)
|
40
40
|
LiquidRenderer::Table.new(@stats).to_s(n)
|
41
41
|
end
|
42
|
+
|
43
|
+
def self.format_error(e, path)
|
44
|
+
if e.is_a? Tags::IncludeTagError
|
45
|
+
return "#{e.message} in #{e.path}, included in #{path}"
|
46
|
+
end
|
47
|
+
"#{e.message} in #{path}"
|
48
|
+
end
|
42
49
|
end
|
43
50
|
end
|
data/lib/jekyll/renderer.rb
CHANGED
@@ -106,15 +106,16 @@ module Jekyll
|
|
106
106
|
#
|
107
107
|
# Returns the content, rendered by Liquid.
|
108
108
|
def render_liquid(content, payload, info, path = nil)
|
109
|
-
site.liquid_renderer.file(path).parse(content)
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
template = site.liquid_renderer.file(path).parse(content)
|
110
|
+
template.warnings.each do |e|
|
111
|
+
Jekyll.logger.warn "Liquid Warning:",
|
112
|
+
LiquidRenderer.format_error(e, path || document.relative_path)
|
113
|
+
end
|
114
|
+
template.render!(payload, info)
|
114
115
|
# rubocop: disable RescueException
|
115
116
|
rescue Exception => e
|
116
117
|
Jekyll.logger.error "Liquid Exception:",
|
117
|
-
|
118
|
+
LiquidRenderer.format_error(e, path || document.relative_path)
|
118
119
|
raise e
|
119
120
|
end
|
120
121
|
# rubocop: enable RescueException
|
data/lib/jekyll/site.rb
CHANGED
@@ -172,7 +172,8 @@ module Jekyll
|
|
172
172
|
generators.each do |generator|
|
173
173
|
start = Time.now
|
174
174
|
generator.generate(self)
|
175
|
-
Jekyll.logger.debug "Generating:",
|
175
|
+
Jekyll.logger.debug "Generating:",
|
176
|
+
"#{generator.class} finished in #{Time.now - start} seconds."
|
176
177
|
end
|
177
178
|
end
|
178
179
|
|
data/lib/jekyll/theme_builder.rb
CHANGED
@@ -16,7 +16,6 @@ class Jekyll::ThemeBuilder
|
|
16
16
|
create_starter_files
|
17
17
|
create_gemspec
|
18
18
|
create_accessories
|
19
|
-
create_example_site
|
20
19
|
initialize_git_repo
|
21
20
|
end
|
22
21
|
|
@@ -57,7 +56,6 @@ class Jekyll::ThemeBuilder
|
|
57
56
|
|
58
57
|
def create_directories
|
59
58
|
mkdir_p(SCAFFOLD_DIRECTORIES)
|
60
|
-
mkdir_p(%w(example example/_posts))
|
61
59
|
end
|
62
60
|
|
63
61
|
def create_starter_files
|
@@ -72,23 +70,13 @@ class Jekyll::ThemeBuilder
|
|
72
70
|
end
|
73
71
|
|
74
72
|
def create_accessories
|
75
|
-
accessories = %w(README.md
|
73
|
+
accessories = %w(README.md LICENSE.txt)
|
76
74
|
accessories << "CODE_OF_CONDUCT.md" if code_of_conduct
|
77
75
|
accessories.each do |filename|
|
78
76
|
write_file(filename, template(filename))
|
79
77
|
end
|
80
78
|
end
|
81
79
|
|
82
|
-
def create_example_site
|
83
|
-
%w(example/_config.yml example/index.html example/style.scss).each do |filename|
|
84
|
-
write_file(filename, template(filename))
|
85
|
-
end
|
86
|
-
write_file(
|
87
|
-
"example/_posts/#{Time.now.strftime("%Y-%m-%d")}-my-example-post.md",
|
88
|
-
template("example/_post.md")
|
89
|
-
)
|
90
|
-
end
|
91
|
-
|
92
80
|
def initialize_git_repo
|
93
81
|
Jekyll.logger.info "initialize", path.join(".git").to_s
|
94
82
|
Dir.chdir(path.to_s) { `git init` }
|
data/lib/jekyll/version.rb
CHANGED
data/lib/site_template/about.md
CHANGED
@@ -7,8 +7,8 @@ permalink: /about/
|
|
7
7
|
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/)
|
8
8
|
|
9
9
|
You can find the source code for the Jekyll new theme at:
|
10
|
-
{% include icon-github.html username="
|
11
|
-
[
|
10
|
+
{% include icon-github.html username="jekyll" %} /
|
11
|
+
[minima](https://github.com/jekyll/minima)
|
12
12
|
|
13
13
|
You can find the source code for Jekyll at
|
14
14
|
{% include icon-github.html username="jekyll" %} /
|
@@ -38,7 +38,9 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
38
38
|
|
39
39
|
To set up your environment to develop this theme, run `bundle install`.
|
40
40
|
|
41
|
-
To test your theme, run `bundle exec
|
41
|
+
You theme is setup just like a normal Jelyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
42
|
+
|
43
|
+
When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
|
42
44
|
|
43
45
|
## License
|
44
46
|
|
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.2.0
|
4
|
+
version: 3.2.0
|
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-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -234,7 +234,6 @@ files:
|
|
234
234
|
- lib/theme_template/Gemfile
|
235
235
|
- lib/theme_template/LICENSE.txt.erb
|
236
236
|
- lib/theme_template/README.md.erb
|
237
|
-
- lib/theme_template/Rakefile.erb
|
238
237
|
- lib/theme_template/_layouts/default.html
|
239
238
|
- lib/theme_template/_layouts/page.html
|
240
239
|
- lib/theme_template/_layouts/post.html
|
@@ -260,12 +259,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
259
|
version: 2.0.0
|
261
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
261
|
requirements:
|
263
|
-
- - "
|
262
|
+
- - ">="
|
264
263
|
- !ruby/object:Gem::Version
|
265
|
-
version:
|
264
|
+
version: '0'
|
266
265
|
requirements: []
|
267
266
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.
|
267
|
+
rubygems_version: 2.5.1
|
269
268
|
signing_key:
|
270
269
|
specification_version: 2
|
271
270
|
summary: A simple, blog aware, static site generator.
|
@@ -1,74 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "jekyll"
|
3
|
-
require "listen"
|
4
|
-
|
5
|
-
def listen_ignore_paths(base, options)
|
6
|
-
[
|
7
|
-
/_config\.ya?ml/,
|
8
|
-
/_site/,
|
9
|
-
/\.jekyll-metadata/
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
def listen_handler(base, options)
|
14
|
-
site = Jekyll::Site.new(options)
|
15
|
-
Jekyll::Command.process_site(site)
|
16
|
-
proc do |modified, added, removed|
|
17
|
-
t = Time.now
|
18
|
-
c = modified + added + removed
|
19
|
-
n = c.length
|
20
|
-
relative_paths = c.map{ |p| Pathname.new(p).relative_path_from(base).to_s }
|
21
|
-
print Jekyll.logger.message("Regenerating:", "#{relative_paths.join(", ")} changed... ")
|
22
|
-
begin
|
23
|
-
Jekyll::Command.process_site(site)
|
24
|
-
puts "regenerated in #{Time.now - t} seconds."
|
25
|
-
rescue => e
|
26
|
-
puts "error:"
|
27
|
-
Jekyll.logger.warn "Error:", e.message
|
28
|
-
Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
task :preview do
|
34
|
-
base = Pathname.new('.').expand_path
|
35
|
-
options = {
|
36
|
-
"source" => base.join('example').to_s,
|
37
|
-
"destination" => base.join('example/_site').to_s,
|
38
|
-
"force_polling" => false,
|
39
|
-
"serving" => true,
|
40
|
-
"theme" => <%= theme_name.inspect %>
|
41
|
-
}
|
42
|
-
|
43
|
-
options = Jekyll.configuration(options)
|
44
|
-
|
45
|
-
ENV["LISTEN_GEM_DEBUGGING"] = "1"
|
46
|
-
listener = Listen.to(
|
47
|
-
base.join("_includes"),
|
48
|
-
base.join("_layouts"),
|
49
|
-
base.join("_sass"),
|
50
|
-
options["source"],
|
51
|
-
:ignore => listen_ignore_paths(base, options),
|
52
|
-
:force_polling => options['force_polling'],
|
53
|
-
&(listen_handler(base, options))
|
54
|
-
)
|
55
|
-
|
56
|
-
begin
|
57
|
-
listener.start
|
58
|
-
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options["source"]}'"
|
59
|
-
|
60
|
-
unless options['serving']
|
61
|
-
trap("INT") do
|
62
|
-
listener.stop
|
63
|
-
puts " Halting auto-regeneration."
|
64
|
-
exit 0
|
65
|
-
end
|
66
|
-
|
67
|
-
loop { sleep 1000 }
|
68
|
-
end
|
69
|
-
rescue ThreadError
|
70
|
-
# You pressed Ctrl-C, oh my!
|
71
|
-
end
|
72
|
-
|
73
|
-
Jekyll::Commands::Serve.process(options)
|
74
|
-
end
|