jekyll 1.0.0.beta4 → 1.0.0.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.
- data/History.txt +14 -0
- data/bin/jekyll +4 -3
- data/features/post_data.feature +24 -0
- data/features/site_configuration.feature +40 -0
- data/features/site_data.feature +19 -0
- data/features/step_definitions/jekyll_steps.rb +18 -3
- data/features/support/env.rb +5 -1
- data/jekyll.gemspec +11 -2
- data/lib/jekyll.rb +22 -100
- data/lib/jekyll/command.rb +15 -0
- data/lib/jekyll/commands/build.rb +7 -23
- data/lib/jekyll/configuration.rb +169 -0
- data/lib/jekyll/converters/markdown.rb +8 -114
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +44 -0
- data/lib/jekyll/converters/markdown/maruku_parser.rb +47 -0
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +26 -0
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +40 -0
- data/lib/jekyll/convertible.rb +1 -1
- data/lib/jekyll/deprecator.rb +25 -0
- data/lib/jekyll/logger.rb +52 -0
- data/lib/jekyll/mime.types +1 -0
- data/lib/jekyll/page.rb +2 -13
- data/lib/jekyll/post.rb +20 -7
- data/lib/jekyll/site.rb +6 -6
- data/lib/site_template/_config.yml +0 -1
- data/site/_config.yml +0 -2
- data/site/_posts/2012-07-01-configuration.md +16 -0
- data/site/_posts/2012-07-01-variables.md +27 -1
- data/site/index.html +7 -2
- data/test/source/_posts/2013-04-11-custom-excerpt.markdown +10 -0
- data/test/test_configuration.rb +91 -9
- data/test/test_generated_site.rb +4 -4
- data/test/test_page.rb +1 -11
- data/test/test_pager.rb +2 -2
- data/test/test_post.rb +22 -16
- data/test/test_site.rb +16 -16
- data/test/test_tags.rb +1 -1
- metadata +29 -2
data/History.txt
CHANGED
@@ -6,6 +6,15 @@
|
|
6
6
|
* Added ability to render drafts in _drafts folder via command line (#833)
|
7
7
|
* Add ordinal date permalink style (/:categories/:year/:y_day/:title.html) (#928)
|
8
8
|
* Minor Enhancements
|
9
|
+
* Add `timezone` configuration option for compilation (#957)
|
10
|
+
* Add deprecation messages for pre-1.0 CLI options (#959)
|
11
|
+
* Refactor and colorize logging (#959)
|
12
|
+
* Refactor Markdown parsing (#955)
|
13
|
+
* Added application/vnd.apple.pkpass to mime.types served by WEBrick (#907)
|
14
|
+
* Move template site to default markdown renderer (#961)
|
15
|
+
* Expose new attribute to Liquid via `page`: `page.path` (#951)
|
16
|
+
* Accept multiple config files from command line (#945)
|
17
|
+
* Add page variable to liquid custom tags and blocks (#413)
|
9
18
|
* Add paginator.previous_page_path and paginator.next_page_path (#942)
|
10
19
|
* Backwards compatibility for 'auto' (#821, #934)
|
11
20
|
* Added date_to_rfc822 used on RSS feeds (#892)
|
@@ -31,11 +40,13 @@
|
|
31
40
|
* Truncate post slugs when importing from Tumblr (#496)
|
32
41
|
* Add glob support to include, exclude option (#743)
|
33
42
|
* Layout of Page or Post defaults to 'page' or 'post', respectively (#580)
|
43
|
+
REPEALED by (#977)
|
34
44
|
* "Keep files" feature (#685)
|
35
45
|
* Output full path & name for files that don't parse (#745)
|
36
46
|
* Add source and destination directory protection (#535)
|
37
47
|
* Better YAML error message (#718)
|
38
48
|
* Bug Fixes
|
49
|
+
* Allow 'excerpt' in YAML Front-Matter to override the extracted excerpt (#946)
|
39
50
|
* Fix cascade problem with site.baseurl, site.port and site.host. (#935)
|
40
51
|
* Filter out directories with valid post names (#875)
|
41
52
|
* Fix symlinked static files not being correctly built in unsafe mode (#909)
|
@@ -56,6 +67,9 @@
|
|
56
67
|
* Add SVG support to Jekyll/WEBrick. (#407, #406)
|
57
68
|
* Prevent custom destination from causing continuous regen on watch (#528, #820, #862)
|
58
69
|
* Site Enhancements
|
70
|
+
* Update quickstart instructions with `new` command (#966)
|
71
|
+
* Add docs for page.excerpt (#956)
|
72
|
+
* Add docs for page.path (#951)
|
59
73
|
* Clean up site docs to prepare for 1.0 release (#918)
|
60
74
|
* Bring site into master branch with better preview/deploy (#709)
|
61
75
|
* Redesigned site (#583)
|
data/bin/jekyll
CHANGED
@@ -6,6 +6,8 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
|
|
6
6
|
require 'commander/import'
|
7
7
|
require 'jekyll'
|
8
8
|
|
9
|
+
Jekyll::Deprecator.process(ARGV)
|
10
|
+
|
9
11
|
program :name, 'jekyll'
|
10
12
|
program :version, Jekyll::VERSION
|
11
13
|
program :description, 'Jekyll is a blog-aware, static site generator in Ruby'
|
@@ -44,7 +46,7 @@ command :build do |c|
|
|
44
46
|
c.syntax = 'jekyll build [options]'
|
45
47
|
c.description = 'Build your site'
|
46
48
|
|
47
|
-
c.option '--config [
|
49
|
+
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
48
50
|
c.option '--future', 'Publishes posts with a future date'
|
49
51
|
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
50
52
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
@@ -52,7 +54,6 @@ command :build do |c|
|
|
52
54
|
c.option '--drafts', 'Render posts in the _drafts folder'
|
53
55
|
|
54
56
|
c.action do |args, options|
|
55
|
-
options.defaults :serving => false
|
56
57
|
options = normalize_options(options.__hash__)
|
57
58
|
options = Jekyll.configuration(options)
|
58
59
|
Jekyll::Commands::Build.process(options)
|
@@ -63,7 +64,7 @@ command :serve do |c|
|
|
63
64
|
c.syntax = 'jekyll serve [options]'
|
64
65
|
c.description = 'Serve your site locally'
|
65
66
|
|
66
|
-
c.option '--config [
|
67
|
+
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
67
68
|
c.option '--future', 'Publishes posts with a future date'
|
68
69
|
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
69
70
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
data/features/post_data.feature
CHANGED
@@ -153,6 +153,30 @@ Feature: Post data
|
|
153
153
|
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
|
154
154
|
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2013/03/17/star-trek.html"
|
155
155
|
|
156
|
+
Scenario Outline: Use page.path variable
|
157
|
+
Given I have a <dir>/_posts directory
|
158
|
+
And I have the following post in "<dir>":
|
159
|
+
| title | type | date | content |
|
160
|
+
| my-post | html | 4/12/2013 | Source path: {{ page.path }} |
|
161
|
+
When I run jekyll
|
162
|
+
Then the _site directory should exist
|
163
|
+
And I should see "Source path: <path_prefix>_posts/2013-04-12-my-post.html" in "_site/<dir>/2013/04/12/my-post.html"
|
164
|
+
|
165
|
+
Examples:
|
166
|
+
| dir | path_prefix |
|
167
|
+
| . | |
|
168
|
+
| dir | dir/ |
|
169
|
+
| dir/nested | dir/nested/ |
|
170
|
+
|
171
|
+
Scenario: Override page.path variable
|
172
|
+
Given I have a _posts directory
|
173
|
+
And I have the following post:
|
174
|
+
| title | date | path | content |
|
175
|
+
| override | 4/12/2013 | override-path.html | Custom path: {{ page.path }} |
|
176
|
+
When I run jekyll
|
177
|
+
Then the _site directory should exist
|
178
|
+
And I should see "Custom path: override-path.html" in "_site/2013/04/12/override.html"
|
179
|
+
|
156
180
|
Scenario: Disable a post from being published
|
157
181
|
Given I have a _posts directory
|
158
182
|
And I have an "index.html" file that contains "Published!"
|
@@ -116,6 +116,46 @@ Feature: Site configuration
|
|
116
116
|
And I should see "Post Layout: <p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
|
117
117
|
And I should see "Post Layout: <p>content for entry2.</p>" in "_site/2020/01/31/entry2.html"
|
118
118
|
|
119
|
+
Scenario: Generate proper dates with explicitly set timezone (same as posts' time)
|
120
|
+
Given I have a _layouts directory
|
121
|
+
And I have a page layout that contains "Page Layout: {{ site.posts.size }}"
|
122
|
+
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
123
|
+
And I have an "index.html" page with layout "page" that contains "site index page"
|
124
|
+
And I have a configuration file with:
|
125
|
+
| key | value |
|
126
|
+
| timezone | America/New_York |
|
127
|
+
And I have a _posts directory
|
128
|
+
And I have the following posts:
|
129
|
+
| title | date | layout | content |
|
130
|
+
| entry1 | 2013-04-09 23:22 -0400 | post | content for entry1. |
|
131
|
+
| entry2 | 2013-04-10 03:14 -0400 | post | content for entry2. |
|
132
|
+
When I run jekyll
|
133
|
+
Then the _site directory should exist
|
134
|
+
And I should see "Page Layout: 2" in "_site/index.html"
|
135
|
+
And I should see "Post Layout: <p>content for entry1.</p> built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html"
|
136
|
+
And I should see "Post Layout: <p>content for entry2.</p> built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html"
|
137
|
+
|
138
|
+
Scenario: Generate proper dates with explicitly set timezone (different than posts' time)
|
139
|
+
Given I have a _layouts directory
|
140
|
+
And I have a page layout that contains "Page Layout: {{ site.posts.size }}"
|
141
|
+
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
142
|
+
And I have an "index.html" page with layout "page" that contains "site index page"
|
143
|
+
And I have a configuration file with:
|
144
|
+
| key | value |
|
145
|
+
| timezone | Australia/Melbourne |
|
146
|
+
And I have a _posts directory
|
147
|
+
And I have the following posts:
|
148
|
+
| title | date | layout | content |
|
149
|
+
| entry1 | 2013-04-09 23:22 -0400 | post | content for entry1. |
|
150
|
+
| entry2 | 2013-04-10 03:14 -0400 | post | content for entry2. |
|
151
|
+
When I run jekyll
|
152
|
+
Then the _site directory should exist
|
153
|
+
And I should see "Page Layout: 2" in "_site/index.html"
|
154
|
+
And the "_site/2013/04/10/entry1.html" file should exist
|
155
|
+
And the "_site/2013/04/10/entry2.html" file should exist
|
156
|
+
And I should see escaped "Post Layout: <p>content for entry1.</p> built at 2013-04-10T13:22:00+10:00" in "_site/2013/04/10/entry1.html"
|
157
|
+
And I should see escaped "Post Layout: <p>content for entry2.</p> built at 2013-04-10T17:14:00+10:00" in "_site/2013/04/10/entry2.html"
|
158
|
+
|
119
159
|
Scenario: Limit the number of posts generated by most recent date
|
120
160
|
Given I have a _posts directory
|
121
161
|
And I have a configuration file with:
|
data/features/site_data.feature
CHANGED
@@ -9,6 +9,25 @@ Feature: Site data
|
|
9
9
|
Then the _site directory should exist
|
10
10
|
And I should see "Contact: email@me.com" in "_site/contact.html"
|
11
11
|
|
12
|
+
Scenario Outline: Use page.path variable in a page
|
13
|
+
Given I have a <dir> directory
|
14
|
+
And I have a "<path>" page that contains "Source path: {{ page.path }}"
|
15
|
+
When I run jekyll
|
16
|
+
Then the _site directory should exist
|
17
|
+
And I should see "Source path: <path>" in "_site/<path>"
|
18
|
+
|
19
|
+
Examples:
|
20
|
+
| dir | path |
|
21
|
+
| . | index.html |
|
22
|
+
| dir | dir/about.html |
|
23
|
+
| dir/nested | dir/nested/page.html |
|
24
|
+
|
25
|
+
Scenario: Override page.path
|
26
|
+
Given I have an "override.html" page with path "custom-override.html" that contains "Custom path: {{ page.path }}"
|
27
|
+
When I run jekyll
|
28
|
+
Then the _site directory should exist
|
29
|
+
And I should see "Custom path: custom-override.html" in "_site/override.html"
|
30
|
+
|
12
31
|
Scenario: Use site.time variable
|
13
32
|
Given I have an "index.html" page that contains "{{ site.time }}"
|
14
33
|
When I run jekyll
|
@@ -1,4 +1,5 @@
|
|
1
1
|
Before do
|
2
|
+
FileUtils.rm_rf(TEST_DIR)
|
2
3
|
FileUtils.mkdir(TEST_DIR)
|
3
4
|
Dir.chdir(TEST_DIR)
|
4
5
|
end
|
@@ -61,14 +62,24 @@ Given /^I have the following (draft|post)s?(?: (.*) "(.*)")?:$/ do |status, dire
|
|
61
62
|
if "draft" == status
|
62
63
|
path = File.join(before || '.', '_drafts', after || '.', "#{title}.#{ext}")
|
63
64
|
else
|
64
|
-
|
65
|
+
format = if has_time_component?(post['date'])
|
66
|
+
'%Y-%m-%d %H:%M %z'
|
67
|
+
else
|
68
|
+
'%m/%d/%Y' # why even
|
69
|
+
end
|
70
|
+
parsed_date = DateTime.strptime(post['date'], format)
|
71
|
+
post['date'] = parsed_date.to_s
|
72
|
+
date = parsed_date.strftime('%Y-%m-%d')
|
65
73
|
path = File.join(before || '.', '_posts', after || '.', "#{date}-#{title}.#{ext}")
|
66
74
|
end
|
67
75
|
|
68
76
|
matter_hash = {}
|
69
|
-
%w(title layout tag tags category categories published author).each do |key|
|
77
|
+
%w(title layout tag tags category categories published author path).each do |key|
|
70
78
|
matter_hash[key] = post[key] if post[key]
|
71
79
|
end
|
80
|
+
if "post" == status
|
81
|
+
matter_hash["date"] = post["date"] if post["date"]
|
82
|
+
end
|
72
83
|
matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp
|
73
84
|
|
74
85
|
content = post['content']
|
@@ -134,7 +145,11 @@ Then /^the (.*) directory should exist$/ do |dir|
|
|
134
145
|
end
|
135
146
|
|
136
147
|
Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
|
137
|
-
|
148
|
+
assert Regexp.new(text).match(File.open(file).readlines.join)
|
149
|
+
end
|
150
|
+
|
151
|
+
Then /^I should see escaped "(.*)" in "(.*)"$/ do |text, file|
|
152
|
+
assert Regexp.new(Regexp.escape(text)).match(File.open(file).readlines.join)
|
138
153
|
end
|
139
154
|
|
140
155
|
Then /^the "(.*)" file should exist$/ do |file|
|
data/features/support/env.rb
CHANGED
@@ -7,7 +7,7 @@ World do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
TEST_DIR = File.join('/', 'tmp', 'jekyll')
|
10
|
-
JEKYLL_PATH = File.join(
|
10
|
+
JEKYLL_PATH = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll')
|
11
11
|
|
12
12
|
def run_jekyll(opts = {})
|
13
13
|
command = JEKYLL_PATH.clone
|
@@ -17,5 +17,9 @@ def run_jekyll(opts = {})
|
|
17
17
|
system command
|
18
18
|
end
|
19
19
|
|
20
|
+
def has_time_component?(date_string)
|
21
|
+
date_string.split(" ").size > 1
|
22
|
+
end
|
23
|
+
|
20
24
|
# work around "invalid option: --format" cucumber bug (see #296)
|
21
25
|
Test::Unit.run = true if RUBY_VERSION < '1.9'
|
data/jekyll.gemspec
CHANGED
@@ -4,9 +4,9 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
|
6
6
|
s.name = 'jekyll'
|
7
|
-
s.version = '1.0.0.
|
7
|
+
s.version = '1.0.0.rc1'
|
8
8
|
s.license = 'MIT'
|
9
|
-
s.date = '2013-04-
|
9
|
+
s.date = '2013-04-16'
|
10
10
|
s.rubyforge_project = 'jekyll'
|
11
11
|
|
12
12
|
s.summary = "A simple, blog aware, static site generator."
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_runtime_dependency('pygments.rb', "~> 0.4.2")
|
32
32
|
s.add_runtime_dependency('commander', "~> 4.1.3")
|
33
33
|
s.add_runtime_dependency('safe_yaml', "~> 0.7.0")
|
34
|
+
s.add_runtime_dependency('colorator', "~> 0.1")
|
34
35
|
|
35
36
|
s.add_development_dependency('rake', "~> 10.0.3")
|
36
37
|
s.add_development_dependency('rdoc', "~> 3.11")
|
@@ -72,18 +73,25 @@ Gem::Specification.new do |s|
|
|
72
73
|
lib/jekyll/commands/build.rb
|
73
74
|
lib/jekyll/commands/new.rb
|
74
75
|
lib/jekyll/commands/serve.rb
|
76
|
+
lib/jekyll/configuration.rb
|
75
77
|
lib/jekyll/converter.rb
|
76
78
|
lib/jekyll/converters/identity.rb
|
77
79
|
lib/jekyll/converters/markdown.rb
|
80
|
+
lib/jekyll/converters/markdown/kramdown_parser.rb
|
81
|
+
lib/jekyll/converters/markdown/maruku_parser.rb
|
82
|
+
lib/jekyll/converters/markdown/rdiscount_parser.rb
|
83
|
+
lib/jekyll/converters/markdown/redcarpet_parser.rb
|
78
84
|
lib/jekyll/converters/textile.rb
|
79
85
|
lib/jekyll/convertible.rb
|
80
86
|
lib/jekyll/core_ext.rb
|
87
|
+
lib/jekyll/deprecator.rb
|
81
88
|
lib/jekyll/draft.rb
|
82
89
|
lib/jekyll/errors.rb
|
83
90
|
lib/jekyll/filters.rb
|
84
91
|
lib/jekyll/generator.rb
|
85
92
|
lib/jekyll/generators/pagination.rb
|
86
93
|
lib/jekyll/layout.rb
|
94
|
+
lib/jekyll/logger.rb
|
87
95
|
lib/jekyll/mime.types
|
88
96
|
lib/jekyll/page.rb
|
89
97
|
lib/jekyll/plugin.rb
|
@@ -193,6 +201,7 @@ Gem::Specification.new do |s|
|
|
193
201
|
test/source/_posts/2013-01-12-nil-layout.textile
|
194
202
|
test/source/_posts/2013-01-12-no-layout.textile
|
195
203
|
test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep
|
204
|
+
test/source/_posts/2013-04-11-custom-excerpt.markdown
|
196
205
|
test/source/about.html
|
197
206
|
test/source/category/_posts/2008-9-23-categories.textile
|
198
207
|
test/source/contacts.html
|
data/lib/jekyll.rb
CHANGED
@@ -25,9 +25,13 @@ require 'English'
|
|
25
25
|
require 'liquid'
|
26
26
|
require 'maruku'
|
27
27
|
require 'pygments'
|
28
|
+
require 'colorator'
|
28
29
|
|
29
30
|
# internal requires
|
30
31
|
require 'jekyll/core_ext'
|
32
|
+
require 'jekyll/logger'
|
33
|
+
require 'jekyll/deprecator'
|
34
|
+
require 'jekyll/configuration'
|
31
35
|
require 'jekyll/site'
|
32
36
|
require 'jekyll/convertible'
|
33
37
|
require 'jekyll/layout'
|
@@ -46,123 +50,41 @@ require 'jekyll/command'
|
|
46
50
|
|
47
51
|
require_all 'jekyll/commands'
|
48
52
|
require_all 'jekyll/converters'
|
53
|
+
require_all 'jekyll/converters/markdown'
|
49
54
|
require_all 'jekyll/generators'
|
50
55
|
require_all 'jekyll/tags'
|
51
56
|
|
52
57
|
SafeYAML::OPTIONS[:suppress_warnings] = true
|
53
58
|
|
54
59
|
module Jekyll
|
55
|
-
VERSION = '1.0.0.
|
56
|
-
|
57
|
-
# Default options. Overriden by values in _config.yml.
|
58
|
-
# Strings rather than symbols are used for compatability with YAML.
|
59
|
-
DEFAULTS = {
|
60
|
-
'source' => Dir.pwd,
|
61
|
-
'destination' => File.join(Dir.pwd, '_site'),
|
62
|
-
'plugins' => '_plugins',
|
63
|
-
'layouts' => '_layouts',
|
64
|
-
'keep_files' => ['.git','.svn'],
|
65
|
-
|
66
|
-
'future' => true, # remove and make true just default
|
67
|
-
'pygments' => true, # remove and make true just default
|
68
|
-
|
69
|
-
'markdown' => 'maruku',
|
70
|
-
'permalink' => 'date',
|
71
|
-
'baseurl' => '/',
|
72
|
-
'include' => ['.htaccess'],
|
73
|
-
'paginate_path' => 'page:num',
|
74
|
-
|
75
|
-
'markdown_ext' => 'markdown,mkd,mkdn,md',
|
76
|
-
'textile_ext' => 'textile',
|
77
|
-
|
78
|
-
'port' => '4000',
|
79
|
-
'host' => '0.0.0.0',
|
80
|
-
|
81
|
-
'excerpt_separator' => "\n\n",
|
82
|
-
|
83
|
-
'maruku' => {
|
84
|
-
'use_tex' => false,
|
85
|
-
'use_divs' => false,
|
86
|
-
'png_engine' => 'blahtex',
|
87
|
-
'png_dir' => 'images/latex',
|
88
|
-
'png_url' => '/images/latex'
|
89
|
-
},
|
90
|
-
|
91
|
-
'rdiscount' => {
|
92
|
-
'extensions' => []
|
93
|
-
},
|
94
|
-
|
95
|
-
'redcarpet' => {
|
96
|
-
'extensions' => []
|
97
|
-
},
|
98
|
-
|
99
|
-
'kramdown' => {
|
100
|
-
'auto_ids' => true,
|
101
|
-
'footnote_nr' => 1,
|
102
|
-
'entity_output' => 'as_char',
|
103
|
-
'toc_levels' => '1..6',
|
104
|
-
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
105
|
-
'use_coderay' => false,
|
106
|
-
|
107
|
-
'coderay' => {
|
108
|
-
'coderay_wrap' => 'div',
|
109
|
-
'coderay_line_numbers' => 'inline',
|
110
|
-
'coderay_line_number_start' => 1,
|
111
|
-
'coderay_tab_width' => 4,
|
112
|
-
'coderay_bold_every' => 10,
|
113
|
-
'coderay_css' => 'style'
|
114
|
-
}
|
115
|
-
},
|
116
|
-
|
117
|
-
'redcloth' => {
|
118
|
-
'hard_breaks' => true
|
119
|
-
}
|
120
|
-
}
|
60
|
+
VERSION = '1.0.0.rc1'
|
121
61
|
|
122
62
|
# Public: Generate a Jekyll configuration Hash by merging the default
|
123
63
|
# options with anything in _config.yml, and adding the given options on top.
|
124
64
|
#
|
125
65
|
# override - A Hash of config directives that override any options in both
|
126
|
-
# the defaults and the config file. See Jekyll::DEFAULTS for a
|
66
|
+
# the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
|
127
67
|
# list of option names and their defaults.
|
128
68
|
#
|
129
69
|
# Returns the final configuration Hash.
|
130
70
|
def self.configuration(override)
|
131
|
-
|
132
|
-
override = override.
|
133
|
-
|
134
|
-
# _config.yml may override default source location, but until
|
135
|
-
# then, we need to know where to look for _config.yml
|
136
|
-
source = override['source'] || Jekyll::DEFAULTS['source']
|
71
|
+
config = Configuration[Configuration::DEFAULTS]
|
72
|
+
override = Configuration[override].stringify_keys
|
73
|
+
config = config.read_config_files(config.config_files(override))
|
137
74
|
|
138
|
-
#
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
begin
|
143
|
-
config = YAML.safe_load_file(config_file)
|
144
|
-
raise "Configuration file: (INVALID) #{config_file}" if !config.is_a?(Hash)
|
145
|
-
$stdout.puts "Configuration file: #{config_file}"
|
146
|
-
rescue SystemCallError
|
147
|
-
# Errno:ENOENT = file not found
|
148
|
-
$stderr.puts "Configuration file: none"
|
149
|
-
config = {}
|
150
|
-
rescue => err
|
151
|
-
$stderr.puts " " +
|
152
|
-
"WARNING: Error reading configuration. " +
|
153
|
-
"Using defaults (and options)."
|
154
|
-
$stderr.puts "#{err}"
|
155
|
-
config = {}
|
156
|
-
end
|
75
|
+
# Merge DEFAULTS < _config.yml < override
|
76
|
+
config = config.deep_merge(override).stringify_keys
|
77
|
+
set_timezone(config['timezone']) if config['timezone']
|
157
78
|
|
158
|
-
|
159
|
-
|
160
|
-
$stderr.puts "Deprecation: ".rjust(20) + "'auto' has been changed to " +
|
161
|
-
"'watch'. Please update your configuration to use 'watch'."
|
162
|
-
config['watch'] = config['auto']
|
163
|
-
end
|
79
|
+
config
|
80
|
+
end
|
164
81
|
|
165
|
-
|
166
|
-
|
82
|
+
# Static: Set the TZ environment variable to use the timezone specified
|
83
|
+
#
|
84
|
+
# timezone - the IANA Time Zone
|
85
|
+
#
|
86
|
+
# Returns nothing
|
87
|
+
def self.set_timezone(timezone)
|
88
|
+
ENV['TZ'] = timezone
|
167
89
|
end
|
168
90
|
end
|