jekyll 2.0.0.alpha.2 → 2.0.0.alpha.3
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/History.markdown +35 -0
- data/Rakefile +1 -1
- data/features/collections.feature +38 -0
- data/features/create_sites.feature +17 -0
- data/features/step_definitions/jekyll_steps.rb +15 -7
- data/features/support/env.rb +6 -1
- data/lib/jekyll.rb +6 -1
- data/lib/jekyll/cleaner.rb +5 -3
- data/lib/jekyll/collection.rb +121 -0
- data/lib/jekyll/command.rb +2 -0
- data/lib/jekyll/commands/build.rb +5 -1
- data/lib/jekyll/commands/serve.rb +1 -1
- data/lib/jekyll/configuration.rb +2 -0
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +11 -12
- data/lib/jekyll/convertible.rb +1 -1
- data/lib/jekyll/document.rb +228 -0
- data/lib/jekyll/entry_filter.rb +4 -1
- data/lib/jekyll/layout_reader.rb +1 -1
- data/lib/jekyll/page.rb +1 -1
- data/lib/jekyll/plugin_manager.rb +76 -0
- data/lib/jekyll/post.rb +3 -3
- data/lib/jekyll/publisher.rb +21 -0
- data/lib/jekyll/renderer.rb +132 -0
- data/lib/jekyll/site.rb +84 -68
- data/lib/jekyll/tags/highlight.rb +8 -6
- data/lib/jekyll/url.rb +43 -3
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_includes/head.html +3 -3
- data/script/console +38 -0
- data/site/_config.yml +1 -0
- data/site/_data/docs.yml +1 -0
- data/site/_includes/css/style.css +12 -12
- data/site/_includes/news_item.html +3 -3
- data/site/_includes/primary-nav-items.html +4 -1
- data/site/_includes/top.html +7 -3
- data/site/_layouts/news_item.html +3 -3
- data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +26 -0
- data/site/docs/collections.md +126 -0
- data/site/docs/configuration.md +3 -2
- data/site/docs/datafiles.md +1 -1
- data/site/docs/history.md +6 -0
- data/site/docs/plugins.md +1 -1
- data/site/docs/troubleshooting.md +7 -3
- data/site/docs/variables.md +1 -1
- data/site/favicon.ico +0 -0
- data/site/feed.xml +27 -14
- data/site/img/logo-rss.png +0 -0
- data/site/js/html5shiv.js +8 -0
- data/site/js/respond.min.js +5 -0
- data/test/source/+/%# +.md +6 -0
- data/test/source/_methods/_do_not_read_me.md +5 -0
- data/test/source/_methods/configuration.md +8 -0
- data/test/source/_methods/sanitized_path.md +5 -0
- data/test/source/_methods/site/_dont_include_me_either.md +5 -0
- data/test/source/_methods/site/generate.md +6 -0
- data/test/source/_methods/site/initialize.md +5 -0
- data/test/source/_methods/um_hi.md +6 -0
- data/test/source/_posts/2014-03-03-yaml-with-dots.md +5 -0
- data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +6 -0
- data/test/source/pgp.key +2 -0
- data/test/test_coffeescript.rb +1 -1
- data/test/test_collections.rb +129 -0
- data/test/test_command.rb +17 -0
- data/test/test_document.rb +48 -0
- data/test/test_filters.rb +1 -1
- data/test/test_generated_site.rb +5 -4
- data/test/test_new_command.rb +4 -4
- data/test/test_page.rb +22 -8
- data/test/test_path_sanitization.rb +4 -0
- data/test/test_post.rb +42 -13
- data/test/test_site.rb +11 -17
- data/test/test_tags.rb +10 -6
- metadata +42 -7
- data/lib/site_template/_posts/0000-00-00-this-post-demonstrates-post-content-styles.md +0 -88
- data/site/favicon.png +0 -0
- data/site/img/tube.png +0 -0
- data/site/img/tube1x.png +0 -0
- data/site/js/modernizr-2.7.1.min.js +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b45529d71bc0001091dfa655841e96119ed3249
|
4
|
+
data.tar.gz: b92696779305cc5c63a173a19b078a3806c6a8ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccab5f03c28fdc500cc78880b346fb1041296e75de800d10f0d9cf58c7d0b8ef89617c52a2c00e02cb5726c1bf541bd3c714bac2fee2f9cafd3f710977c65963
|
7
|
+
data.tar.gz: 6aa322546770c3f82a1f34beb9c195da8258111ff44cc6f1eadf1a1f72f88f87739277696ac91a2726c5b84952eca10306b04b7191c2fe4f96652719102af892
|
data/History.markdown
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
## HEAD
|
2
2
|
|
3
3
|
### Major Enhancements
|
4
|
+
* Add "Collections" feature (#2199)
|
4
5
|
* Add gem-based plugin whitelist to safe mode (#1657)
|
5
6
|
* Replace the commander command line parser with a more robust
|
6
7
|
solution for our needs called `mercenary` (#1706)
|
@@ -53,6 +54,13 @@
|
|
53
54
|
* Refactor CLI & Commands For Greater Happiness (#2143)
|
54
55
|
* Provide useful error when Pygments returns `nil` and error out (#2148)
|
55
56
|
* Add support for unpublished drafts (#2164)
|
57
|
+
* Add `force_polling` option to the `serve` command (#2165)
|
58
|
+
* Clean up the `<head>` in the site template (#2186)
|
59
|
+
* Permit YAML blocks to end with three dots to better conform with the
|
60
|
+
YAML spec (#2110)
|
61
|
+
* Use `File.exist?` instead of deprecated `File.exists?` (#2214)
|
62
|
+
* Require newline after start of YAML front-matter header (#2211)
|
63
|
+
* Add the ability for pages to be marked as `published: false` (#1492)
|
56
64
|
|
57
65
|
### Bug Fixes
|
58
66
|
* Don't allow nil entries when loading posts (#1796)
|
@@ -76,6 +84,12 @@
|
|
76
84
|
* Remove obsolete `normalize_options` method call from `bin/jekyll` (#2121).
|
77
85
|
* Remove `+` characters from Pygments lexer names when adding as a CSS
|
78
86
|
class (#994)
|
87
|
+
* Remove some code that caused Ruby interpreter warnings (#2178)
|
88
|
+
* Only strip the drive name if it begins the string (#2175)
|
89
|
+
* Remove default post with invalid date from site template (#2200)
|
90
|
+
* Fix `Post#url` and `Page#url` escape (#1568)
|
91
|
+
* Strip newlines from the `{% highlight %}` block content (#1823)
|
92
|
+
* Load in `rouge` only when it's been requested as the highlighter (#2189)
|
79
93
|
|
80
94
|
### Development Fixes
|
81
95
|
* Add a link to the site in the README.md file (#1795)
|
@@ -102,6 +116,9 @@
|
|
102
116
|
* Trim trailing spaces and convert tabs to spaces (#2122)
|
103
117
|
* Fix the failing Travis scenarios due to Cucumber issues (#2155)
|
104
118
|
* Wrap `bundle install` in `travis_retry` to retry when RubyGems fails (#2160)
|
119
|
+
* Refactor tags and categories (#1639)
|
120
|
+
* Extract plugin management into its own class (#2197)
|
121
|
+
* Add missing tests for `Command` (#2216)
|
105
122
|
|
106
123
|
### Site Enhancements
|
107
124
|
* Document Kramdown's GFM parser option (#1791)
|
@@ -157,6 +174,24 @@
|
|
157
174
|
* Add `jekyll_figure` to list of third-party plugins (#2158)
|
158
175
|
* Clarify the documentation for safe mode (#2163)
|
159
176
|
* Some HTML tidying (#2130)
|
177
|
+
* Remove modernizr and use html5shiv.js directly for IE less than v9 (#2131)
|
178
|
+
* Remove unused images (#2187)
|
179
|
+
* Use `array_to_sentence_string` filter when outputting news item
|
180
|
+
categories (#2191)
|
181
|
+
* Add link to Help repo in primary navigation bar (#2177)
|
182
|
+
* Switch to using an ico file for the shortcut icon (#2193)
|
183
|
+
* Use numbers to specify font weights and only bring in font weights used (#2185)
|
184
|
+
* Add a link to the list of all tz database time zones (#1824)
|
185
|
+
* Clean-up and improve documentation `feed.xml` (#2192)
|
186
|
+
* Remove duplicate entry in list of third-party plugins (#2206)
|
187
|
+
* Reduce the whitespace in the favicon. (#2213)
|
188
|
+
* Add `jekyll-page-collections` to list of third-party plugins (#2215)
|
189
|
+
|
190
|
+
## 1.5.1 / 2014-03-27
|
191
|
+
|
192
|
+
### Bug Fixes
|
193
|
+
|
194
|
+
* Only strip the drive name if it begins the string (#2176)
|
160
195
|
|
161
196
|
## 1.5.0 / 2014-03-24
|
162
197
|
|
data/Rakefile
CHANGED
@@ -180,7 +180,7 @@ namespace :site do
|
|
180
180
|
sha = `git log`.match(/[a-z0-9]{40}/)[0]
|
181
181
|
Dir.chdir('gh-pages') do
|
182
182
|
sh "git add ."
|
183
|
-
sh "git commit -m 'Updating to #{sha}.'"
|
183
|
+
sh "git commit --allow-empty -m 'Updating to #{sha}.'"
|
184
184
|
sh "git push origin gh-pages"
|
185
185
|
end
|
186
186
|
puts 'Done.'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Feature: Collections
|
2
|
+
As a hacker who likes to structure content
|
3
|
+
I want to be able to create collections of similar information
|
4
|
+
And render them
|
5
|
+
|
6
|
+
Scenario: Unrendered collection
|
7
|
+
Given I have an "index.html" page that contains "Collections: {{ site.methods }}"
|
8
|
+
And I have fixture collections
|
9
|
+
And I have a configuration file with "collections" set to "['methods']"
|
10
|
+
When I run jekyll
|
11
|
+
Then the _site directory should exist
|
12
|
+
And I should see "Collections: Use `{{ page.title }}` to build a full configuration for use w/Jekyll.\n\nWhatever: {{ page.whatever }}\n`{{ page.title }}` is used to make sure your path is in your source.\nRun your generators! {{ page.layout }}\nCreate dat site.\nRun your generators! {{ page.layout }}" in "_site/index.html"
|
13
|
+
|
14
|
+
Scenario: Rendered collection
|
15
|
+
Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
|
16
|
+
And I have fixture collections
|
17
|
+
And I have a configuration file with:
|
18
|
+
| key | value |
|
19
|
+
| collections | ['methods'] |
|
20
|
+
| render | ['methods'] |
|
21
|
+
When I run jekyll
|
22
|
+
Then the _site directory should exist
|
23
|
+
And I should see "Collections: methods" in "_site/index.html"
|
24
|
+
And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration.html"
|
25
|
+
|
26
|
+
Scenario: Rendered document in a layout
|
27
|
+
Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
|
28
|
+
And I have a default layout that contains "<div class='title'>Tom Preston-Werner</div> {{content}}"
|
29
|
+
And I have fixture collections
|
30
|
+
And I have a configuration file with:
|
31
|
+
| key | value |
|
32
|
+
| collections | ['methods'] |
|
33
|
+
| render | ['methods'] |
|
34
|
+
When I run jekyll
|
35
|
+
Then the _site directory should exist
|
36
|
+
And I should see "Collections: methods" in "_site/index.html"
|
37
|
+
And I should see "<p>Run your generators! default</p>" in "_site/methods/site/generate.html"
|
38
|
+
And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
|
@@ -139,3 +139,20 @@ Feature: Create sites
|
|
139
139
|
When I run jekyll
|
140
140
|
Then the _site/test directory should exist
|
141
141
|
And I should see "some other stuff" in "_site/test/index.html"
|
142
|
+
|
143
|
+
Scenario: Basic site with unpublished page
|
144
|
+
Given I have an "index.html" page with title "index" that contains "Published page"
|
145
|
+
And I have a "public.html" page with published "true" that contains "Explicitly published page"
|
146
|
+
And I have a "secret.html" page with published "false" that contains "Unpublished page"
|
147
|
+
|
148
|
+
When I run jekyll
|
149
|
+
Then the _site directory should exist
|
150
|
+
And the "_site/index.html" file should exist
|
151
|
+
And the "_site/public.html" file should exist
|
152
|
+
But the "_site/secret.html" file should not exist
|
153
|
+
|
154
|
+
When I run jekyll with "--unpublished"
|
155
|
+
Then the _site directory should exist
|
156
|
+
And the "_site/index.html" file should exist
|
157
|
+
And the "_site/public.html" file should exist
|
158
|
+
And the "_site/secret.html" file should exist
|
@@ -16,21 +16,20 @@ def file_content_from_hash(input_hash)
|
|
16
16
|
EOF
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
19
|
Before do
|
21
|
-
FileUtils.mkdir_p(TEST_DIR) unless File.
|
20
|
+
FileUtils.mkdir_p(TEST_DIR) unless File.exist?(TEST_DIR)
|
22
21
|
Dir.chdir(TEST_DIR)
|
23
22
|
end
|
24
23
|
|
25
24
|
After do
|
26
25
|
FileUtils.rm_rf(TEST_DIR) if File.exists?(TEST_DIR)
|
27
|
-
FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE)
|
26
|
+
FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exists?(JEKYLL_COMMAND_OUTPUT_FILE)
|
28
27
|
end
|
29
28
|
|
30
29
|
World(Test::Unit::Assertions)
|
31
30
|
|
32
31
|
Given /^I have a blank site in "(.*)"$/ do |path|
|
33
|
-
FileUtils.mkdir_p(path) unless File.
|
32
|
+
FileUtils.mkdir_p(path) unless File.exist?(path)
|
34
33
|
end
|
35
34
|
|
36
35
|
Given /^I do not have a "(.*)" directory$/ do |path|
|
@@ -130,9 +129,18 @@ Given /^I have a configuration file with "([^\"]*)" set to:$/ do |key, table|
|
|
130
129
|
end
|
131
130
|
end
|
132
131
|
|
132
|
+
Given /^I have fixture collections$/ do
|
133
|
+
FileUtils.cp_r File.join(JEKYLL_SOURCE_DIR, "test", "source", "_methods"), source_dir
|
134
|
+
end
|
135
|
+
|
136
|
+
##################
|
137
|
+
#
|
138
|
+
# Changing stuff
|
139
|
+
#
|
140
|
+
##################
|
133
141
|
|
134
|
-
When /^I run jekyll
|
135
|
-
run_jekyll_build
|
142
|
+
When /^I run jekyll(?: with "(.+)")?$/ do |opt|
|
143
|
+
run_jekyll_build(opt)
|
136
144
|
end
|
137
145
|
|
138
146
|
When /^I run jekyll in safe mode$/ do
|
@@ -190,7 +198,7 @@ Then /^the "(.*)" file should +exist$/ do |file|
|
|
190
198
|
end
|
191
199
|
|
192
200
|
Then /^the "(.*)" file should not exist$/ do |file|
|
193
|
-
assert !File.
|
201
|
+
assert !File.exist?(file), "The file \"#{file}\" exists"
|
194
202
|
end
|
195
203
|
|
196
204
|
Then /^I should see today's time in "(.*)"$/ do |file|
|
data/features/support/env.rb
CHANGED
@@ -6,10 +6,15 @@ require 'rr'
|
|
6
6
|
require 'test/unit'
|
7
7
|
require 'time'
|
8
8
|
|
9
|
+
JEKYLL_SOURCE_DIR = File.dirname(File.dirname(File.dirname(__FILE__)))
|
9
10
|
TEST_DIR = File.expand_path(File.join('..', '..', 'tmp', 'jekyll'), File.dirname(__FILE__))
|
10
11
|
JEKYLL_PATH = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll')
|
11
12
|
JEKYLL_COMMAND_OUTPUT_FILE = File.join(File.dirname(TEST_DIR), 'jekyll_output.txt')
|
12
13
|
|
14
|
+
def source_dir(*files)
|
15
|
+
File.join(TEST_DIR, *files)
|
16
|
+
end
|
17
|
+
|
13
18
|
def jekyll_output_file
|
14
19
|
JEKYLL_COMMAND_OUTPUT_FILE
|
15
20
|
end
|
@@ -19,7 +24,7 @@ def jekyll_run_output
|
|
19
24
|
end
|
20
25
|
|
21
26
|
def run_jekyll(args, output_file)
|
22
|
-
command = "#{JEKYLL_PATH} #{args} > #{jekyll_output_file} 2>&1"
|
27
|
+
command = "#{JEKYLL_PATH} #{args} --trace > #{jekyll_output_file} 2>&1"
|
23
28
|
system command
|
24
29
|
end
|
25
30
|
|
data/lib/jekyll.rb
CHANGED
@@ -34,6 +34,9 @@ require 'jekyll/utils'
|
|
34
34
|
require 'jekyll/stevenson'
|
35
35
|
require 'jekyll/deprecator'
|
36
36
|
require 'jekyll/configuration'
|
37
|
+
require 'jekyll/document'
|
38
|
+
require 'jekyll/collection'
|
39
|
+
require 'jekyll/plugin_manager'
|
37
40
|
require 'jekyll/site'
|
38
41
|
require 'jekyll/convertible'
|
39
42
|
require 'jekyll/url'
|
@@ -49,6 +52,8 @@ require 'jekyll/related_posts'
|
|
49
52
|
require 'jekyll/cleaner'
|
50
53
|
require 'jekyll/entry_filter'
|
51
54
|
require 'jekyll/layout_reader'
|
55
|
+
require 'jekyll/publisher'
|
56
|
+
require 'jekyll/renderer'
|
52
57
|
|
53
58
|
# extensions
|
54
59
|
require 'jekyll/plugin'
|
@@ -111,7 +116,7 @@ module Jekyll
|
|
111
116
|
|
112
117
|
def self.sanitized_path(base_directory, questionable_path)
|
113
118
|
clean_path = File.expand_path(questionable_path, fs_root)
|
114
|
-
clean_path.gsub!(/\w\:\//, '/')
|
119
|
+
clean_path.gsub!(/\A\w\:\//, '/')
|
115
120
|
unless clean_path.start_with?(base_directory)
|
116
121
|
File.join(base_directory, clean_path)
|
117
122
|
else
|
data/lib/jekyll/cleaner.rb
CHANGED
@@ -4,6 +4,8 @@ module Jekyll
|
|
4
4
|
class Site
|
5
5
|
# Handles the cleanup of a site's destination before it is built.
|
6
6
|
class Cleaner
|
7
|
+
attr_reader :site
|
8
|
+
|
7
9
|
def initialize(site)
|
8
10
|
@site = site
|
9
11
|
end
|
@@ -27,7 +29,7 @@ module Jekyll
|
|
27
29
|
# Returns a Set with the file paths
|
28
30
|
def existing_files
|
29
31
|
files = Set.new
|
30
|
-
Dir.glob(File.join(
|
32
|
+
Dir.glob(File.join(site.dest, "**", "*"), File::FNM_DOTMATCH) do |file|
|
31
33
|
files << file unless file =~ /\/\.{1,2}$/ || file =~ keep_file_regex
|
32
34
|
end
|
33
35
|
files
|
@@ -38,7 +40,7 @@ module Jekyll
|
|
38
40
|
# Returns a Set with the file paths
|
39
41
|
def new_files
|
40
42
|
files = Set.new
|
41
|
-
|
43
|
+
site.each_site_file { |item| files << item.destination(site.dest) }
|
42
44
|
files
|
43
45
|
end
|
44
46
|
|
@@ -64,7 +66,7 @@ module Jekyll
|
|
64
66
|
#
|
65
67
|
# Returns the regular expression
|
66
68
|
def keep_file_regex
|
67
|
-
or_list =
|
69
|
+
or_list = site.keep_files.join("|")
|
68
70
|
pattern = "\/(#{or_list.gsub(".", "\.")})"
|
69
71
|
Regexp.new pattern
|
70
72
|
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
module Jekyll
|
2
|
+
class Collection
|
3
|
+
attr_reader :site, :label
|
4
|
+
|
5
|
+
# Create a new Collection.
|
6
|
+
#
|
7
|
+
# site - the site to which this collection belongs.
|
8
|
+
# label - the name of the collection
|
9
|
+
#
|
10
|
+
# Returns nothing.
|
11
|
+
def initialize(site, label)
|
12
|
+
@site = site
|
13
|
+
@label = sanitize_label(label)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Fetch the Documents in this collection.
|
17
|
+
# Defaults to an empty array if no documents have been read in.
|
18
|
+
#
|
19
|
+
# Returns an array of Jekyll::Document objects.
|
20
|
+
def docs
|
21
|
+
@docs ||= []
|
22
|
+
end
|
23
|
+
|
24
|
+
# Read the allowed documents into the collection's array of docs.
|
25
|
+
#
|
26
|
+
# Returns the sorted array of docs.
|
27
|
+
def read
|
28
|
+
filtered_entries.each do |file_path|
|
29
|
+
doc = Jekyll::Document.new(Jekyll.sanitized_path(directory, file_path), { site: site, collection: self })
|
30
|
+
doc.read
|
31
|
+
docs << doc
|
32
|
+
end
|
33
|
+
docs.sort!
|
34
|
+
end
|
35
|
+
|
36
|
+
# All the entries in this collection.
|
37
|
+
#
|
38
|
+
# Returns an Array of file paths to the documents in this collection
|
39
|
+
# relative to the collection's directory
|
40
|
+
def entries
|
41
|
+
return Array.new unless exists?
|
42
|
+
Dir.glob(File.join(directory, "**", "*.*")).map do |entry|
|
43
|
+
entry[File.join(directory, "")] = ''; entry
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Filtered version of the entries in this collection.
|
48
|
+
# See `Jekyll::EntryFilter#filter` for more information.
|
49
|
+
#
|
50
|
+
# Returns a list of filtered entry paths.
|
51
|
+
def filtered_entries
|
52
|
+
return Array.new unless exists?
|
53
|
+
Dir.chdir(directory) do
|
54
|
+
entry_filter.filter(entries)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# The directory for this Collection, relative to the site source.
|
59
|
+
#
|
60
|
+
# Returns a String containing the directory name where the collection
|
61
|
+
# is stored on the filesystem.
|
62
|
+
def relative_directory
|
63
|
+
"_#{label}"
|
64
|
+
end
|
65
|
+
|
66
|
+
# The full path to the directory containing the
|
67
|
+
#
|
68
|
+
# Returns a String containing th directory name where the collection
|
69
|
+
# is stored on the filesystem.
|
70
|
+
def directory
|
71
|
+
Jekyll.sanitized_path(site.source, relative_directory)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks whether the directory "exists" for this collection.
|
75
|
+
# The directory must exist on the filesystem and must not be a symlink
|
76
|
+
# if in safe mode.
|
77
|
+
#
|
78
|
+
# Returns false if the directory doesn't exist or if it's a symlink
|
79
|
+
# and we're in safe mode.
|
80
|
+
def exists?
|
81
|
+
File.directory?(directory) && !(File.symlink?(directory) && site.safe)
|
82
|
+
end
|
83
|
+
|
84
|
+
# The entry filter for this collection.
|
85
|
+
# Creates an instance of Jekyll::EntryFilter.
|
86
|
+
#
|
87
|
+
# Returns the instance of Jekyll::EntryFilter for this collection.
|
88
|
+
def entry_filter
|
89
|
+
@entry_filter ||= Jekyll::EntryFilter.new(site, relative_directory)
|
90
|
+
end
|
91
|
+
|
92
|
+
# An inspect string.
|
93
|
+
#
|
94
|
+
# Returns the inspect string
|
95
|
+
def inspect
|
96
|
+
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
|
97
|
+
end
|
98
|
+
|
99
|
+
# Produce a sanitized label name
|
100
|
+
# Label names may not contain anything but alphanumeric characters,
|
101
|
+
# underscores, and hyphens.
|
102
|
+
#
|
103
|
+
# label - the possibly-unsafe label
|
104
|
+
#
|
105
|
+
# Returns a sanitized version of the label.
|
106
|
+
def sanitize_label(label)
|
107
|
+
label.gsub(/[^a-z0-9_\-]/i, '')
|
108
|
+
end
|
109
|
+
|
110
|
+
# Produce a representation of this Collection for use in Liquid.
|
111
|
+
# Exposes two attributes:
|
112
|
+
# - label
|
113
|
+
# - docs
|
114
|
+
#
|
115
|
+
# Returns a representation of this collection for use in Liquid.
|
116
|
+
def to_liquid
|
117
|
+
docs
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
data/lib/jekyll/command.rb
CHANGED
@@ -67,8 +67,10 @@ module Jekyll
|
|
67
67
|
c.option 'future', '--future', 'Publishes posts with a future date'
|
68
68
|
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
69
69
|
c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild'
|
70
|
+
c.option 'force_polling', '--force_polling', 'Force watch to use polling'
|
70
71
|
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
|
71
72
|
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'
|
73
|
+
c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished'
|
72
74
|
c.option 'quiet', '-q', '--quiet', 'Silence output.'
|
73
75
|
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
|
74
76
|
end
|
@@ -69,7 +69,11 @@ module Jekyll
|
|
69
69
|
|
70
70
|
Jekyll.logger.info "Auto-regeneration:", "enabled"
|
71
71
|
|
72
|
-
listener = Listen.to(
|
72
|
+
listener = Listen.to(
|
73
|
+
source,
|
74
|
+
:ignore => ignored,
|
75
|
+
:force_polling => options['force_polling']
|
76
|
+
) do |modified, added, removed|
|
73
77
|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
74
78
|
n = modified.length + added.length + removed.length
|
75
79
|
print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} "
|
@@ -37,7 +37,7 @@ module Jekyll
|
|
37
37
|
FileUtils.mkdir_p(destination)
|
38
38
|
|
39
39
|
# monkey patch WEBrick using custom 404 page (/404.html)
|
40
|
-
if File.
|
40
|
+
if File.exist?(File.join(destination, '404.html'))
|
41
41
|
WEBrick::HTTPResponse.class_eval do
|
42
42
|
def create_error_page
|
43
43
|
@body = IO.read(File.join(@config[:DocumentRoot], '404.html'))
|