jekyll 1.5.1 → 2.0.0.alpha.1
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/CONTRIBUTING.markdown +6 -6
- data/History.markdown +99 -23
- data/README.markdown +7 -3
- data/Rakefile +5 -5
- data/bin/jekyll +101 -116
- data/features/embed_filters.feature +13 -0
- data/features/include_tag.feature +11 -0
- data/features/markdown.feature +3 -3
- data/features/site_configuration.feature +34 -3
- data/features/step_definitions/jekyll_steps.rb +47 -34
- data/features/support/env.rb +25 -28
- data/jekyll.gemspec +38 -18
- data/lib/jekyll.rb +7 -15
- data/lib/jekyll/commands/build.rb +2 -0
- data/lib/jekyll/commands/serve.rb +11 -1
- data/lib/jekyll/configuration.rb +22 -6
- data/lib/jekyll/converter.rb +16 -16
- data/lib/jekyll/converters/markdown.rb +30 -15
- data/lib/jekyll/converters/markdown/maruku_parser.rb +4 -5
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +34 -3
- data/lib/jekyll/converters/sass.rb +58 -0
- data/lib/jekyll/converters/textile.rb +2 -2
- data/lib/jekyll/convertible.rb +25 -6
- data/lib/jekyll/core_ext.rb +0 -35
- data/lib/jekyll/deprecator.rb +2 -2
- data/lib/jekyll/entry_filter.rb +61 -25
- data/lib/jekyll/excerpt.rb +8 -6
- data/lib/jekyll/filters.rb +46 -2
- data/lib/jekyll/layout_reader.rb +40 -0
- data/lib/jekyll/mime.types +19 -9
- data/lib/jekyll/page.rb +6 -4
- data/lib/jekyll/post.rb +11 -18
- data/lib/jekyll/site.rb +34 -32
- data/lib/jekyll/tags/highlight.rb +26 -4
- data/lib/jekyll/tags/include.rb +29 -17
- data/lib/jekyll/tags/post_url.rb +10 -1
- data/lib/jekyll/url.rb +0 -2
- data/lib/site_template/_config.yml +1 -1
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +1 -1
- data/lib/site_template/css/main.css +8 -1
- data/script/bootstrap +2 -0
- data/script/branding +11 -0
- data/script/cibuild +5 -0
- data/script/rebund +140 -0
- data/site/_config.yml +2 -2
- data/site/_data/docs.yml +44 -0
- data/site/{css → _includes/css}/gridism.css +0 -0
- data/site/_includes/css/normalize.css +1 -0
- data/site/{css → _includes/css}/pygments.css +2 -0
- data/site/{css → _includes/css}/style.css +10 -0
- data/site/_includes/docs_contents.html +4 -12
- data/site/_includes/docs_contents_mobile.html +4 -17
- data/site/_includes/docs_option.html +1 -1
- data/site/_includes/docs_ul.html +2 -2
- data/site/_includes/footer.html +1 -1
- data/site/_includes/top.html +1 -4
- data/site/_layouts/news_item.html +2 -2
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +4 -4
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +1 -1
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +1 -1
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +20 -0
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +1 -2
- data/site/css/screen.css +27 -0
- data/site/docs/assets.md +46 -0
- data/site/docs/configuration.md +18 -4
- data/site/docs/contributing.md +2 -2
- data/site/docs/datafiles.md +6 -6
- data/site/docs/deployment-methods.md +5 -0
- data/site/docs/extras.md +38 -2
- data/site/docs/frontmatter.md +2 -1
- data/site/docs/history.md +0 -22
- data/site/docs/installation.md +7 -7
- data/site/docs/migrations.md +1 -1
- data/site/docs/plugins.md +11 -2
- data/site/docs/posts.md +25 -4
- data/site/docs/sites.md +1 -1
- data/site/docs/structure.md +1 -1
- data/site/docs/templates.md +13 -8
- data/site/docs/troubleshooting.md +8 -5
- data/site/docs/usage.md +11 -0
- data/site/docs/variables.md +18 -0
- data/site/docs/windows.md +44 -0
- data/test/helper.rb +5 -8
- data/test/source/_includes/include.html +1 -0
- data/test/source/_includes/sig.markdown +2 -2
- data/test/source/_posts/2013-12-17-include-variable-filters.markdown +21 -0
- data/test/source/_posts/2013-12-20-properties.text +11 -0
- data/test/source/_sass/_grid.scss +1 -0
- data/test/source/css/main.scss +4 -0
- data/test/source/js/coffeescript.coffee +10 -0
- data/test/source/properties.html +8 -0
- data/test/source/unpublished.html +7 -0
- data/test/test_coffeescript.rb +49 -0
- data/test/test_configuration.rb +29 -18
- data/test/test_convertible.rb +7 -9
- data/test/test_core_ext.rb +0 -22
- data/test/test_entry_filter.rb +36 -2
- data/test/test_excerpt.rb +43 -1
- data/test/test_filters.rb +44 -5
- data/test/test_generated_site.rb +5 -1
- data/test/test_layout_reader.rb +17 -0
- data/test/test_page.rb +28 -10
- data/test/test_post.rb +32 -15
- data/test/test_redcarpet.rb +19 -3
- data/test/test_sass.rb +122 -0
- data/test/test_site.rb +56 -7
- data/test/test_tags.rb +102 -51
- metadata +154 -80
- data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +0 -19
- data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +0 -26
- data/site/css/normalize.css +0 -1
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/exploit.md +0 -5
- data/test/test_path_sanitization.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e35c918f0934bb55de7b1591e07da3f0aec52aa
|
4
|
+
data.tar.gz: 3898da127bf6315ae05408642f5109286ab906d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0eb8bcf642c692a0ee7ca5fbb8d4185c0abd27b052d6eae1da056929b6b38694cc662d8f8ad9a3fbd0c4cd45f535512c31fde81f9f008195e7c80f88fcd957
|
7
|
+
data.tar.gz: 528a7516fb6aa1919008e7d9a9310271b93e0e7cc7c87ce51dc963019b90adb27dcc9fcddb648b4f38610ad740b9bc857a7bac9ab9a95a16a31fa9895837a971
|
data/CONTRIBUTING.markdown
CHANGED
@@ -53,7 +53,7 @@ Here's the most direct way to get your work merged into the project:
|
|
53
53
|
* Make sure everything still passes by running `rake`.
|
54
54
|
* If necessary, rebase your commits into logical chunks, without errors.
|
55
55
|
* Push the branch up ( `git push origin my_awesome_feature` ).
|
56
|
-
* Create a pull request against
|
56
|
+
* Create a pull request against jekyll/jekyll and describe what your change
|
57
57
|
does and the why you think it should be merged.
|
58
58
|
|
59
59
|
Updating Documentation
|
@@ -63,14 +63,14 @@ We want the Jekyll documentation to be the best it can be. We've
|
|
63
63
|
open-sourced our docs and we welcome any pull requests if you find it
|
64
64
|
lacking.
|
65
65
|
|
66
|
-
You can find the documentation for jekyllrb.com in the
|
67
|
-
[site](https://github.com/
|
66
|
+
You can find the documentation for jekyllrb.com in the
|
67
|
+
[site](https://github.com/jekyll/jekyll/tree/master/site) directory of
|
68
68
|
Jekyll's repo on GitHub.com.
|
69
69
|
|
70
70
|
All documentation pull requests should be directed at `master`. Pull
|
71
|
-
requests directed at another branch will not be accepted.
|
71
|
+
requests directed at another branch will not be accepted.
|
72
72
|
|
73
|
-
The [Jekyll wiki](https://github.com/
|
73
|
+
The [Jekyll wiki](https://github.com/jekyll/jekyll/wiki) on GitHub
|
74
74
|
can be freely updated without a pull request as all GitHub users have access.
|
75
75
|
|
76
76
|
Gotchas
|
@@ -78,7 +78,7 @@ Gotchas
|
|
78
78
|
|
79
79
|
* If you want to bump the gem version, please put that in a separate commit.
|
80
80
|
This way, the maintainers can control when the gem gets released.
|
81
|
-
* Try to keep your patch(es) based from the latest commit on
|
81
|
+
* Try to keep your patch(es) based from the latest commit on jekyll/jekyll.
|
82
82
|
The easier it is to apply your work, the less work the maintainers have to do,
|
83
83
|
which is always a good thing.
|
84
84
|
* Please don't tag your GitHub issue with [fix], [feature], etc. The maintainers
|
data/History.markdown
CHANGED
@@ -1,41 +1,117 @@
|
|
1
1
|
## HEAD
|
2
2
|
|
3
3
|
### Major Enhancements
|
4
|
+
* Add gem-based plugin whitelist to safe mode (#1657)
|
5
|
+
* Replace the commander command line parser with a more robust
|
6
|
+
solution for our needs called `mercenary` (#1706)
|
7
|
+
* Remove support for Ruby 1.8.x (#1780)
|
8
|
+
* Move to jekyll/jekyll from mojombo/jekyll (#1817)
|
9
|
+
* Allow custom markdown processors (#1872)
|
10
|
+
* Provide support for the Rouge syntax highlighter (#1859)
|
11
|
+
* Provide support for Sass (#1932)
|
12
|
+
* Provide a 300% improvement when generating sites that use
|
13
|
+
`Post#next` or `Post#previous` (#1983)
|
14
|
+
* Provide support for CoffeeScript (#1991)
|
15
|
+
* Replace Maruku with Kramdown as Default Markdown Processor (#1988)
|
4
16
|
|
5
17
|
### Minor Enhancements
|
18
|
+
* Move the EntryFilter class into the Jekyll module to avoid polluting the
|
19
|
+
global namespace (#1800)
|
20
|
+
* Add `group_by` Liquid filter create lists of items grouped by a common
|
21
|
+
property's value (#1788)
|
22
|
+
* Add support for Maruku's `fenced_code_blocks` option (#1799)
|
23
|
+
* Update Redcarpet dependency to ~> 3.0 (#1815)
|
24
|
+
* Automatically sort all pages by name (#1848)
|
25
|
+
* Better error message when time is not parseable (#1847)
|
26
|
+
* Allow `include` tag variable arguments to use filters (#1841)
|
27
|
+
* `post_url` tag should raise `ArgumentError` for invalid name (#1825)
|
28
|
+
* Bump dependency `mercenary` to `~> 0.2.0` (#1879)
|
29
|
+
* Bump dependency `safe_yaml` to `~> 1.0` (#1886)
|
30
|
+
* Allow sorting of content by custom properties (#1849)
|
31
|
+
* Add `--quiet` flag to silence output during build and serve (#1898)
|
32
|
+
* Add a `where` filter to filter arrays based on a key/value pair
|
33
|
+
(#1875)
|
34
|
+
* Route 404 errors to a custom 404 page in development (#1899)
|
35
|
+
* Excludes are now relative to the site source (#1916)
|
36
|
+
* Bring MIME Types file for `jekyll serve` to complete parity with GH Pages
|
37
|
+
servers (#1993)
|
38
|
+
* Adding Breakpoint to make new site template more responsive (#2038)
|
39
|
+
* Default to using the UTF-8 encoding when reading files. (#2031)
|
6
40
|
|
7
41
|
### Bug Fixes
|
42
|
+
* Don't allow nil entries when loading posts (#1796)
|
43
|
+
* Remove the scrollbar that's always displayed in new sites generated
|
44
|
+
from the site template (#1805)
|
45
|
+
* Add `#path` to required methods in `Jekyll::Convertible` (#1866)
|
46
|
+
* Default Maruku fenced code blocks to ON for 2.0.0-dev (#1831)
|
47
|
+
* Change short opts for host and port for `jekyll docs` to be consistent with
|
48
|
+
other subcommands (#1877)
|
49
|
+
* Fix typos (#1910)
|
50
|
+
* Lock Maruku at 0.7.0 to prevent bugs caused by Maruku 0.7.1 (#1958)
|
51
|
+
* Fixes full path leak to source directory when using include tag (#1951)
|
52
|
+
* Don't generate pages that aren't being published (#1931)
|
53
|
+
* Use `SafeYAML.load` to avoid conflicts with other projects (#1982)
|
54
|
+
* Relative posts should never fail to build (#1976)
|
8
55
|
|
9
56
|
### Development Fixes
|
57
|
+
* Add a link to the site in the README.md file (#1795)
|
58
|
+
* Add in History and site changes from `v1-stable` branch (#1836)
|
59
|
+
* Testing additions on the Excerpt class (#1893)
|
60
|
+
* Update Kramdown to `~> 1.3` (#1894)
|
61
|
+
* Fix the `highlight` tag feature (#1859)
|
62
|
+
* Test Jekyll under Ruby 2.1.0 (#1900)
|
63
|
+
* Add script/cibuild for fun and profit (#1912)
|
64
|
+
* Use `Forwardable` for delegation between `Excerpt` and `Post`
|
65
|
+
(#1927)
|
66
|
+
* Rename `read_things` to `read_content` (#1928)
|
67
|
+
* Add `script/branding` script for ASCII art lovin' (#1936)
|
68
|
+
* Update the README to reflect the repo move (#1943)
|
69
|
+
* Add the project vision to the README (#1935)
|
70
|
+
* Speed up Travis CI builds by using Rebund (#1985)
|
71
|
+
* Use Yarp as a Gem proxy for Travis CI (#1984)
|
72
|
+
* Remove Yarp as a Gem proxy for Travis CI (#2004)
|
73
|
+
* Move the reading of layouts into its own class (#2020)
|
74
|
+
* Test Sass import (#2009)
|
10
75
|
|
11
76
|
### Site Enhancements
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
*
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
*
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
*
|
29
|
-
*
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
*
|
77
|
+
* Document Kramdown's GFM parser option (#1791)
|
78
|
+
* Move CSS to includes & update normalize.css to v2.1.3 (#1787)
|
79
|
+
* Minify CSS only in production (#1803)
|
80
|
+
* Fix broken link to installation of Ruby on Mountain Lion blog post on
|
81
|
+
Troubleshooting docs page (#1797)
|
82
|
+
* Fix issues with 1.4.1 release blog post (#1804)
|
83
|
+
* Add note about deploying to OpenShift (#1812)
|
84
|
+
* Collect all Windows-related docs onto one page (#1818)
|
85
|
+
* Fixed typo in datafiles doc page (#1854)
|
86
|
+
* Clarify how to access `site` in docs (#1864)
|
87
|
+
* Add closing `<code>` tag to `context.registers[:site]` note (#1867)
|
88
|
+
* Fix link to @mojombo's site source (#1897)
|
89
|
+
* Add `paginate: nil` to default configuration in docs (#1896)
|
90
|
+
* Add link to our License in the site footer (#1889)
|
91
|
+
* Add a charset note in "Writing Posts" doc page (#1902)
|
92
|
+
* Disallow selection of path and prompt in bash examples
|
93
|
+
* Add jekyll-compass to the plugin list (#1923)
|
94
|
+
* Add note in Posts docs about stripping `<p>` tags from excerpt (#1933)
|
95
|
+
* Add additional info about the new exclude behavior (#1938)
|
96
|
+
* Linkify 'awesome contributors' to point to the contributors graph on
|
97
|
+
GitHub (#1940)
|
98
|
+
* Update `docs/sites.md` link to GitHub Training materials (#1949)
|
99
|
+
* Update `master` with the release info from 1.4.3 (#1947)
|
100
|
+
* Define docs nav in datafile (#1953)
|
101
|
+
* Clarify the docs around the naming convention for posts (#1971)
|
102
|
+
* Add missing `next` and `previous` docs for post layouts and templates (#1970)
|
103
|
+
* Add note to `Writing posts` page about how to strip html from excerpt (#1962)
|
104
|
+
* Add `jekyll-humanize` plugin to plugin list (#1998)
|
105
|
+
* Add `jekyll-font-awesome` plugin to plugin list (#1999)
|
106
|
+
* Add `sublime-jekyll` to list of Editor plugins (#2001)
|
107
|
+
* Add `vim-jekyll` to the list of Editor plugins (#2005)
|
108
|
+
* Fix non-semantic nesting of `p` tags in `news_item` layout (#2013)
|
109
|
+
* Document destination folder cleaning (#2016)
|
110
|
+
* Updated instructions for NearlyFreeSpeech.NET installation (#2015)
|
34
111
|
|
35
112
|
## 1.4.3 / 2014-01-13
|
36
113
|
|
37
114
|
### Bug Fixes
|
38
|
-
|
39
115
|
* Patch show-stopping security vulnerabilities (#1944)
|
40
116
|
|
41
117
|
## 1.4.2 / 2013-12-16
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Jekyll
|
1
|
+
# [Jekyll](http://jekyllrb.com/)
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/jekyll.png)](http://badge.fury.io/rb/jekyll)
|
4
4
|
|
@@ -7,9 +7,13 @@
|
|
7
7
|
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.png)](https://gemnasium.com/jekyll/jekyll)
|
8
8
|
[![Coverage Status](https://coveralls.io/repos/jekyll/jekyll/badge.png)](https://coveralls.io/r/jekyll/jekyll)
|
9
9
|
|
10
|
-
By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!
|
10
|
+
By Tom Preston-Werner, Nick Quaranto, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
11
11
|
|
12
|
-
Jekyll is a simple, blog
|
12
|
+
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](http://pages.github.com), which you can use to host sites right from your GitHub repositories.
|
13
|
+
|
14
|
+
## Philosophy
|
15
|
+
|
16
|
+
Jekyll does what you tell it to do — no more, no less. It doesn't try to outsmart users by making bold assumptions, nor does it burden them with needless complexity and configuration. Put simply, Jekyll gets out of your way and allows you to concentrate on what truly matters: your content.
|
13
17
|
|
14
18
|
## Getting Started
|
15
19
|
|
data/Rakefile
CHANGED
@@ -84,7 +84,7 @@ end
|
|
84
84
|
#
|
85
85
|
#############################################################################
|
86
86
|
|
87
|
-
if
|
87
|
+
if ENV["TRAVIS"] == "true"
|
88
88
|
require 'coveralls/rake/task'
|
89
89
|
Coveralls::RakeTask.new
|
90
90
|
|
@@ -156,7 +156,7 @@ namespace :site do
|
|
156
156
|
|
157
157
|
desc "Update normalize.css library to the latest version and minify"
|
158
158
|
task :update_normalize_css do
|
159
|
-
Dir.chdir("site/css") do
|
159
|
+
Dir.chdir("site/_includes/css") do
|
160
160
|
sh 'curl "http://necolas.github.io/normalize.css/latest/normalize.css" -o "normalize.scss"'
|
161
161
|
sh 'sass "normalize.scss":"normalize.css" --style compressed'
|
162
162
|
sh 'rm "normalize.scss"'
|
@@ -169,7 +169,7 @@ namespace :site do
|
|
169
169
|
puts "Checking for gh-pages dir..."
|
170
170
|
unless File.exist?("./gh-pages")
|
171
171
|
puts "No gh-pages directory found. Run the following commands first:"
|
172
|
-
puts " `git clone git@github.com:
|
172
|
+
puts " `git clone git@github.com:jekyll/jekyll gh-pages"
|
173
173
|
puts " `cd gh-pages"
|
174
174
|
puts " `git checkout gh-pages`"
|
175
175
|
exit(1)
|
@@ -252,8 +252,8 @@ end
|
|
252
252
|
#############################################################################
|
253
253
|
|
254
254
|
task :release => :build do
|
255
|
-
unless `git branch` =~
|
256
|
-
puts "You must be on the master branch
|
255
|
+
unless `git branch` =~ /^\* master$/
|
256
|
+
puts "You must be on the master branch to release!"
|
257
257
|
exit!
|
258
258
|
end
|
259
259
|
sh "git commit --allow-empty -m 'Release #{version}'"
|
data/bin/jekyll
CHANGED
@@ -3,156 +3,141 @@ STDOUT.sync = true
|
|
3
3
|
|
4
4
|
$:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
|
5
5
|
|
6
|
-
require 'commander/import'
|
7
6
|
require 'jekyll'
|
7
|
+
require 'mercenary'
|
8
8
|
|
9
9
|
Jekyll::Deprecator.process(ARGV)
|
10
10
|
|
11
|
-
program :name, 'jekyll'
|
12
|
-
program :version, Jekyll::VERSION
|
13
|
-
program :description, 'Jekyll is a blog-aware, static site generator in Ruby'
|
14
|
-
|
15
|
-
default_command :default
|
16
|
-
|
17
|
-
global_option '-s', '--source [DIR]', 'Source directory (defaults to ./)'
|
18
|
-
global_option '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
|
19
|
-
global_option '--safe', 'Safe mode (defaults to false)'
|
20
|
-
global_option '-p', '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
|
21
|
-
global_option '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
|
22
|
-
|
23
|
-
# Option names don't always directly match the configuration value we'd like.
|
24
|
-
# This method will rename options to match what Jekyll configuration expects.
|
25
|
-
#
|
26
|
-
# options - The Hash of options from Commander.
|
27
|
-
#
|
28
|
-
# Returns the normalized Hash.
|
29
|
-
def normalize_options(options)
|
30
|
-
if drafts_state = options.delete(:drafts)
|
31
|
-
options[:show_drafts] = drafts_state
|
32
|
-
end
|
33
|
-
options
|
34
|
-
end
|
35
|
-
|
36
11
|
def add_build_options(c)
|
37
|
-
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
38
|
-
c.option '--future', 'Publishes posts with a future date'
|
39
|
-
c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
40
|
-
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
41
|
-
c.option '--lsi', 'Use LSI for improved related posts'
|
42
|
-
c.option '-D', '--drafts', 'Render posts in the _drafts folder'
|
43
|
-
c.option '-
|
12
|
+
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
13
|
+
c.option 'future', '--future', 'Publishes posts with a future date'
|
14
|
+
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
15
|
+
c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild'
|
16
|
+
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
|
17
|
+
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'
|
18
|
+
c.option 'quiet', '-q', '--quiet', 'Silence output.'
|
19
|
+
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
|
44
20
|
end
|
45
21
|
|
46
|
-
|
47
|
-
|
22
|
+
Mercenary.program(:jekyll) do |p|
|
23
|
+
p.version Jekyll::VERSION
|
24
|
+
p.description 'Jekyll is a blog-aware, static site generator in Ruby'
|
25
|
+
p.syntax 'jekyll <subcommand> [options]'
|
26
|
+
|
27
|
+
p.option 'source', '-s', '--source [DIR]', 'Source directory (defaults to ./)'
|
28
|
+
p.option 'destination', '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
|
29
|
+
p.option 'safe', '--safe', 'Safe mode (defaults to false)'
|
30
|
+
p.option 'plugins', '-p', '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
|
31
|
+
p.option 'layouts', '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
|
32
|
+
|
33
|
+
p.action do |args, options|
|
48
34
|
if args.empty?
|
49
|
-
|
35
|
+
p.go(["-h"])
|
50
36
|
else
|
51
|
-
|
37
|
+
unless p.has_command?(args.first)
|
38
|
+
Jekyll.logger.abort_with "Invalid command. Use --help for more information"
|
39
|
+
end
|
52
40
|
end
|
53
41
|
end
|
54
|
-
end
|
55
42
|
|
56
|
-
command
|
57
|
-
|
58
|
-
|
43
|
+
p.command(:new) do |c|
|
44
|
+
c.syntax 'jekyll new PATH'
|
45
|
+
c.description 'Creates a new Jekyll site scaffold in PATH'
|
59
46
|
|
60
|
-
|
61
|
-
|
47
|
+
c.option 'force', '--force', 'Force creation even if PATH already exists'
|
48
|
+
c.option 'blank', '--blank', 'Creates scaffolding but with empty files'
|
62
49
|
|
63
|
-
|
64
|
-
|
50
|
+
c.action do |args, options|
|
51
|
+
Jekyll::Commands::New.process(args)
|
52
|
+
end
|
65
53
|
end
|
66
|
-
end
|
67
54
|
|
68
|
-
command
|
69
|
-
|
70
|
-
|
55
|
+
p.command(:build) do |c|
|
56
|
+
c.syntax 'jekyll build [options]'
|
57
|
+
c.description 'Build your site'
|
71
58
|
|
72
|
-
|
59
|
+
add_build_options(c)
|
73
60
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
61
|
+
c.action do |args, options|
|
62
|
+
options["serving"] = false
|
63
|
+
config = Jekyll.configuration(options)
|
64
|
+
Jekyll::Commands::Build.process(config)
|
65
|
+
end
|
78
66
|
end
|
79
|
-
end
|
80
|
-
|
81
|
-
command :serve do |c|
|
82
|
-
c.syntax = 'jekyll serve [options]'
|
83
|
-
c.description = 'Serve your site locally'
|
84
67
|
|
85
|
-
|
68
|
+
p.command(:serve) do |c|
|
69
|
+
c.syntax 'jekyll serve [options]'
|
70
|
+
c.description 'Serve your site locally'
|
71
|
+
c.alias :server
|
86
72
|
|
87
|
-
|
88
|
-
c.option '-P', '--port [PORT]', 'Port to listen on'
|
89
|
-
c.option '-H', '--host [HOST]', 'Host to bind to'
|
90
|
-
c.option '-b', '--baseurl [URL]', 'Base URL'
|
73
|
+
add_build_options(c)
|
91
74
|
|
92
|
-
|
93
|
-
|
75
|
+
c.option 'detach', '-B', '--detach', 'Run the server in the background (detach)'
|
76
|
+
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
|
77
|
+
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
|
78
|
+
c.option 'baseurl', '-b', '--baseurl [URL]', 'Base URL'
|
94
79
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
80
|
+
c.action do |args, options|
|
81
|
+
options["serving"] ||= true
|
82
|
+
options = Jekyll.configuration(options)
|
83
|
+
Jekyll::Commands::Build.process(options)
|
84
|
+
Jekyll::Commands::Serve.process(options)
|
85
|
+
end
|
99
86
|
end
|
100
|
-
end
|
101
|
-
alias_command :server, :serve
|
102
87
|
|
103
|
-
command
|
104
|
-
|
105
|
-
|
88
|
+
p.command(:doctor) do |c|
|
89
|
+
c.syntax 'jekyll doctor'
|
90
|
+
c.description 'Search site and print specific deprecation warnings'
|
91
|
+
c.alias(:hyde)
|
106
92
|
|
107
|
-
|
93
|
+
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
108
94
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
114
|
-
end
|
115
|
-
alias_command :hyde, :doctor
|
116
|
-
|
117
|
-
command :docs do |c|
|
118
|
-
c.syntax = 'jekyll docs'
|
119
|
-
c.description = "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"
|
120
|
-
|
121
|
-
c.option '-p', '--port [PORT]', 'Port to listen on'
|
122
|
-
c.option '-u', '--host [HOST]', 'Host to bind to'
|
123
|
-
|
124
|
-
c.action do |args, options|
|
125
|
-
options = normalize_options(options.__hash__)
|
126
|
-
options = Jekyll.configuration(options.merge!({
|
127
|
-
'source' => File.expand_path("../site", File.dirname(__FILE__)),
|
128
|
-
'destination' => File.expand_path("../site/_site", File.dirname(__FILE__))
|
129
|
-
}))
|
130
|
-
puts options
|
131
|
-
Jekyll::Commands::Build.process(options)
|
132
|
-
Jekyll::Commands::Serve.process(options)
|
95
|
+
c.action do |args, options|
|
96
|
+
options = Jekyll.configuration(options)
|
97
|
+
Jekyll::Commands::Doctor.process(options)
|
98
|
+
end
|
133
99
|
end
|
134
|
-
end
|
135
100
|
|
136
|
-
command
|
137
|
-
|
138
|
-
|
101
|
+
p.command(:docs) do |c|
|
102
|
+
c.syntax 'jekyll docs'
|
103
|
+
c.description "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"
|
104
|
+
|
105
|
+
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
|
106
|
+
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
|
107
|
+
|
108
|
+
c.action do |args, options|
|
109
|
+
options = normalize_options(options)
|
110
|
+
options = Jekyll.configuration(options.merge!({
|
111
|
+
'source' => File.expand_path("../site", File.dirname(__FILE__)),
|
112
|
+
'destination' => File.expand_path("../site/_site", File.dirname(__FILE__))
|
113
|
+
}))
|
114
|
+
Jekyll::Commands::Build.process(options)
|
115
|
+
Jekyll::Commands::Serve.process(options)
|
116
|
+
end
|
117
|
+
end
|
139
118
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
c.option '--pass STRING', 'Password to use when migrating'
|
145
|
-
c.option '--host STRING', 'Host address to use when migrating'
|
146
|
-
c.option '--prefix STRING', 'Database table prefix to use when migrating'
|
119
|
+
p.command(:import) do |c|
|
120
|
+
c.syntax 'jekyll import <platform> [options]'
|
121
|
+
c.description 'Import your old blog to Jekyll'
|
122
|
+
importers = []
|
147
123
|
|
148
|
-
c.action do |args, options|
|
149
124
|
begin
|
150
125
|
require 'jekyll-import'
|
126
|
+
importers = JekyllImport.add_importer_commands(c)
|
151
127
|
rescue LoadError
|
152
|
-
msg = "You must install the 'jekyll-import' gem before continuing.\n"
|
153
|
-
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
|
154
|
-
abort msg
|
155
128
|
end
|
156
|
-
|
129
|
+
|
130
|
+
c.action do |args, options|
|
131
|
+
unless Object.const_defined?(:JekyllImport)
|
132
|
+
msg = "You must install the 'jekyll-import' gem before continuing.\n"
|
133
|
+
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
|
134
|
+
abort msg
|
135
|
+
end
|
136
|
+
if args.empty?
|
137
|
+
Jekyll.logger.warn "You must specify an importer."
|
138
|
+
Jekyll.logger.info "Valid options are:"
|
139
|
+
importers.each { |i| Jekyll.logger.info "*", "#{i}" }
|
140
|
+
end
|
141
|
+
end
|
157
142
|
end
|
158
143
|
end
|