jekyll 2.2.0 → 2.3.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.

Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +1 -1
  3. data/lib/jekyll.rb +0 -1
  4. data/lib/jekyll/collection.rb +18 -3
  5. data/lib/jekyll/command.rb +0 -25
  6. data/lib/jekyll/commands/build.rb +7 -2
  7. data/lib/jekyll/commands/help.rb +33 -0
  8. data/lib/jekyll/configuration.rb +36 -28
  9. data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
  10. data/lib/jekyll/convertible.rb +43 -20
  11. data/lib/jekyll/deprecator.rb +15 -8
  12. data/lib/jekyll/document.rb +21 -4
  13. data/lib/jekyll/filters.rb +27 -1
  14. data/lib/jekyll/frontmatter_defaults.rb +46 -12
  15. data/lib/jekyll/plugin.rb +10 -1
  16. data/lib/jekyll/post.rb +6 -13
  17. data/lib/jekyll/related_posts.rb +2 -2
  18. data/lib/jekyll/renderer.rb +7 -2
  19. data/lib/jekyll/site.rb +5 -7
  20. data/lib/jekyll/static_file.rb +24 -4
  21. data/lib/jekyll/tags/include.rb +3 -1
  22. data/lib/jekyll/tags/post_url.rb +2 -2
  23. data/lib/jekyll/utils.rb +88 -69
  24. data/lib/jekyll/version.rb +1 -1
  25. data/lib/site_template/_config.yml +6 -4
  26. data/lib/site_template/_includes/footer.html +43 -49
  27. data/lib/site_template/_includes/head.html +3 -4
  28. data/lib/site_template/_includes/header.html +9 -10
  29. data/lib/site_template/_layouts/default.html +6 -5
  30. data/lib/site_template/_layouts/page.html +3 -3
  31. data/lib/site_template/_layouts/post.html +4 -4
  32. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +6 -5
  33. data/lib/site_template/_sass/_base.scss +203 -0
  34. data/lib/site_template/_sass/_layout.scss +236 -0
  35. data/lib/site_template/_sass/_syntax-highlighting.scss +67 -0
  36. data/lib/site_template/css/main.scss +49 -0
  37. data/lib/site_template/feed.xml +1 -1
  38. data/lib/site_template/index.html +7 -4
  39. metadata +24 -431
  40. data/.gitignore +0 -15
  41. data/.travis.yml +0 -27
  42. data/CONTRIBUTING.markdown +0 -91
  43. data/Gemfile +0 -2
  44. data/History.markdown +0 -1310
  45. data/Rakefile +0 -268
  46. data/cucumber.yml +0 -3
  47. data/docs/jp/CONTRIBUTING.jp.markdown +0 -93
  48. data/docs/jp/README.jp.markdown +0 -68
  49. data/features/collections.feature +0 -145
  50. data/features/create_sites.feature +0 -158
  51. data/features/data.feature +0 -105
  52. data/features/drafts.feature +0 -46
  53. data/features/embed_filters.feature +0 -107
  54. data/features/frontmatter_defaults.feature +0 -136
  55. data/features/include_tag.feature +0 -68
  56. data/features/markdown.feature +0 -67
  57. data/features/pagination.feature +0 -82
  58. data/features/permalinks.feature +0 -85
  59. data/features/post_data.feature +0 -261
  60. data/features/post_excerpts.feature +0 -50
  61. data/features/rendering.feature +0 -34
  62. data/features/site_configuration.feature +0 -283
  63. data/features/site_data.feature +0 -107
  64. data/features/step_definitions/jekyll_steps.rb +0 -201
  65. data/features/support/env.rb +0 -65
  66. data/jekyll.gemspec +0 -66
  67. data/lib/site_template/css/main.css +0 -410
  68. data/script/bootstrap +0 -4
  69. data/script/branding +0 -11
  70. data/script/cibuild +0 -7
  71. data/script/console +0 -38
  72. data/script/proof +0 -22
  73. data/script/rebund +0 -140
  74. data/script/test +0 -17
  75. data/site/.gitignore +0 -4
  76. data/site/CNAME +0 -1
  77. data/site/README +0 -1
  78. data/site/_config.yml +0 -9
  79. data/site/_data/docs.yml +0 -46
  80. data/site/_includes/analytics.html +0 -30
  81. data/site/_includes/anchor_links.html +0 -32
  82. data/site/_includes/css/font-awesome.css +0 -44
  83. data/site/_includes/css/gridism.css +0 -110
  84. data/site/_includes/css/normalize.css +0 -1
  85. data/site/_includes/css/pygments.css +0 -72
  86. data/site/_includes/css/style.css +0 -1045
  87. data/site/_includes/docs_contents.html +0 -8
  88. data/site/_includes/docs_contents_mobile.html +0 -10
  89. data/site/_includes/docs_option.html +0 -11
  90. data/site/_includes/docs_ul.html +0 -20
  91. data/site/_includes/footer.html +0 -15
  92. data/site/_includes/header.html +0 -18
  93. data/site/_includes/news_contents.html +0 -33
  94. data/site/_includes/news_contents_mobile.html +0 -11
  95. data/site/_includes/news_item.html +0 -24
  96. data/site/_includes/primary-nav-items.html +0 -17
  97. data/site/_includes/section_nav.html +0 -22
  98. data/site/_includes/top.html +0 -17
  99. data/site/_layouts/default.html +0 -13
  100. data/site/_layouts/docs.html +0 -23
  101. data/site/_layouts/news.html +0 -19
  102. data/site/_layouts/news_item.html +0 -27
  103. data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +0 -23
  104. data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +0 -27
  105. data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +0 -28
  106. data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +0 -25
  107. data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +0 -27
  108. data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +0 -31
  109. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +0 -20
  110. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +0 -20
  111. data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +0 -23
  112. data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +0 -19
  113. data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
  114. data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
  115. data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
  116. data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
  117. data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +0 -20
  118. data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
  119. data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -26
  120. data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +0 -19
  121. data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +0 -26
  122. data/site/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +0 -31
  123. data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +0 -18
  124. data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +0 -19
  125. data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +0 -31
  126. data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +0 -30
  127. data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +0 -19
  128. data/site/css/screen.css +0 -31
  129. data/site/docs/assets.md +0 -66
  130. data/site/docs/collections.md +0 -259
  131. data/site/docs/configuration.md +0 -536
  132. data/site/docs/continuous-integration.md +0 -177
  133. data/site/docs/contributing.md +0 -133
  134. data/site/docs/datafiles.md +0 -108
  135. data/site/docs/deployment-methods.md +0 -127
  136. data/site/docs/drafts.md +0 -21
  137. data/site/docs/extras.md +0 -18
  138. data/site/docs/frontmatter.md +0 -191
  139. data/site/docs/github-pages.md +0 -91
  140. data/site/docs/history.md +0 -1514
  141. data/site/docs/index.md +0 -58
  142. data/site/docs/installation.md +0 -106
  143. data/site/docs/migrations.md +0 -11
  144. data/site/docs/pages.md +0 -86
  145. data/site/docs/pagination.md +0 -212
  146. data/site/docs/permalinks.md +0 -188
  147. data/site/docs/plugins.md +0 -561
  148. data/site/docs/posts.md +0 -211
  149. data/site/docs/quickstart.md +0 -26
  150. data/site/docs/resources.md +0 -43
  151. data/site/docs/sites.md +0 -29
  152. data/site/docs/structure.md +0 -190
  153. data/site/docs/templates.md +0 -376
  154. data/site/docs/troubleshooting.md +0 -147
  155. data/site/docs/upgrading.md +0 -146
  156. data/site/docs/usage.md +0 -74
  157. data/site/docs/variables.md +0 -382
  158. data/site/docs/windows.md +0 -44
  159. data/site/favicon.ico +0 -0
  160. data/site/feed.xml +0 -48
  161. data/site/fonts/FontAwesome.otf +0 -0
  162. data/site/fonts/fontawesome-webfont.eot +0 -0
  163. data/site/fonts/fontawesome-webfont.svg +0 -504
  164. data/site/fonts/fontawesome-webfont.ttf +0 -0
  165. data/site/fonts/fontawesome-webfont.woff +0 -0
  166. data/site/freenode.txt +0 -1
  167. data/site/img/article-footer.png +0 -0
  168. data/site/img/footer-arrow.png +0 -0
  169. data/site/img/footer-logo.png +0 -0
  170. data/site/img/jekyll-sticker.jpg +0 -0
  171. data/site/img/logo-2x.png +0 -0
  172. data/site/img/logo-rss.png +0 -0
  173. data/site/img/octojekyll.png +0 -0
  174. data/site/index.html +0 -90
  175. data/site/js/html5shiv.min.js +0 -4
  176. data/site/js/respond.min.js +0 -5
  177. data/site/news/index.html +0 -10
  178. data/site/news/releases/index.html +0 -10
  179. data/test/fixtures/broken_front_matter1.erb +0 -5
  180. data/test/fixtures/broken_front_matter2.erb +0 -4
  181. data/test/fixtures/broken_front_matter3.erb +0 -7
  182. data/test/fixtures/exploit_front_matter.erb +0 -4
  183. data/test/fixtures/front_matter.erb +0 -4
  184. data/test/helper.rb +0 -80
  185. data/test/source/+/%# +.md +0 -6
  186. data/test/source/+/foo.md +0 -7
  187. data/test/source/.htaccess +0 -8
  188. data/test/source/_config.dev.toml +0 -2
  189. data/test/source/_data/categories/dairy.yaml +0 -6
  190. data/test/source/_data/languages.yml +0 -2
  191. data/test/source/_data/members.json +0 -12
  192. data/test/source/_data/members.yaml +0 -7
  193. data/test/source/_data/products.yml +0 -4
  194. data/test/source/_drafts/draft-properties.text +0 -11
  195. data/test/source/_includes/include.html +0 -1
  196. data/test/source/_includes/params.html +0 -7
  197. data/test/source/_includes/sig.markdown +0 -3
  198. data/test/source/_layouts/default.html +0 -27
  199. data/test/source/_layouts/post/simple.html +0 -1
  200. data/test/source/_layouts/simple.html +0 -1
  201. data/test/source/_methods/_do_not_read_me.md +0 -5
  202. data/test/source/_methods/configuration.md +0 -8
  203. data/test/source/_methods/sanitized_path.md +0 -5
  204. data/test/source/_methods/site/_dont_include_me_either.md +0 -5
  205. data/test/source/_methods/site/generate.md +0 -6
  206. data/test/source/_methods/site/initialize.md +0 -4
  207. data/test/source/_methods/um_hi.md +0 -6
  208. data/test/source/_plugins/dummy.rb +0 -8
  209. data/test/source/_posts/2008-02-02-not-published.textile +0 -8
  210. data/test/source/_posts/2008-02-02-published.textile +0 -8
  211. data/test/source/_posts/2008-10-18-foo-bar.textile +0 -8
  212. data/test/source/_posts/2008-11-21-complex.textile +0 -8
  213. data/test/source/_posts/2008-12-03-permalinked-post.textile +0 -9
  214. data/test/source/_posts/2008-12-13-include.markdown +0 -8
  215. data/test/source/_posts/2009-01-27-array-categories.textile +0 -10
  216. data/test/source/_posts/2009-01-27-categories.textile +0 -7
  217. data/test/source/_posts/2009-01-27-category.textile +0 -7
  218. data/test/source/_posts/2009-01-27-empty-categories.textile +0 -7
  219. data/test/source/_posts/2009-01-27-empty-category.textile +0 -7
  220. data/test/source/_posts/2009-01-27-no-category.textile +0 -6
  221. data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
  222. data/test/source/_posts/2009-05-18-empty-tag.textile +0 -6
  223. data/test/source/_posts/2009-05-18-empty-tags.textile +0 -6
  224. data/test/source/_posts/2009-05-18-tag.textile +0 -6
  225. data/test/source/_posts/2009-05-18-tags.textile +0 -9
  226. data/test/source/_posts/2009-06-22-empty-yaml.textile +0 -3
  227. data/test/source/_posts/2009-06-22-no-yaml.textile +0 -1
  228. data/test/source/_posts/2010-01-08-triple-dash.markdown +0 -5
  229. data/test/source/_posts/2010-01-09-date-override.textile +0 -7
  230. data/test/source/_posts/2010-01-09-time-override.textile +0 -7
  231. data/test/source/_posts/2010-01-09-timezone-override.textile +0 -7
  232. data/test/source/_posts/2010-01-16-override-data.textile +0 -4
  233. data/test/source/_posts/2011-04-12-md-extension.md +0 -7
  234. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  235. data/test/source/_posts/2013-01-02-post-excerpt.markdown +0 -14
  236. data/test/source/_posts/2013-01-12-nil-layout.textile +0 -6
  237. data/test/source/_posts/2013-01-12-no-layout.textile +0 -5
  238. data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
  239. data/test/source/_posts/2013-04-11-custom-excerpt.markdown +0 -10
  240. data/test/source/_posts/2013-05-10-number-category.textile +0 -7
  241. data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +0 -23
  242. data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
  243. data/test/source/_posts/2013-12-17-include-variable-filters.markdown +0 -21
  244. data/test/source/_posts/2013-12-20-properties.text +0 -11
  245. data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
  246. data/test/source/_posts/2014-03-03-yaml-with-dots.md +0 -5
  247. data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +0 -6
  248. data/test/source/_posts/es/2008-11-21-nested.textile +0 -8
  249. data/test/source/_sass/_grid.scss +0 -1
  250. data/test/source/_slides/example-slide-1.html +0 -4
  251. data/test/source/_slides/example-slide-2.html +0 -7
  252. data/test/source/_slides/example-slide-3.html +0 -5
  253. data/test/source/_with.dots/all.dots/2.4.0.md +0 -5
  254. data/test/source/_with.dots/file.with.dots.md +0 -0
  255. data/test/source/about.html +0 -6
  256. data/test/source/category/_posts/2008-9-23-categories.textile +0 -6
  257. data/test/source/contacts.html +0 -5
  258. data/test/source/contacts/bar.html +0 -5
  259. data/test/source/contacts/index.html +0 -5
  260. data/test/source/css/main.scss +0 -4
  261. data/test/source/css/screen.css +0 -76
  262. data/test/source/deal.with.dots.html +0 -7
  263. data/test/source/environment.html +0 -5
  264. data/test/source/exploit.md +0 -5
  265. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +0 -8
  266. data/test/source/index.html +0 -22
  267. data/test/source/js/coffeescript.coffee +0 -10
  268. data/test/source/pgp.key +0 -2
  269. data/test/source/products.yml +0 -4
  270. data/test/source/properties.html +0 -8
  271. data/test/source/sitemap.xml +0 -32
  272. data/test/source/static_files.html +0 -4
  273. data/test/source/symlink-test/symlinked-file +0 -22
  274. data/test/source/unpublished.html +0 -7
  275. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +0 -7
  276. data/test/source/z_category/_posts/2008-9-23-categories.textile +0 -6
  277. data/test/suite.rb +0 -11
  278. data/test/test_cleaner.rb +0 -77
  279. data/test/test_coffeescript.rb +0 -49
  280. data/test/test_collections.rb +0 -224
  281. data/test/test_command.rb +0 -53
  282. data/test/test_configuration.rb +0 -201
  283. data/test/test_convertible.rb +0 -49
  284. data/test/test_document.rb +0 -193
  285. data/test/test_draft.rb +0 -56
  286. data/test/test_entry_filter.rb +0 -124
  287. data/test/test_excerpt.rb +0 -131
  288. data/test/test_filters.rb +0 -207
  289. data/test/test_generated_site.rb +0 -97
  290. data/test/test_kramdown.rb +0 -62
  291. data/test/test_layout_reader.rb +0 -34
  292. data/test/test_liquid_extensions.rb +0 -31
  293. data/test/test_log_adapter.rb +0 -59
  294. data/test/test_new_command.rb +0 -104
  295. data/test/test_page.rb +0 -254
  296. data/test/test_path_sanitization.rb +0 -18
  297. data/test/test_post.rb +0 -741
  298. data/test/test_rdiscount.rb +0 -22
  299. data/test/test_redcarpet.rb +0 -77
  300. data/test/test_redcloth.rb +0 -86
  301. data/test/test_related_posts.rb +0 -47
  302. data/test/test_sass.rb +0 -26
  303. data/test/test_site.rb +0 -452
  304. data/test/test_tags.rb +0 -509
  305. data/test/test_url.rb +0 -28
  306. data/test/test_utils.rb +0 -67
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a31f65d756e5aebe4d34d37dfa1a94f6d1ca51bf
4
- data.tar.gz: 20cc0c111cf0f43655be2e14ec523709606d8ff8
3
+ metadata.gz: 1bd7e49f4d0c08e3a671d21444bc80a53ef6c4a0
4
+ data.tar.gz: 8eec4bc8581b8abd01c7bf077b79980af61537b7
5
5
  SHA512:
6
- metadata.gz: 7bf6846863ee71fd92d708c9bfc5f86227a411b529b2e5f3028bcd6788991823cdd8dceb54cd7d76369f27c0c27e694de998da8a7da6d7036c52d09ede9e9789
7
- data.tar.gz: 5a10ab501a2df020e5f2fbdacf614a3512f50f9bbe963a70c58b046a8dc3cdb78c55224f1e646950c4b56df6b99863ef4c04d215ba805c2d7372ad34835fd93b
6
+ metadata.gz: 6688a5be7d34576575ec1098fe5f80c2f625c6a4eefa5869bcb64a9ce41fe8d5c05424c9105fbcdc88f44512fa663aafd458da75e0672b1bd97b328c42af65a0
7
+ data.tar.gz: 0ce421c5435ad40f8cf231e38891a6949a827a75964b7c2c426654f2746507ed1f77a1cba06be22f709bc77cd7949a81cedf6510c629d3ee463fb41d957cefde
@@ -5,7 +5,7 @@
5
5
  [![Code Climate](http://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
6
6
  [![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
7
7
 
8
- By Tom Preston-Werner, Nick Quaranto, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
8
+ By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
9
9
 
10
10
  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.
11
11
 
@@ -139,7 +139,6 @@ require_all 'jekyll/tags'
139
139
 
140
140
  # Eventually remove these for 3.0 as non-core
141
141
  Jekyll::Deprecator.gracefully_require(%w[
142
- classifier
143
142
  toml
144
143
  jekyll-paginate
145
144
  jekyll-gist
@@ -22,14 +22,28 @@ module Jekyll
22
22
  @docs ||= []
23
23
  end
24
24
 
25
+ # Fetch the static files in this collection.
26
+ # Defaults to an empty array if no static files have been read in.
27
+ #
28
+ # Returns an array of Jekyll::StaticFile objects.
29
+ def files
30
+ @files ||= []
31
+ end
32
+
25
33
  # Read the allowed documents into the collection's array of docs.
26
34
  #
27
35
  # Returns the sorted array of docs.
28
36
  def read
29
37
  filtered_entries.each do |file_path|
30
- doc = Jekyll::Document.new(Jekyll.sanitized_path(directory, file_path), { site: site, collection: self })
31
- doc.read
32
- docs << doc
38
+ full_path = Jekyll.sanitized_path(directory, file_path)
39
+ if Utils.has_yaml_header? full_path
40
+ doc = Jekyll::Document.new(full_path, { site: site, collection: self })
41
+ doc.read
42
+ docs << doc
43
+ else
44
+ relative_dir = File.join(relative_directory, File.dirname(file_path)).chomp("/.")
45
+ files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
46
+ end
33
47
  end
34
48
  docs.sort!
35
49
  end
@@ -118,6 +132,7 @@ module Jekyll
118
132
  metadata.merge({
119
133
  "label" => label,
120
134
  "docs" => docs,
135
+ "files" => files,
121
136
  "directory" => directory,
122
137
  "output" => write?,
123
138
  "relative_directory" => relative_directory
@@ -19,31 +19,6 @@ module Jekyll
19
19
  super(base)
20
20
  end
21
21
 
22
- # Paths to ignore for the watch option
23
- #
24
- # options - A Hash of options passed to the command
25
- #
26
- # Returns a list of relative paths from source that should be ignored
27
- def ignore_paths(options)
28
- source = options['source']
29
- destination = options['destination']
30
- config_files = Configuration[options].config_files(options)
31
- paths = config_files + Array(destination)
32
- ignored = []
33
-
34
- source_abs = Pathname.new(source).expand_path
35
- paths.each do |p|
36
- path_abs = Pathname.new(p).expand_path
37
- begin
38
- rel_path = path_abs.relative_path_from(source_abs).to_s
39
- ignored << Regexp.new(Regexp.escape(rel_path)) unless rel_path.start_with?('../')
40
- rescue ArgumentError
41
- # Could not find a relative path
42
- end
43
- end
44
- ignored
45
- end
46
-
47
22
  # Run Site#process and catch errors
48
23
  #
49
24
  # site - the Jekyll::Site object
@@ -32,7 +32,12 @@ module Jekyll
32
32
  else
33
33
  build(site, options)
34
34
  end
35
- watch(site, options) if options['watch']
35
+
36
+ if options.fetch('watch', false)
37
+ watch(site, options)
38
+ else
39
+ Jekyll.logger.info "Auto-regeneration:", "disabled. Use --watch to enable."
40
+ end
36
41
  end
37
42
 
38
43
  # Build your Jekyll site.
@@ -59,7 +64,7 @@ module Jekyll
59
64
  # Returns nothing.
60
65
  def watch(site, options)
61
66
  Deprecator.gracefully_require 'jekyll-watch'
62
- Jekyll::Commands::Watch.watch(site, options)
67
+ Jekyll::Watcher.watch(options)
63
68
  end
64
69
 
65
70
  end # end of class << self
@@ -0,0 +1,33 @@
1
+ module Jekyll
2
+ module Commands
3
+ class Help < Command
4
+ class << self
5
+
6
+ def init_with_program(prog)
7
+ prog.command(:help) do |c|
8
+ c.syntax 'help [subcommand]'
9
+ c.description 'Show the help message, optionally for a given subcommand.'
10
+
11
+ c.action do |args, _|
12
+ cmd = (args.first || "").to_sym
13
+ if args.empty?
14
+ puts prog
15
+ elsif prog.has_command? cmd
16
+ puts prog.commands[cmd]
17
+ else
18
+ invalid_command(prog, cmd)
19
+ abort
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def invalid_command(prog, cmd)
26
+ Jekyll.logger.error "Error:", "Hmm... we don't know what the '#{cmd}' command is."
27
+ Jekyll.logger.info "Valid commands:", prog.commands.keys.join(", ")
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
@@ -6,47 +6,55 @@ module Jekyll
6
6
  # Default options. Overridden by values in _config.yml.
7
7
  # Strings rather than symbols are used for compatibility with YAML.
8
8
  DEFAULTS = {
9
+ # Where things are
9
10
  'source' => Dir.pwd,
10
11
  'destination' => File.join(Dir.pwd, '_site'),
11
12
  'plugins' => '_plugins',
12
13
  'layouts' => '_layouts',
13
14
  'data_source' => '_data',
14
- 'keep_files' => ['.git','.svn'],
15
- 'gems' => [],
16
15
  'collections' => nil,
17
16
 
18
- 'timezone' => nil, # use the local timezone
19
-
20
- 'encoding' => 'utf-8', # always use utf-8 encoding. NEVER FORGET
21
-
17
+ # Handling Reading
22
18
  'safe' => false,
23
- 'detach' => false, # default to not detaching the server
19
+ 'include' => ['.htaccess'],
20
+ 'exclude' => [],
21
+ 'keep_files' => ['.git','.svn'],
22
+ 'encoding' => 'utf-8',
23
+ 'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
24
+ 'textile_ext' => 'textile',
25
+
26
+ # Filtering Content
24
27
  'show_drafts' => nil,
25
28
  'limit_posts' => 0,
26
- 'lsi' => false,
27
29
  'future' => true, # remove and make true just default
28
30
  'unpublished' => false,
29
31
 
30
- 'relative_permalinks' => false,
32
+ # Plugins
33
+ 'whitelist' => [],
34
+ 'gems' => [],
31
35
 
36
+ # Conversion
32
37
  'markdown' => 'kramdown',
33
38
  'highlighter' => 'pygments',
34
- 'permalink' => 'date',
35
- 'baseurl' => '',
36
- 'include' => ['.htaccess'],
37
- 'exclude' => [],
38
- 'paginate_path' => '/page:num',
39
-
40
- 'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
41
- 'textile_ext' => 'textile',
39
+ 'lsi' => false,
40
+ 'excerpt_separator' => "\n\n",
42
41
 
43
- 'quiet' => false,
42
+ # Serving
43
+ 'detach' => false, # default to not detaching the server
44
44
  'port' => '4000',
45
45
  'host' => '0.0.0.0',
46
+ 'baseurl' => '',
46
47
 
47
- 'excerpt_separator' => "\n\n",
48
+ # Backwards-compatibility options
49
+ 'relative_permalinks' => false,
50
+
51
+ # Output Configuration
52
+ 'permalink' => 'date',
53
+ 'paginate_path' => '/page:num',
54
+ 'timezone' => nil, # use the local timezone
48
55
 
49
- 'defaults' => [],
56
+ 'quiet' => false,
57
+ 'defaults' => [],
50
58
 
51
59
  'maruku' => {
52
60
  'use_tex' => false,
@@ -110,9 +118,9 @@ module Jekyll
110
118
 
111
119
  def safe_load_file(filename)
112
120
  case File.extname(filename)
113
- when '.toml'
121
+ when /\.toml/i
114
122
  TOML.load_file(filename)
115
- when /\.y(a)?ml/
123
+ when /\.ya?ml/i
116
124
  SafeYAML.load_file(filename)
117
125
  else
118
126
  raise ArgumentError, "No parser for '#{filename}' is available. Use a .toml or .y(a)ml file instead."
@@ -200,7 +208,7 @@ module Jekyll
200
208
  def backwards_compatibilize
201
209
  config = clone
202
210
  # Provide backwards-compatibility
203
- if config.has_key?('auto') || config.has_key?('watch')
211
+ if config.key?('auto') || config.key?('watch')
204
212
  Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
205
213
  " be set from your configuration file(s). Use the"+
206
214
  " --watch/-w command-line option instead."
@@ -208,23 +216,23 @@ module Jekyll
208
216
  config.delete('watch')
209
217
  end
210
218
 
211
- if config.has_key? 'server'
219
+ if config.key? 'server'
212
220
  Jekyll.logger.warn "Deprecation:", "The 'server' configuration option" +
213
221
  " is no longer accepted. Use the 'jekyll serve'" +
214
222
  " subcommand to serve your site with WEBrick."
215
223
  config.delete('server')
216
224
  end
217
225
 
218
- if config.has_key? 'server_port'
226
+ if config.key? 'server_port'
219
227
  Jekyll.logger.warn "Deprecation:", "The 'server_port' configuration option" +
220
228
  " has been renamed to 'port'. Please update your config" +
221
229
  " file accordingly."
222
230
  # copy but don't overwrite:
223
- config['port'] = config['server_port'] unless config.has_key?('port')
231
+ config['port'] = config['server_port'] unless config.key?('port')
224
232
  config.delete('server_port')
225
233
  end
226
234
 
227
- if config.has_key? 'pygments'
235
+ if config.key? 'pygments'
228
236
  Jekyll.logger.warn "Deprecation:", "The 'pygments' configuration option" +
229
237
  " has been renamed to 'highlighter'. Please update your" +
230
238
  " config file accordingly. The allowed values are 'rouge', " +
@@ -256,7 +264,7 @@ module Jekyll
256
264
  def fix_common_issues
257
265
  config = clone
258
266
 
259
- if config.has_key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 1)
267
+ if config.key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 1)
260
268
  Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" +
261
269
  " positive integer or nil. It's currently set to '#{config['paginate'].inspect}'."
262
270
  config['paginate'] = nil
@@ -16,7 +16,7 @@ module Jekyll
16
16
  if @config['kramdown']['use_coderay']
17
17
  %w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
18
18
  key = "coderay_#{opt}"
19
- @config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].has_key?(key)
19
+ @config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
20
20
  end
21
21
  end
22
22
 
@@ -25,7 +25,7 @@ module Jekyll
25
25
 
26
26
  # Whether the file is published or not, as indicated in YAML front-matter
27
27
  def published?
28
- !(data.has_key?('published') && data['published'] == false)
28
+ !(data.key?('published') && data['published'] == false)
29
29
  end
30
30
 
31
31
  # Returns merged option hash for File.read of self.site (if exists)
@@ -62,11 +62,14 @@ module Jekyll
62
62
  #
63
63
  # Returns nothing.
64
64
  def transform
65
- self.content = converter.convert(content)
66
- rescue => e
67
- Jekyll.logger.error "Conversion error:", "There was an error converting" +
68
- " '#{path}'."
69
- raise e
65
+ converters.reduce(content) do |output, converter|
66
+ begin
67
+ converter.convert output
68
+ rescue => e
69
+ Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{path}'."
70
+ raise e
71
+ end
72
+ end
70
73
  end
71
74
 
72
75
  # Determine the extension depending on content_type.
@@ -74,15 +77,21 @@ module Jekyll
74
77
  # Returns the String extension for the output file.
75
78
  # e.g. ".html" for an HTML output file.
76
79
  def output_ext
77
- converter.output_ext(ext)
80
+ if converters.all? { |c| c.is_a?(Jekyll::Converters::Identity) }
81
+ ext
82
+ else
83
+ converters.map { |c|
84
+ c.output_ext(ext) unless c.is_a?(Jekyll::Converters::Identity)
85
+ }.compact.last
86
+ end
78
87
  end
79
88
 
80
89
  # Determine which converter to use based on this convertible's
81
90
  # extension.
82
91
  #
83
92
  # Returns the Converter instance.
84
- def converter
85
- @converter ||= site.converters.find { |c| c.matches(ext) }
93
+ def converters
94
+ @converters ||= site.converters.select { |c| c.matches(ext) }.sort
86
95
  end
87
96
 
88
97
  # Render Liquid in the content
@@ -119,12 +128,12 @@ module Jekyll
119
128
  #
120
129
  # Returns the type of self.
121
130
  def type
122
- if is_a?(Post)
123
- :post
131
+ if is_a?(Draft)
132
+ :drafts
133
+ elsif is_a?(Post)
134
+ :posts
124
135
  elsif is_a?(Page)
125
- :page
126
- elsif is_a?(Draft)
127
- :draft
136
+ :pages
128
137
  end
129
138
  end
130
139
 
@@ -134,7 +143,21 @@ module Jekyll
134
143
  # Returns true if the extname belongs to the set of extensions
135
144
  # that asset files use.
136
145
  def asset_file?
137
- %w[.sass .scss .coffee].include?(ext)
146
+ sass_file? || coffeescript_file?
147
+ end
148
+
149
+ # Determine whether the document is a Sass file.
150
+ #
151
+ # Returns true if extname == .sass or .scss, false otherwise.
152
+ def sass_file?
153
+ %w[.sass .scss].include?(ext)
154
+ end
155
+
156
+ # Determine whether the document is a CoffeeScript file.
157
+ #
158
+ # Returns true if extname == .coffee, false otherwise.
159
+ def coffeescript_file?
160
+ '.coffee'.eql?(ext)
138
161
  end
139
162
 
140
163
  # Determine whether the file should be rendered with Liquid.
@@ -142,7 +165,7 @@ module Jekyll
142
165
  # Returns false if the document is either an asset file or a yaml file,
143
166
  # true otherwise.
144
167
  def render_with_liquid?
145
- !asset_file?
168
+ !coffeescript_file?
146
169
  end
147
170
 
148
171
  # Determine whether the file should be placed into layouts.
@@ -159,7 +182,7 @@ module Jekyll
159
182
  #
160
183
  # Returns true if the layout is invalid, false if otherwise
161
184
  def invalid_layout?(layout)
162
- !data["layout"].nil? && data["layout"] != "none" && layout.nil? && !(self.is_a? Jekyll::Excerpt)
185
+ !data["layout"].nil? && layout.nil? && !(self.is_a? Jekyll::Excerpt)
163
186
  end
164
187
 
165
188
  # Recursively render layouts
@@ -205,11 +228,11 @@ module Jekyll
205
228
  info = { :filters => [Jekyll::Filters], :registers => { :site => site, :page => payload['page'] } }
206
229
 
207
230
  # render and transform content (this becomes the final content of the object)
208
- payload["highlighter_prefix"] = converter.highlighter_prefix
209
- payload["highlighter_suffix"] = converter.highlighter_suffix
231
+ payload["highlighter_prefix"] = converters.first.highlighter_prefix
232
+ payload["highlighter_suffix"] = converters.first.highlighter_suffix
210
233
 
211
234
  self.content = render_liquid(content, payload, info) if render_with_liquid?
212
- transform
235
+ self.content = transform
213
236
 
214
237
  # output keeps track of what will finally be written
215
238
  self.output = content
@@ -1,6 +1,8 @@
1
1
  module Jekyll
2
2
  module Deprecator
3
- def self.process(args)
3
+ extend self
4
+
5
+ def process(args)
4
6
  no_subcommand(args)
5
7
  arg_is_present? args, "--server", "The --server command has been replaced by the \
6
8
  'serve' subcommand."
@@ -16,36 +18,41 @@ module Jekyll
16
18
  arg_is_present? args, "--url", "The 'url' setting can only be set in your config files."
17
19
  end
18
20
 
19
- def self.no_subcommand(args)
21
+ def no_subcommand(args)
20
22
  if args.size > 0 && args.first =~ /^--/ && !%w[--help --version].include?(args.first)
21
- Jekyll.logger.error "Deprecation:", "Jekyll now uses subcommands instead of just \
23
+ deprecation_message "Jekyll now uses subcommands instead of just \
22
24
  switches. Run `jekyll --help' to find out more."
23
25
  end
24
26
  end
25
27
 
26
- def self.arg_is_present?(args, deprecated_argument, message)
28
+ def arg_is_present?(args, deprecated_argument, message)
27
29
  if args.include?(deprecated_argument)
28
30
  deprecation_message(message)
29
31
  end
30
32
  end
31
33
 
32
- def self.deprecation_message(message)
34
+ def deprecation_message(message)
33
35
  Jekyll.logger.error "Deprecation:", message
34
36
  end
35
37
 
36
- def self.gracefully_require(gem_name)
38
+ def defaults_deprecate_type(old, current)
39
+ Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'."
40
+ Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'."
41
+ end
42
+
43
+ def gracefully_require(gem_name)
37
44
  Array(gem_name).each do |name|
38
45
  begin
39
46
  require name
40
47
  rescue LoadError => e
41
48
  Jekyll.logger.error "Dependency Error:", <<-MSG
42
49
  Yikes! It looks like you don't have #{name} or one of its dependencies installed.
43
- In order to use Jekyll as currently contfigured, you'll need to install this gem.
50
+ In order to use Jekyll as currently configured, you'll need to install this gem.
44
51
 
45
52
  The full error message from Ruby is: '#{e.message}'
46
53
 
47
54
  If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
48
- MSG
55
+ MSG
49
56
  raise Errors::MissingDependencyException.new(name)
50
57
  end
51
58
  end