jekyll 2.5.3 → 3.0.0.pre.beta1
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/LICENSE +3 -3
- data/README.markdown +4 -4
- data/bin/jekyll +4 -6
- data/lib/jekyll.rb +8 -1
- data/lib/jekyll/cleaner.rb +8 -0
- data/lib/jekyll/collection.rb +1 -2
- data/lib/jekyll/command.rb +1 -0
- data/lib/jekyll/commands/build.rb +3 -1
- data/lib/jekyll/commands/clean.rb +42 -0
- data/lib/jekyll/configuration.rb +13 -11
- data/lib/jekyll/converters/markdown.rb +3 -6
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +2 -2
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +1 -1
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +3 -3
- data/lib/jekyll/convertible.rb +6 -0
- data/lib/jekyll/deprecator.rb +0 -17
- data/lib/jekyll/document.rb +5 -3
- data/lib/jekyll/excerpt.rb +1 -2
- data/lib/jekyll/external.rb +59 -0
- data/lib/jekyll/filters.rb +12 -20
- data/lib/jekyll/frontmatter_defaults.rb +1 -1
- data/lib/jekyll/layout.rb +4 -0
- data/lib/jekyll/log_adapter.rb +5 -2
- data/lib/jekyll/post.rb +15 -6
- data/lib/jekyll/regenerator.rb +141 -0
- data/lib/jekyll/renderer.rb +12 -5
- data/lib/jekyll/site.rb +32 -17
- data/lib/jekyll/static_file.rb +4 -5
- data/lib/jekyll/tags/highlight.rb +1 -1
- data/lib/jekyll/tags/include.rb +10 -1
- data/lib/jekyll/utils.rb +52 -15
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_includes/footer.html +5 -5
- data/lib/site_template/_includes/head.html +1 -1
- data/lib/site_template/_layouts/page.html +4 -4
- data/lib/site_template/_layouts/post.html +6 -6
- data/lib/site_template/_sass/_layout.scss +4 -4
- metadata +11 -248
- data/lib/jekyll/commands/docs.rb +0 -30
- data/lib/jekyll/converters/textile.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ddbc7646be7d369024bb6af467093d2e6a98b41
|
4
|
+
data.tar.gz: 5ce3273554fe2ac4dd696beacab329c50caa805f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef504cdb53dcf07e82ba0dcff637af5d93619d35c25658acc71dbc87f5da687b5dd943491e02c6ce32abb8f70dd9efe9b742bfa317da82d6b09089703893f0e
|
7
|
+
data.tar.gz: e315c62e70753d82a1631c46d864322ac239ef0e944fe73d16539ad050185cd3b591bed5ccb39b0fe6415898e1dc61f995fef5806954d378a80c20dc67b4dd20
|
data/LICENSE
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
3
|
Copyright (c) 2008-2014 Tom Preston-Werner
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
7
|
in the Software without restriction, including without limitation the rights
|
8
8
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
13
13
|
copies or substantial portions of the Software.
|
14
14
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
data/README.markdown
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# [Jekyll](http://jekyllrb.com/)
|
2
2
|
|
3
|
-
[![Gem Version](https://
|
4
|
-
[![Build Status](https://
|
5
|
-
[![Code Climate](
|
6
|
-
[![Dependency Status](https://
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)](https://rubygems.org/gems/jekyll)
|
4
|
+
[![Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg)](https://travis-ci.org/jekyll/jekyll)
|
5
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
|
6
|
+
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
|
7
7
|
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)](https://hakiri.io/github/jekyll/jekyll/master)
|
8
8
|
|
9
9
|
By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
data/bin/jekyll
CHANGED
@@ -6,12 +6,9 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
|
|
6
6
|
require 'jekyll'
|
7
7
|
require 'mercenary'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
rescue LoadError
|
13
|
-
end
|
14
|
-
end
|
9
|
+
Jekyll::External.require_if_present(
|
10
|
+
Jekyll::External.blessed_gems
|
11
|
+
)
|
15
12
|
|
16
13
|
Jekyll::PluginManager.require_from_bundler
|
17
14
|
|
@@ -32,6 +29,7 @@ Mercenary.program(:jekyll) do |p|
|
|
32
29
|
|
33
30
|
p.action do |args, options|
|
34
31
|
if args.empty?
|
32
|
+
Jekyll.logger.error "A subcommand is required."
|
35
33
|
puts p
|
36
34
|
else
|
37
35
|
unless p.has_command?(args.first)
|
data/lib/jekyll.rb
CHANGED
@@ -21,6 +21,7 @@ require 'time'
|
|
21
21
|
require 'English'
|
22
22
|
require 'pathname'
|
23
23
|
require 'logger'
|
24
|
+
require 'set'
|
24
25
|
|
25
26
|
# 3rd party
|
26
27
|
require 'safe_yaml/load'
|
@@ -29,6 +30,7 @@ require 'kramdown'
|
|
29
30
|
require 'colorator'
|
30
31
|
|
31
32
|
SafeYAML::OPTIONS[:suppress_warnings] = true
|
33
|
+
Liquid::Template.error_mode = :strict
|
32
34
|
|
33
35
|
module Jekyll
|
34
36
|
|
@@ -43,6 +45,7 @@ module Jekyll
|
|
43
45
|
autoload :EntryFilter, 'jekyll/entry_filter'
|
44
46
|
autoload :Errors, 'jekyll/errors'
|
45
47
|
autoload :Excerpt, 'jekyll/excerpt'
|
48
|
+
autoload :External, 'jekyll/external'
|
46
49
|
autoload :Filters, 'jekyll/filters'
|
47
50
|
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
|
48
51
|
autoload :Layout, 'jekyll/layout'
|
@@ -52,6 +55,7 @@ module Jekyll
|
|
52
55
|
autoload :PluginManager, 'jekyll/plugin_manager'
|
53
56
|
autoload :Post, 'jekyll/post'
|
54
57
|
autoload :Publisher, 'jekyll/publisher'
|
58
|
+
autoload :Regenerator, 'jekyll/regenerator'
|
55
59
|
autoload :RelatedPosts, 'jekyll/related_posts'
|
56
60
|
autoload :Renderer, 'jekyll/renderer'
|
57
61
|
autoload :Site, 'jekyll/site'
|
@@ -153,6 +157,9 @@ module Jekyll
|
|
153
157
|
end
|
154
158
|
end
|
155
159
|
|
160
|
+
# Conditional optimizations
|
161
|
+
Jekyll::External.require_if_present('liquid-c')
|
162
|
+
|
156
163
|
end
|
157
164
|
end
|
158
165
|
|
@@ -163,7 +170,7 @@ require_all 'jekyll/generators'
|
|
163
170
|
require_all 'jekyll/tags'
|
164
171
|
|
165
172
|
# Eventually remove these for 3.0 as non-core
|
166
|
-
Jekyll::
|
173
|
+
Jekyll::External.require_with_graceful_fail(%w[
|
167
174
|
toml
|
168
175
|
jekyll-paginate
|
169
176
|
jekyll-gist
|
data/lib/jekyll/cleaner.rb
CHANGED
@@ -13,6 +13,7 @@ module Jekyll
|
|
13
13
|
# Cleans up the site's destination directory
|
14
14
|
def cleanup!
|
15
15
|
FileUtils.rm_rf(obsolete_files)
|
16
|
+
FileUtils.rm_rf(metadata_file) if @site.full_rebuild?
|
16
17
|
end
|
17
18
|
|
18
19
|
private
|
@@ -24,6 +25,13 @@ module Jekyll
|
|
24
25
|
(existing_files - new_files - new_dirs + replaced_files).to_a
|
25
26
|
end
|
26
27
|
|
28
|
+
# Private: The metadata file storing dependency tree and build history
|
29
|
+
#
|
30
|
+
# Returns an Array with the metdata file as the only item
|
31
|
+
def metadata_file
|
32
|
+
[site.regenerator.metadata_file]
|
33
|
+
end
|
34
|
+
|
27
35
|
# Private: The list of existing files, apart from those included in keep_files and hidden files.
|
28
36
|
#
|
29
37
|
# Returns a Set with the file paths
|
data/lib/jekyll/collection.rb
CHANGED
@@ -40,7 +40,7 @@ module Jekyll
|
|
40
40
|
if Utils.has_yaml_header? full_path
|
41
41
|
doc = Jekyll::Document.new(full_path, { site: site, collection: self })
|
42
42
|
doc.read
|
43
|
-
docs << doc
|
43
|
+
docs << doc if site.publisher.publish?(doc)
|
44
44
|
else
|
45
45
|
relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.")
|
46
46
|
files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
|
@@ -183,6 +183,5 @@ module Jekyll
|
|
183
183
|
{}
|
184
184
|
end
|
185
185
|
end
|
186
|
-
|
187
186
|
end
|
188
187
|
end
|
data/lib/jekyll/command.rb
CHANGED
@@ -58,6 +58,7 @@ module Jekyll
|
|
58
58
|
c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished'
|
59
59
|
c.option 'quiet', '-q', '--quiet', 'Silence output.'
|
60
60
|
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
|
61
|
+
c.option 'full_rebuild', '-f', '--full-rebuild', 'Disable incremental rebuild.'
|
61
62
|
end
|
62
63
|
|
63
64
|
end
|
@@ -50,8 +50,10 @@ module Jekyll
|
|
50
50
|
def build(site, options)
|
51
51
|
source = options['source']
|
52
52
|
destination = options['destination']
|
53
|
+
full_build = options['full_rebuild']
|
53
54
|
Jekyll.logger.info "Source:", source
|
54
55
|
Jekyll.logger.info "Destination:", destination
|
56
|
+
Jekyll.logger.info "Incremental build:", (full_build ? "disabled" : "enabled")
|
55
57
|
Jekyll.logger.info "Generating..."
|
56
58
|
process_site(site)
|
57
59
|
Jekyll.logger.info "", "done."
|
@@ -64,7 +66,7 @@ module Jekyll
|
|
64
66
|
#
|
65
67
|
# Returns nothing.
|
66
68
|
def watch(site, options)
|
67
|
-
|
69
|
+
External.require_with_graceful_fail 'jekyll-watch'
|
68
70
|
Jekyll::Watcher.watch(options)
|
69
71
|
end
|
70
72
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Commands
|
3
|
+
class Clean < Command
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def init_with_program(prog)
|
7
|
+
prog.command(:clean) do |c|
|
8
|
+
c.syntax 'clean [subcommand]'
|
9
|
+
c.description 'Clean the site (removes site output and metadata file) without building.'
|
10
|
+
|
11
|
+
c.action do |args, _|
|
12
|
+
Jekyll::Commands::Clean.process({})
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def process(options)
|
18
|
+
options = configuration_from_options(options)
|
19
|
+
destination = options['destination']
|
20
|
+
metadata_file = File.join(options['source'], '.jekyll-metadata')
|
21
|
+
|
22
|
+
if File.directory? destination
|
23
|
+
Jekyll.logger.info "Cleaning #{destination}..."
|
24
|
+
FileUtils.rm_rf(destination)
|
25
|
+
Jekyll.logger.info "", "done."
|
26
|
+
else
|
27
|
+
Jekyll.logger.info "Nothing to do for #{destination}."
|
28
|
+
end
|
29
|
+
|
30
|
+
if File.file? metadata_file
|
31
|
+
Jekyll.logger.info "Removing #{metadata_file}..."
|
32
|
+
FileUtils.rm_rf(metadata_file)
|
33
|
+
Jekyll.logger.info "", "done."
|
34
|
+
else
|
35
|
+
Jekyll.logger.info "Nothing to do for #{metadata_file}."
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/jekyll/configuration.rb
CHANGED
@@ -21,7 +21,7 @@ module Jekyll
|
|
21
21
|
'keep_files' => ['.git','.svn'],
|
22
22
|
'encoding' => 'utf-8',
|
23
23
|
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
|
24
|
-
'
|
24
|
+
'full_rebuild' => false,
|
25
25
|
|
26
26
|
# Filtering Content
|
27
27
|
'show_drafts' => nil,
|
@@ -74,12 +74,12 @@ module Jekyll
|
|
74
74
|
},
|
75
75
|
|
76
76
|
'kramdown' => {
|
77
|
-
'auto_ids'
|
78
|
-
'footnote_nr'
|
79
|
-
'entity_output'
|
80
|
-
'toc_levels'
|
81
|
-
'smart_quotes'
|
82
|
-
'
|
77
|
+
'auto_ids' => true,
|
78
|
+
'footnote_nr' => 1,
|
79
|
+
'entity_output' => 'as_char',
|
80
|
+
'toc_levels' => '1..6',
|
81
|
+
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
82
|
+
'enable_coderay' => false,
|
83
83
|
|
84
84
|
'coderay' => {
|
85
85
|
'coderay_wrap' => 'div',
|
@@ -89,10 +89,6 @@ module Jekyll
|
|
89
89
|
'coderay_bold_every' => 10,
|
90
90
|
'coderay_css' => 'style'
|
91
91
|
}
|
92
|
-
},
|
93
|
-
|
94
|
-
'redcloth' => {
|
95
|
-
'hard_breaks' => true
|
96
92
|
}
|
97
93
|
}
|
98
94
|
|
@@ -253,6 +249,12 @@ module Jekyll
|
|
253
249
|
config[option].map!(&:to_s)
|
254
250
|
end
|
255
251
|
|
252
|
+
if (config['kramdown'] || {}).key?('use_coderay')
|
253
|
+
Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" +
|
254
|
+
" to 'enable_coderay' in your configuration file."
|
255
|
+
config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay')
|
256
|
+
end
|
257
|
+
|
256
258
|
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
|
257
259
|
Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " +
|
258
260
|
"Markdown processor. Maruku support has been deprecated and will " +
|
@@ -46,15 +46,12 @@ module Jekyll
|
|
46
46
|
].map(&:to_sym)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
@
|
51
|
-
'^\.(' + @config['markdown_ext'].gsub(',','|') +')$',
|
52
|
-
Regexp::IGNORECASE
|
53
|
-
)
|
49
|
+
def extname_list
|
50
|
+
@extname_list ||= @config['markdown_ext'].split(',').map { |e| ".#{e.downcase}" }
|
54
51
|
end
|
55
52
|
|
56
53
|
def matches(ext)
|
57
|
-
ext
|
54
|
+
extname_list.include? ext.downcase
|
58
55
|
end
|
59
56
|
|
60
57
|
def output_ext(ext)
|
@@ -13,14 +13,14 @@ module Jekyll
|
|
13
13
|
|
14
14
|
def convert(content)
|
15
15
|
# Check for use of coderay
|
16
|
-
if @config['kramdown']['
|
16
|
+
if @config['kramdown']['enable_coderay']
|
17
17
|
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
|
18
18
|
key = "coderay_#{opt}"
|
19
19
|
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config[
|
23
|
+
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config['kramdown'])).to_html
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
@@ -3,7 +3,7 @@ module Jekyll
|
|
3
3
|
class Markdown
|
4
4
|
class RDiscountParser
|
5
5
|
def initialize(config)
|
6
|
-
Jekyll::
|
6
|
+
Jekyll::External.require_with_graceful_fail "rdiscount"
|
7
7
|
@config = config
|
8
8
|
@rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
|
9
9
|
end
|
@@ -14,7 +14,7 @@ module Jekyll
|
|
14
14
|
module WithPygments
|
15
15
|
include CommonMethods
|
16
16
|
def block_code(code, lang)
|
17
|
-
Jekyll::
|
17
|
+
Jekyll::External.require_with_graceful_fail("pygments")
|
18
18
|
lang = lang && lang.split.first || "text"
|
19
19
|
add_code_tags(
|
20
20
|
Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }),
|
@@ -55,7 +55,7 @@ module Jekyll
|
|
55
55
|
|
56
56
|
|
57
57
|
def initialize(config)
|
58
|
-
|
58
|
+
External.require_with_graceful_fail("redcarpet")
|
59
59
|
@config = config
|
60
60
|
@redcarpet_extensions = {}
|
61
61
|
@config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true }
|
@@ -71,7 +71,7 @@ module Jekyll
|
|
71
71
|
end
|
72
72
|
when "rouge"
|
73
73
|
Class.new(Redcarpet::Render::HTML) do
|
74
|
-
Jekyll::
|
74
|
+
Jekyll::External.require_with_graceful_fail(%w[
|
75
75
|
rouge
|
76
76
|
rouge/plugins/redcarpet
|
77
77
|
])
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -207,6 +207,12 @@ module Jekyll
|
|
207
207
|
info,
|
208
208
|
File.join(site.config['layouts'], layout.name))
|
209
209
|
|
210
|
+
# Add layout to dependency tree
|
211
|
+
site.regenerator.add_dependency(
|
212
|
+
site.in_source_dir(path),
|
213
|
+
site.in_source_dir(layout.path)
|
214
|
+
)
|
215
|
+
|
210
216
|
if layout = layouts[layout.data["layout"]]
|
211
217
|
if used.include?(layout)
|
212
218
|
layout = nil # avoid recursive chain
|
data/lib/jekyll/deprecator.rb
CHANGED
@@ -40,22 +40,5 @@ module Jekyll
|
|
40
40
|
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'."
|
41
41
|
end
|
42
42
|
|
43
|
-
def gracefully_require(gem_name)
|
44
|
-
Array(gem_name).each do |name|
|
45
|
-
begin
|
46
|
-
require name
|
47
|
-
rescue LoadError => e
|
48
|
-
Jekyll.logger.error "Dependency Error:", <<-MSG
|
49
|
-
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
|
50
|
-
In order to use Jekyll as currently configured, you'll need to install this gem.
|
51
|
-
|
52
|
-
The full error message from Ruby is: '#{e.message}'
|
53
|
-
|
54
|
-
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
|
55
|
-
MSG
|
56
|
-
raise Errors::MissingDependencyException.new(name)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
43
|
end
|
61
44
|
end
|
data/lib/jekyll/document.rb
CHANGED
@@ -7,6 +7,8 @@ module Jekyll
|
|
7
7
|
attr_reader :path, :site, :extname
|
8
8
|
attr_accessor :content, :collection, :output
|
9
9
|
|
10
|
+
YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
11
|
+
|
10
12
|
# Create a new Document.
|
11
13
|
#
|
12
14
|
# site - the Jekyll::Site instance to which this Document belongs
|
@@ -160,7 +162,7 @@ module Jekyll
|
|
160
162
|
# Returns the full path to the output file of this document.
|
161
163
|
def destination(base_directory)
|
162
164
|
dest = site.in_dest_dir(base_directory)
|
163
|
-
path = site.in_dest_dir(dest, url)
|
165
|
+
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
164
166
|
path = File.join(path, "index.html") if url =~ /\/$/
|
165
167
|
path
|
166
168
|
end
|
@@ -210,7 +212,7 @@ module Jekyll
|
|
210
212
|
@data = defaults
|
211
213
|
end
|
212
214
|
@content = File.read(path, merged_file_read_opts(opts))
|
213
|
-
if content =~
|
215
|
+
if content =~ YAML_FRONT_MATTER_REGEXP
|
214
216
|
@content = $POSTMATCH
|
215
217
|
data_file = SafeYAML.load($1)
|
216
218
|
unless data_file.nil?
|
@@ -233,8 +235,8 @@ module Jekyll
|
|
233
235
|
Utils.deep_merge_hashes data, {
|
234
236
|
"output" => output,
|
235
237
|
"content" => content,
|
236
|
-
"path" => path,
|
237
238
|
"relative_path" => relative_path,
|
239
|
+
"path" => relative_path,
|
238
240
|
"url" => url,
|
239
241
|
"collection" => collection.label
|
240
242
|
}
|
data/lib/jekyll/excerpt.rb
CHANGED
@@ -105,8 +105,7 @@ module Jekyll
|
|
105
105
|
#
|
106
106
|
# Returns excerpt String
|
107
107
|
def extract_excerpt(post_content)
|
108
|
-
|
109
|
-
head, _, tail = post_content.to_s.partition(separator)
|
108
|
+
head, _, tail = post_content.to_s.partition(post.excerpt_separator)
|
110
109
|
|
111
110
|
"" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n")
|
112
111
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module External
|
3
|
+
class << self
|
4
|
+
|
5
|
+
#
|
6
|
+
# Gems that, if installed, should be loaded.
|
7
|
+
# Usually contain subcommands.
|
8
|
+
#
|
9
|
+
def blessed_gems
|
10
|
+
%w{
|
11
|
+
jekyll-docs
|
12
|
+
jekyll-import
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Require a gem or file if it's present, otherwise silently fail.
|
18
|
+
#
|
19
|
+
# names - a string gem name or array of gem names
|
20
|
+
#
|
21
|
+
def require_if_present(names)
|
22
|
+
Array(names).each do |name|
|
23
|
+
begin
|
24
|
+
require name
|
25
|
+
rescue LoadError
|
26
|
+
Jekyll.logger.debug "Couldn't load #{name}. Skipping."
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Require a gem or gems. If it's not present, show a very nice error
|
34
|
+
# message that explains everything and is much more helpful than the
|
35
|
+
# normal LoadError.
|
36
|
+
#
|
37
|
+
# names - a string gem name or array of gem names
|
38
|
+
#
|
39
|
+
def require_with_graceful_fail(names)
|
40
|
+
Array(names).each do |name|
|
41
|
+
begin
|
42
|
+
require name
|
43
|
+
rescue LoadError => e
|
44
|
+
Jekyll.logger.error "Dependency Error:", <<-MSG
|
45
|
+
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
|
46
|
+
In order to use Jekyll as currently configured, you'll need to install this gem.
|
47
|
+
|
48
|
+
The full error message from Ruby is: '#{e.message}'
|
49
|
+
|
50
|
+
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
|
51
|
+
MSG
|
52
|
+
raise Jekyll::Errors::MissingDependencyException.new(name)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|