jekyll 3.0.0.pre.beta8 → 3.0.0.pre.beta9
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/README.markdown +12 -0
- data/bin/jekyll +2 -2
- data/lib/jekyll/commands/clean.rb +2 -0
- data/lib/jekyll/configuration.rb +18 -12
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +1 -1
- data/lib/jekyll/convertible.rb +13 -4
- data/lib/jekyll/document.rb +1 -1
- data/lib/jekyll/filters.rb +1 -1
- data/lib/jekyll/hooks.rb +5 -15
- data/lib/jekyll/mime.types +799 -95
- data/lib/jekyll/page.rb +1 -1
- data/lib/jekyll/plugin_manager.rb +3 -3
- data/lib/jekyll/post.rb +1 -1
- data/lib/jekyll/reader.rb +1 -1
- data/lib/jekyll/readers/layout_reader.rb +2 -2
- data/lib/jekyll/regenerator.rb +2 -4
- data/lib/jekyll/renderer.rb +2 -2
- data/lib/jekyll/site.rb +5 -5
- data/lib/jekyll/static_file.rb +40 -3
- data/lib/jekyll/tags/highlight.rb +1 -1
- data/lib/jekyll/tags/include.rb +4 -4
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_includes/header.html +3 -3
- data/lib/site_template/css/main.scss +1 -1
- metadata +2 -2
data/lib/jekyll/page.rb
CHANGED
@@ -82,10 +82,10 @@ module Jekyll
|
|
82
82
|
#
|
83
83
|
# Returns an Array of plugin search paths
|
84
84
|
def plugins_path
|
85
|
-
if (site.config['
|
86
|
-
[site.in_source_dir(site.config['
|
85
|
+
if (site.config['plugins_dir'] == Jekyll::Configuration::DEFAULTS['plugins_dir'])
|
86
|
+
[site.in_source_dir(site.config['plugins_dir'])]
|
87
87
|
else
|
88
|
-
Array(site.config['
|
88
|
+
Array(site.config['plugins_dir']).map { |d| File.expand_path(d) }
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
data/lib/jekyll/post.rb
CHANGED
data/lib/jekyll/reader.rb
CHANGED
@@ -16,7 +16,7 @@ module Jekyll
|
|
16
16
|
@site.layouts = LayoutReader.new(site).read
|
17
17
|
read_directories
|
18
18
|
sort_files!
|
19
|
-
@site.data = DataReader.new(site).read(site.config['
|
19
|
+
@site.data = DataReader.new(site).read(site.config['data_dir'])
|
20
20
|
CollectionReader.new(site).read
|
21
21
|
end
|
22
22
|
|
@@ -38,11 +38,11 @@ module Jekyll
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def layout_directory_inside_source
|
41
|
-
site.in_source_dir(site.config['
|
41
|
+
site.in_source_dir(site.config['layouts_dir'])
|
42
42
|
end
|
43
43
|
|
44
44
|
def layout_directory_in_cwd
|
45
|
-
dir = Jekyll.sanitized_path(Dir.pwd, site.config['
|
45
|
+
dir = Jekyll.sanitized_path(Dir.pwd, site.config['layouts_dir'])
|
46
46
|
if File.directory?(dir) && !site.safe
|
47
47
|
dir
|
48
48
|
else
|
data/lib/jekyll/regenerator.rb
CHANGED
@@ -130,9 +130,7 @@ module Jekyll
|
|
130
130
|
#
|
131
131
|
# Returns nothing.
|
132
132
|
def write_metadata
|
133
|
-
File.
|
134
|
-
f.write(Marshal.dump(metadata))
|
135
|
-
end
|
133
|
+
File.binwrite(metadata_file, Marshal.dump(metadata))
|
136
134
|
end
|
137
135
|
|
138
136
|
# Produce the absolute path of the metadata file
|
@@ -158,7 +156,7 @@ module Jekyll
|
|
158
156
|
# Returns the read metadata.
|
159
157
|
def read_metadata
|
160
158
|
@metadata = if !disabled? && File.file?(metadata_file)
|
161
|
-
content = File.
|
159
|
+
content = File.binread(metadata_file)
|
162
160
|
|
163
161
|
begin
|
164
162
|
Marshal.load(content)
|
data/lib/jekyll/renderer.rb
CHANGED
@@ -35,7 +35,7 @@ module Jekyll
|
|
35
35
|
"page" => document.to_liquid
|
36
36
|
}, site_payload || site.site_payload)
|
37
37
|
|
38
|
-
Jekyll::Hooks.trigger document, :pre_render, payload
|
38
|
+
Jekyll::Hooks.trigger :document, :pre_render, document, payload
|
39
39
|
|
40
40
|
info = {
|
41
41
|
filters: [Jekyll::Filters],
|
@@ -138,7 +138,7 @@ module Jekyll
|
|
138
138
|
layout.content,
|
139
139
|
payload,
|
140
140
|
info,
|
141
|
-
File.join(site.config['
|
141
|
+
File.join(site.config['layouts_dir'], layout.name)
|
142
142
|
)
|
143
143
|
|
144
144
|
# Add layout to dependency tree
|
data/lib/jekyll/site.rb
CHANGED
@@ -86,7 +86,7 @@ module Jekyll
|
|
86
86
|
raise ArgumentError, "limit_posts must be a non-negative number"
|
87
87
|
end
|
88
88
|
|
89
|
-
Jekyll::Hooks.trigger
|
89
|
+
Jekyll::Hooks.trigger :site, :after_reset, self
|
90
90
|
end
|
91
91
|
|
92
92
|
# Load necessary libraries, plugins, converters, and generators.
|
@@ -144,7 +144,7 @@ module Jekyll
|
|
144
144
|
def read
|
145
145
|
reader.read
|
146
146
|
limit_posts!
|
147
|
-
Jekyll::Hooks.trigger
|
147
|
+
Jekyll::Hooks.trigger :site, :post_read, self
|
148
148
|
end
|
149
149
|
|
150
150
|
# Run each of the Generators.
|
@@ -164,13 +164,13 @@ module Jekyll
|
|
164
164
|
|
165
165
|
payload = site_payload
|
166
166
|
|
167
|
-
Jekyll::Hooks.trigger
|
167
|
+
Jekyll::Hooks.trigger :site, :pre_render, self, payload
|
168
168
|
|
169
169
|
collections.each do |label, collection|
|
170
170
|
collection.docs.each do |document|
|
171
171
|
if regenerator.regenerate?(document)
|
172
172
|
document.output = Jekyll::Renderer.new(self, document, payload).run
|
173
|
-
Jekyll::Hooks.trigger document, :post_render
|
173
|
+
Jekyll::Hooks.trigger :document, :post_render, document
|
174
174
|
end
|
175
175
|
end
|
176
176
|
end
|
@@ -199,7 +199,7 @@ module Jekyll
|
|
199
199
|
item.write(dest) if regenerator.regenerate?(item)
|
200
200
|
}
|
201
201
|
regenerator.write_metadata
|
202
|
-
Jekyll::Hooks.trigger
|
202
|
+
Jekyll::Hooks.trigger :site, :post_write, self
|
203
203
|
end
|
204
204
|
|
205
205
|
# Construct a Hash of Posts indexed by the specified Post attribute.
|
data/lib/jekyll/static_file.rb
CHANGED
@@ -37,7 +37,7 @@ module Jekyll
|
|
37
37
|
|
38
38
|
def destination_rel_dir
|
39
39
|
if @collection
|
40
|
-
|
40
|
+
File.dirname(url)
|
41
41
|
else
|
42
42
|
@dir
|
43
43
|
end
|
@@ -61,9 +61,10 @@ module Jekyll
|
|
61
61
|
|
62
62
|
# Whether to write the file to the filesystem
|
63
63
|
#
|
64
|
-
# Returns true
|
64
|
+
# Returns true unless the defaults for the destination path from
|
65
|
+
# _config.yml contain `published: false`.
|
65
66
|
def write?
|
66
|
-
true
|
67
|
+
defaults.fetch('published', true)
|
67
68
|
end
|
68
69
|
|
69
70
|
# Write the static file to the destination directory (if modified).
|
@@ -100,5 +101,41 @@ module Jekyll
|
|
100
101
|
"path" => File.join("", relative_path)
|
101
102
|
}
|
102
103
|
end
|
104
|
+
|
105
|
+
def placeholders
|
106
|
+
{
|
107
|
+
collection: @collection.label,
|
108
|
+
path: relative_path[
|
109
|
+
@collection.relative_directory.size..relative_path.size],
|
110
|
+
output_ext: '',
|
111
|
+
name: '',
|
112
|
+
title: '',
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
# Applies a similar URL-building technique as Jekyll::Document that takes
|
117
|
+
# the collection's URL template into account. The default URL template can
|
118
|
+
# be overriden in the collection's configuration in _config.yml.
|
119
|
+
def url
|
120
|
+
@url ||= if @collection.nil?
|
121
|
+
relative_path
|
122
|
+
else
|
123
|
+
::Jekyll::URL.new({
|
124
|
+
template: @collection.url_template,
|
125
|
+
placeholders: placeholders,
|
126
|
+
})
|
127
|
+
end.to_s.gsub /\/$/, ''
|
128
|
+
end
|
129
|
+
|
130
|
+
# Returns the type of the collection if present, nil otherwise.
|
131
|
+
def type
|
132
|
+
@type ||= @collection.nil? ? nil : @collection.label.to_sym
|
133
|
+
end
|
134
|
+
|
135
|
+
# Returns the front matter defaults defined for the file's URL and/or type
|
136
|
+
# as defined in _config.yml.
|
137
|
+
def defaults
|
138
|
+
@defaults ||= @site.frontmatter_defaults.all url, type
|
139
|
+
end
|
103
140
|
end
|
104
141
|
end
|
@@ -64,7 +64,7 @@ eos
|
|
64
64
|
if is_safe
|
65
65
|
Hash[[
|
66
66
|
[:startinline, opts.fetch(:startinline, nil)],
|
67
|
-
[:
|
67
|
+
[:hl_lines, opts.fetch(:hl_lines, nil)],
|
68
68
|
[:linenos, opts.fetch(:linenos, nil)],
|
69
69
|
[:encoding, opts.fetch(:encoding, 'utf-8')],
|
70
70
|
[:cssclass, opts.fetch(:cssclass, nil)]
|
data/lib/jekyll/tags/include.rb
CHANGED
@@ -20,7 +20,6 @@ module Jekyll
|
|
20
20
|
|
21
21
|
def initialize(tag_name, markup, tokens)
|
22
22
|
super
|
23
|
-
@includes_dir = tag_includes_dir
|
24
23
|
matched = markup.strip.match(VARIABLE_SYNTAX)
|
25
24
|
if matched
|
26
25
|
@file = matched['variable'].strip
|
@@ -100,12 +99,13 @@ eos
|
|
100
99
|
end
|
101
100
|
end
|
102
101
|
|
103
|
-
def tag_includes_dir
|
104
|
-
'
|
102
|
+
def tag_includes_dir(context)
|
103
|
+
context.registers[:site].config['includes_dir'].freeze
|
105
104
|
end
|
106
105
|
|
107
106
|
def render(context)
|
108
107
|
site = context.registers[:site]
|
108
|
+
@includes_dir = tag_includes_dir(context)
|
109
109
|
dir = resolved_includes_dir(context)
|
110
110
|
|
111
111
|
file = render_variable(context) || @file
|
@@ -161,7 +161,7 @@ eos
|
|
161
161
|
end
|
162
162
|
|
163
163
|
class IncludeRelativeTag < IncludeTag
|
164
|
-
def tag_includes_dir
|
164
|
+
def tag_includes_dir(context)
|
165
165
|
'.'.freeze
|
166
166
|
end
|
167
167
|
|
data/lib/jekyll/version.rb
CHANGED
@@ -14,9 +14,9 @@
|
|
14
14
|
</a>
|
15
15
|
|
16
16
|
<div class="trigger">
|
17
|
-
{% for
|
18
|
-
{% if
|
19
|
-
<a class="page-link" href="{{
|
17
|
+
{% for my_page in site.pages %}
|
18
|
+
{% if my_page.title %}
|
19
|
+
<a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a>
|
20
20
|
{% endif %}
|
21
21
|
{% endfor %}
|
22
22
|
</div>
|
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.0.0.pre.
|
4
|
+
version: 3.0.0.pre.beta9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|