jekyll 1.0.0.rc1 → 1.0.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.
- data/CONTRIBUTING.md +1 -1
- data/History.txt +15 -1
- data/Rakefile +0 -4
- data/bin/jekyll +3 -3
- data/features/pagination.feature +5 -5
- data/features/step_definitions/jekyll_steps.rb +1 -1
- data/jekyll.gemspec +9 -6
- data/lib/jekyll.rb +1 -2
- data/lib/jekyll/commands/new.rb +4 -0
- data/lib/jekyll/configuration.rb +3 -1
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +1 -0
- data/lib/jekyll/convertible.rb +66 -36
- data/lib/jekyll/deprecator.rb +9 -0
- data/lib/jekyll/filters.rb +17 -4
- data/lib/jekyll/generators/pagination.rb +17 -5
- data/lib/jekyll/logger.rb +3 -1
- data/lib/jekyll/page.rb +1 -13
- data/lib/jekyll/post.rb +67 -49
- data/lib/jekyll/site.rb +3 -3
- data/lib/jekyll/tags/highlight.rb +2 -0
- data/lib/jekyll/tags/post_url.rb +25 -7
- data/lib/site_template/.gitignore +1 -0
- data/lib/site_template/_config.yml +1 -0
- data/lib/site_template/_layouts/default.html +44 -36
- data/lib/site_template/_layouts/post.html +3 -0
- data/lib/site_template/css/main.css +165 -0
- data/site/_includes/docs_contents.html +4 -1
- data/site/_includes/docs_contents_mobile.html +36 -0
- data/site/_includes/footer.html +10 -10
- data/site/_includes/header.html +7 -15
- data/site/_includes/primary-nav-items.html +11 -0
- data/site/_includes/top.html +2 -1
- data/site/_layouts/default.html +1 -1
- data/site/_layouts/docs.html +4 -2
- data/site/_posts/2012-07-01-configuration.md +18 -8
- data/site/_posts/2012-07-01-contributing.md +22 -6
- data/site/_posts/2012-07-01-extras.md +3 -2
- data/site/_posts/2012-07-01-frontmatter.md +7 -2
- data/site/_posts/2012-07-01-home.md +4 -4
- data/site/_posts/2012-07-01-installation.md +6 -6
- data/site/_posts/2012-07-01-migrations.md +64 -23
- data/site/_posts/2012-07-01-pages.md +2 -2
- data/site/_posts/2012-07-01-pagination.md +6 -1
- data/site/_posts/2012-07-01-permalinks.md +6 -0
- data/site/_posts/2012-07-01-plugins.md +9 -1
- data/site/_posts/2012-07-01-resources.md +1 -4
- data/site/_posts/2012-07-01-structure.md +3 -1
- data/site/_posts/2012-07-01-templates.md +2 -1
- data/site/_posts/2012-07-01-troubleshooting.md +20 -2
- data/site/_posts/2012-07-01-upgrading.md +104 -0
- data/site/_posts/2012-07-01-usage.md +1 -1
- data/site/_posts/2012-07-01-variables.md +18 -9
- data/site/css/gridism.css +110 -0
- data/site/css/style.css +236 -101
- data/site/img/footer-logo.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/index.html +51 -43
- data/test/helper.rb +1 -0
- data/test/source/_posts/es/2008-11-21-nested.textile +8 -0
- data/test/test_convertible.rb +1 -1
- data/test/test_filters.rb +34 -11
- data/test/test_generated_site.rb +13 -2
- data/test/test_kramdown.rb +4 -2
- data/test/test_pager.rb +4 -2
- data/test/test_post.rb +2 -2
- data/test/test_site.rb +7 -6
- data/test/test_tags.rb +30 -0
- metadata +12 -12
- data/lib/site_template/css/screen.css +0 -189
- data/lib/site_template/images/.gitkeep +0 -0
- data/lib/site_template/images/rss.png +0 -0
- data/site/css/grid.css +0 -62
data/CONTRIBUTING.md
CHANGED
@@ -41,7 +41,7 @@ Workflow
|
|
41
41
|
Here's the most direct way to get your work merged into the project:
|
42
42
|
|
43
43
|
* Fork the project.
|
44
|
-
* Clone down your fork ( `git clone git
|
44
|
+
* Clone down your fork ( `git clone git@github.com:<username>/jekyll.git` ).
|
45
45
|
* Create a topic branch to contain your change ( `git checkout -b my_awesome_feature` ).
|
46
46
|
* Hack away, add tests. Not necessarily in that order.
|
47
47
|
* Make sure everything still passes by running `rake`.
|
data/History.txt
CHANGED
@@ -6,6 +6,12 @@
|
|
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
|
+
* Site template HTML5-ified (#964)
|
10
|
+
* Use post's directory path when matching for the post_url tag (#998)
|
11
|
+
* Loosen dependency on Pygments so it's only required when it's needed (#1015)
|
12
|
+
* Parse strings into Time objects for date-related Liquid filters (#1014)
|
13
|
+
* Tell the user if there is no subcommand specified (#1008)
|
14
|
+
* Freak out if the destination of `jekyll new` exists and is non-empty (#981)
|
9
15
|
* Add `timezone` configuration option for compilation (#957)
|
10
16
|
* Add deprecation messages for pre-1.0 CLI options (#959)
|
11
17
|
* Refactor and colorize logging (#959)
|
@@ -46,6 +52,12 @@
|
|
46
52
|
* Add source and destination directory protection (#535)
|
47
53
|
* Better YAML error message (#718)
|
48
54
|
* Bug Fixes
|
55
|
+
* Paginate in subdirectories properly (#1016)
|
56
|
+
* Ensure post and page URLs have a leading slash (#992)
|
57
|
+
* Catch all exceptions, not just StandardError descendents (#1007)
|
58
|
+
* Bullet-proof limit_posts option (#1004)
|
59
|
+
* Read in YAML as UTF-8 to accept non-ASCII chars (#836)
|
60
|
+
* Fix the CLI option --plugins to actually accept dirs and files (#993)
|
49
61
|
* Allow 'excerpt' in YAML Front-Matter to override the extracted excerpt (#946)
|
50
62
|
* Fix cascade problem with site.baseurl, site.port and site.host. (#935)
|
51
63
|
* Filter out directories with valid post names (#875)
|
@@ -67,13 +79,15 @@
|
|
67
79
|
* Add SVG support to Jekyll/WEBrick. (#407, #406)
|
68
80
|
* Prevent custom destination from causing continuous regen on watch (#528, #820, #862)
|
69
81
|
* Site Enhancements
|
82
|
+
* Responsify (#860)
|
83
|
+
* Fix spelling, punctuation and phrasal errors (#989)
|
70
84
|
* Update quickstart instructions with `new` command (#966)
|
71
85
|
* Add docs for page.excerpt (#956)
|
72
86
|
* Add docs for page.path (#951)
|
73
87
|
* Clean up site docs to prepare for 1.0 release (#918)
|
74
88
|
* Bring site into master branch with better preview/deploy (#709)
|
75
89
|
* Redesigned site (#583)
|
76
|
-
* Development
|
90
|
+
* Development Fixes
|
77
91
|
* Exclude Cucumber 1.2.4, which causes tests to fail in 1.9.2 (#938)
|
78
92
|
* Added "features:html" rake task for debugging purposes, cleaned up
|
79
93
|
cucumber profiles (#832)
|
data/Rakefile
CHANGED
@@ -111,10 +111,6 @@ namespace :site do
|
|
111
111
|
|
112
112
|
desc "Commit the local site to the gh-pages branch and publish to GitHub Pages"
|
113
113
|
task :publish do
|
114
|
-
# Failsafe. Remove this once it has been done.
|
115
|
-
puts "Make sure to merge #583 into gh-pages before deploying."
|
116
|
-
exit(1)
|
117
|
-
|
118
114
|
# Ensure the gh-pages dir exists so we can generate into it.
|
119
115
|
puts "Checking for gh-pages dir..."
|
120
116
|
unless File.exist?("./gh-pages")
|
data/bin/jekyll
CHANGED
@@ -17,7 +17,7 @@ default_command :help
|
|
17
17
|
global_option '-s', '--source [DIR]', 'Source directory (defaults to ./)'
|
18
18
|
global_option '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
|
19
19
|
global_option '--safe', 'Safe mode (defaults to false)'
|
20
|
-
global_option '--plugins', 'Plugins directory (defaults to ./_plugins)'
|
20
|
+
global_option '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
|
21
21
|
global_option '--layouts', 'Layouts directory (defaults to ./_layouts)'
|
22
22
|
|
23
23
|
# Option names don't always directly match the configuration value we'd like.
|
@@ -48,7 +48,7 @@ command :build do |c|
|
|
48
48
|
|
49
49
|
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
50
50
|
c.option '--future', 'Publishes posts with a future date'
|
51
|
-
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
51
|
+
c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
52
52
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
53
53
|
c.option '--lsi', 'Use LSI for improved related posts'
|
54
54
|
c.option '--drafts', 'Render posts in the _drafts folder'
|
@@ -66,7 +66,7 @@ command :serve do |c|
|
|
66
66
|
|
67
67
|
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
68
68
|
c.option '--future', 'Publishes posts with a future date'
|
69
|
-
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
69
|
+
c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
70
70
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
71
71
|
c.option '--lsi', 'Use LSI for improved related posts'
|
72
72
|
c.option '--drafts', 'Render posts in the _drafts folder'
|
data/features/pagination.feature
CHANGED
@@ -2,13 +2,13 @@ Feature: Site pagination
|
|
2
2
|
In order to paginate my blog
|
3
3
|
As a blog's user
|
4
4
|
I want divide the posts in several pages
|
5
|
-
|
5
|
+
|
6
6
|
Scenario Outline: Paginate with N posts per page
|
7
7
|
Given I have a configuration file with "paginate" set to "<num>"
|
8
8
|
And I have a _layouts directory
|
9
9
|
And I have an "index.html" page that contains "{{ paginator.posts.size }}"
|
10
10
|
And I have a _posts directory
|
11
|
-
And I have the following
|
11
|
+
And I have the following posts:
|
12
12
|
| title | date | layout | content |
|
13
13
|
| Wargames | 3/27/2009 | default | The only winning move is not to play. |
|
14
14
|
| Wargames2 | 4/27/2009 | default | The only winning move is not to play2. |
|
@@ -32,10 +32,10 @@ Feature: Site pagination
|
|
32
32
|
| paginate | 1 |
|
33
33
|
| paginate_path | /blog/page-:num |
|
34
34
|
| permalink | /blog/:year/:month/:day/:title |
|
35
|
-
|
36
|
-
|
35
|
+
And I have a blog directory
|
36
|
+
And I have an "blog/index.html" page that contains "{{ paginator.posts.size }}"
|
37
37
|
And I have a _posts directory
|
38
|
-
And I have the following
|
38
|
+
And I have the following posts:
|
39
39
|
| title | date | layout | content |
|
40
40
|
| Wargames | 3/27/2009 | default | The only winning move is not to play. |
|
41
41
|
| Wargames2 | 4/27/2009 | default | The only winning move is not to play2. |
|
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'
|
8
8
|
s.license = 'MIT'
|
9
|
-
s.date = '2013-
|
9
|
+
s.date = '2013-05-06'
|
10
10
|
s.rubyforge_project = 'jekyll'
|
11
11
|
|
12
12
|
s.summary = "A simple, blog aware, static site generator."
|
@@ -102,14 +102,13 @@ Gem::Specification.new do |s|
|
|
102
102
|
lib/jekyll/tags/highlight.rb
|
103
103
|
lib/jekyll/tags/include.rb
|
104
104
|
lib/jekyll/tags/post_url.rb
|
105
|
+
lib/site_template/.gitignore
|
105
106
|
lib/site_template/_config.yml
|
106
107
|
lib/site_template/_layouts/default.html
|
107
108
|
lib/site_template/_layouts/post.html
|
108
109
|
lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb
|
109
|
-
lib/site_template/css/
|
110
|
+
lib/site_template/css/main.css
|
110
111
|
lib/site_template/css/syntax.css
|
111
|
-
lib/site_template/images/.gitkeep
|
112
|
-
lib/site_template/images/rss.png
|
113
112
|
lib/site_template/index.html
|
114
113
|
script/bootstrap
|
115
114
|
site/.gitignore
|
@@ -118,8 +117,10 @@ Gem::Specification.new do |s|
|
|
118
117
|
site/_config.yml
|
119
118
|
site/_includes/analytics.html
|
120
119
|
site/_includes/docs_contents.html
|
120
|
+
site/_includes/docs_contents_mobile.html
|
121
121
|
site/_includes/footer.html
|
122
122
|
site/_includes/header.html
|
123
|
+
site/_includes/primary-nav-items.html
|
123
124
|
site/_includes/section_nav.html
|
124
125
|
site/_includes/top.html
|
125
126
|
site/_layouts/default.html
|
@@ -144,9 +145,10 @@ Gem::Specification.new do |s|
|
|
144
145
|
site/_posts/2012-07-01-structure.md
|
145
146
|
site/_posts/2012-07-01-templates.md
|
146
147
|
site/_posts/2012-07-01-troubleshooting.md
|
148
|
+
site/_posts/2012-07-01-upgrading.md
|
147
149
|
site/_posts/2012-07-01-usage.md
|
148
150
|
site/_posts/2012-07-01-variables.md
|
149
|
-
site/css/
|
151
|
+
site/css/gridism.css
|
150
152
|
site/css/normalize.css
|
151
153
|
site/css/pygments.css
|
152
154
|
site/css/style.css
|
@@ -202,6 +204,7 @@ Gem::Specification.new do |s|
|
|
202
204
|
test/source/_posts/2013-01-12-no-layout.textile
|
203
205
|
test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep
|
204
206
|
test/source/_posts/2013-04-11-custom-excerpt.markdown
|
207
|
+
test/source/_posts/es/2008-11-21-nested.textile
|
205
208
|
test/source/about.html
|
206
209
|
test/source/category/_posts/2008-9-23-categories.textile
|
207
210
|
test/source/contacts.html
|
data/lib/jekyll.rb
CHANGED
@@ -24,7 +24,6 @@ require 'English'
|
|
24
24
|
# 3rd party
|
25
25
|
require 'liquid'
|
26
26
|
require 'maruku'
|
27
|
-
require 'pygments'
|
28
27
|
require 'colorator'
|
29
28
|
|
30
29
|
# internal requires
|
@@ -57,7 +56,7 @@ require_all 'jekyll/tags'
|
|
57
56
|
SafeYAML::OPTIONS[:suppress_warnings] = true
|
58
57
|
|
59
58
|
module Jekyll
|
60
|
-
VERSION = '1.0.0
|
59
|
+
VERSION = '1.0.0'
|
61
60
|
|
62
61
|
# Public: Generate a Jekyll configuration Hash by merging the default
|
63
62
|
# options with anything in _config.yml, and adding the given options on top.
|
data/lib/jekyll/commands/new.rb
CHANGED
@@ -8,6 +8,10 @@ module Jekyll
|
|
8
8
|
|
9
9
|
new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
|
10
10
|
FileUtils.mkdir_p new_blog_path
|
11
|
+
unless Dir["#{new_blog_path}/**/*"].empty?
|
12
|
+
Jekyll::Logger.error "Conflict:", "#{new_blog_path} exists and is not empty."
|
13
|
+
exit(1)
|
14
|
+
end
|
11
15
|
|
12
16
|
create_sample_files new_blog_path
|
13
17
|
|
data/lib/jekyll/configuration.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
module Jekyll
|
2
4
|
class Configuration < Hash
|
3
5
|
|
@@ -14,7 +16,7 @@ module Jekyll
|
|
14
16
|
|
15
17
|
'safe' => false,
|
16
18
|
'show_drafts' => nil,
|
17
|
-
'limit_posts' =>
|
19
|
+
'limit_posts' => 0,
|
18
20
|
'lsi' => false,
|
19
21
|
'future' => true, # remove and make true just default
|
20
22
|
'pygments' => true, # remove and make true just default
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'set'
|
2
4
|
|
3
5
|
# Convertible provides methods for converting a pagelike item
|
@@ -32,10 +34,10 @@ module Jekyll
|
|
32
34
|
self.content = $POSTMATCH
|
33
35
|
self.data = YAML.safe_load($1)
|
34
36
|
end
|
35
|
-
rescue => e
|
36
|
-
puts "Error reading file #{File.join(base, name)}: #{e.message}"
|
37
37
|
rescue SyntaxError => e
|
38
|
-
puts "YAML Exception reading #{File.join(base, name)}: #{e.message}"
|
38
|
+
puts "YAML Exception reading #{File.join(base, name)}: #{e.message}"
|
39
|
+
rescue Exception => e
|
40
|
+
puts "Error reading file #{File.join(base, name)}: #{e.message}"
|
39
41
|
end
|
40
42
|
|
41
43
|
self.data ||= {}
|
@@ -64,34 +66,31 @@ module Jekyll
|
|
64
66
|
@converter ||= self.site.converters.find { |c| c.matches(self.ext) }
|
65
67
|
end
|
66
68
|
|
67
|
-
#
|
69
|
+
# Render Liquid in the content
|
68
70
|
#
|
69
|
-
#
|
70
|
-
#
|
71
|
+
# content - the raw Liquid content to render
|
72
|
+
# payload - the payload for Liquid
|
73
|
+
# info - the info for Liquid
|
71
74
|
#
|
72
|
-
# Returns
|
73
|
-
def
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
begin
|
81
|
-
self.content = Liquid::Template.parse(self.content).render!(payload, info)
|
82
|
-
rescue => e
|
83
|
-
puts "Liquid Exception: #{e.message} in #{self.name}"
|
84
|
-
e.backtrace.each do |backtrace|
|
85
|
-
puts backtrace
|
86
|
-
end
|
87
|
-
abort("Build Failed")
|
75
|
+
# Returns the converted content
|
76
|
+
def render_liquid(content, payload, info)
|
77
|
+
Liquid::Template.parse(content).render!(payload, info)
|
78
|
+
rescue Exception => e
|
79
|
+
Jekyll::Logger.error "Liquid Exception:", "#{e.message} in #{payload[:file]}"
|
80
|
+
e.backtrace.each do |backtrace|
|
81
|
+
puts backtrace
|
88
82
|
end
|
83
|
+
abort("Build Failed")
|
84
|
+
end
|
89
85
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
86
|
+
# Recursively render layouts
|
87
|
+
#
|
88
|
+
# layouts - a list of the layouts
|
89
|
+
# payload - the payload for Liquid
|
90
|
+
# info - the info for Liquid
|
91
|
+
#
|
92
|
+
# Returns nothing
|
93
|
+
def render_all_layouts(layouts, payload, info)
|
95
94
|
# recursively render layouts
|
96
95
|
layout = layouts[self.data["layout"]]
|
97
96
|
used = Set.new([layout])
|
@@ -99,15 +98,9 @@ module Jekyll
|
|
99
98
|
while layout
|
100
99
|
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
|
106
|
-
e.backtrace.each do |backtrace|
|
107
|
-
puts backtrace
|
108
|
-
end
|
109
|
-
abort("Build Failed")
|
110
|
-
end
|
101
|
+
self.output = self.render_liquid(layout.content,
|
102
|
+
payload.merge({:file => self.data["layout"]}),
|
103
|
+
info)
|
111
104
|
|
112
105
|
if layout = layouts[layout.data["layout"]]
|
113
106
|
if used.include?(layout)
|
@@ -118,5 +111,42 @@ module Jekyll
|
|
118
111
|
end
|
119
112
|
end
|
120
113
|
end
|
114
|
+
|
115
|
+
# Add any necessary layouts to this convertible document.
|
116
|
+
#
|
117
|
+
# payload - The site payload Hash.
|
118
|
+
# layouts - A Hash of {"name" => "layout"}.
|
119
|
+
#
|
120
|
+
# Returns nothing.
|
121
|
+
def do_layout(payload, layouts)
|
122
|
+
info = { :filters => [Jekyll::Filters], :registers => { :site => self.site, :page => payload['page'] } }
|
123
|
+
|
124
|
+
# render and transform content (this becomes the final content of the object)
|
125
|
+
payload["pygments_prefix"] = converter.pygments_prefix
|
126
|
+
payload["pygments_suffix"] = converter.pygments_suffix
|
127
|
+
|
128
|
+
self.content = self.render_liquid(self.content,
|
129
|
+
payload.merge({:file => self.name}),
|
130
|
+
info)
|
131
|
+
self.transform
|
132
|
+
|
133
|
+
# output keeps track of what will finally be written
|
134
|
+
self.output = self.content
|
135
|
+
|
136
|
+
self.render_all_layouts(layouts, payload, info)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Write the generated page file to the destination directory.
|
140
|
+
#
|
141
|
+
# dest - The String path to the destination dir.
|
142
|
+
#
|
143
|
+
# Returns nothing.
|
144
|
+
def write(dest)
|
145
|
+
path = destination(dest)
|
146
|
+
FileUtils.mkdir_p(File.dirname(path))
|
147
|
+
File.open(path, 'w') do |f|
|
148
|
+
f.write(self.output)
|
149
|
+
end
|
150
|
+
end
|
121
151
|
end
|
122
152
|
end
|
data/lib/jekyll/deprecator.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Jekyll
|
2
2
|
class Deprecator
|
3
3
|
def self.process(args)
|
4
|
+
no_subcommand(args)
|
4
5
|
deprecation_message args, "--server", "The --server command has been replaced by the \
|
5
6
|
'serve' subcommand."
|
6
7
|
deprecation_message args, "--no-server", "To build Jekyll without launching a server, \
|
@@ -15,6 +16,14 @@ module Jekyll
|
|
15
16
|
deprecation_message args, "--url", "The 'url' setting can only be set in your config files."
|
16
17
|
end
|
17
18
|
|
19
|
+
def self.no_subcommand(args)
|
20
|
+
if args.size == 0 || args.first =~ /^--/
|
21
|
+
Jekyll::Logger.error "Deprecation:", "Jekyll now uses subcommands instead of just \
|
22
|
+
switches. Run `jekyll help' to find out more."
|
23
|
+
exit(1)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
18
27
|
def self.deprecation_message(args, deprecated_argument, message)
|
19
28
|
if args.include?(deprecated_argument)
|
20
29
|
Jekyll::Logger.error "Deprecation:", message
|
data/lib/jekyll/filters.rb
CHANGED
@@ -30,7 +30,7 @@ module Jekyll
|
|
30
30
|
#
|
31
31
|
# Returns the formatting String.
|
32
32
|
def date_to_string(date)
|
33
|
-
date.strftime("%d %b %Y")
|
33
|
+
time(date).strftime("%d %b %Y")
|
34
34
|
end
|
35
35
|
|
36
36
|
# Format a date in long format e.g. "27 January 2011".
|
@@ -39,7 +39,7 @@ module Jekyll
|
|
39
39
|
#
|
40
40
|
# Returns the formatted String.
|
41
41
|
def date_to_long_string(date)
|
42
|
-
date.strftime("%d %B %Y")
|
42
|
+
time(date).strftime("%d %B %Y")
|
43
43
|
end
|
44
44
|
|
45
45
|
# Format a date for use in XML.
|
@@ -53,7 +53,7 @@ module Jekyll
|
|
53
53
|
#
|
54
54
|
# Returns the formatted String.
|
55
55
|
def date_to_xmlschema(date)
|
56
|
-
date.xmlschema
|
56
|
+
time(date).xmlschema
|
57
57
|
end
|
58
58
|
|
59
59
|
# Format a date according to RFC-822
|
@@ -67,7 +67,7 @@ module Jekyll
|
|
67
67
|
#
|
68
68
|
# Returns the formatted String.
|
69
69
|
def date_to_rfc822(date)
|
70
|
-
date.rfc822
|
70
|
+
time(date).rfc822
|
71
71
|
end
|
72
72
|
|
73
73
|
# XML escape a string for use. Replaces any special characters with
|
@@ -137,5 +137,18 @@ module Jekyll
|
|
137
137
|
"#{array[0...-1].join(', ')}, #{connector} #{array[-1]}"
|
138
138
|
end
|
139
139
|
end
|
140
|
+
|
141
|
+
private
|
142
|
+
def time(input)
|
143
|
+
case input
|
144
|
+
when Time
|
145
|
+
input
|
146
|
+
when String
|
147
|
+
Time.parse(input)
|
148
|
+
else
|
149
|
+
Jekyll::Logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
|
150
|
+
exit(1)
|
151
|
+
end
|
152
|
+
end
|
140
153
|
end
|
141
154
|
end
|