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
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Jekyll
2
4
  module Tags
3
5
  class IncludeTagError < StandardError
@@ -14,7 +16,7 @@ module Jekyll
14
16
  SYNTAX_EXAMPLE = "{% include file.ext param='value' param2='value' %}"
15
17
 
16
18
  VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/
17
- VARIABLE_SYNTAX = /(?<variable>\{\{\s*(?<name>[\w\-\.]+)\s*(\|.*)?\}\})(?<params>.*)/
19
+ VARIABLE_SYNTAX = /(?<variable>[^{]*\{\{\s*(?<name>[\w\-\.]+)\s*(\|.*)?\}\}[^\s}]*)(?<params>.*)/
18
20
 
19
21
  INCLUDES_DIR = '_includes'
20
22
 
@@ -7,9 +7,9 @@ module Jekyll
7
7
 
8
8
  def initialize(name)
9
9
  all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
10
- raise ArgumentError.new("'#{name}' does not contain valid date and/or title") unless all
10
+ raise ArgumentError.new("'#{name}' does not contain valid date and/or title.") unless all
11
11
  @slug = path ? path + slug : slug
12
- @date = Time.parse(date)
12
+ @date = Utils.parse_date(date, "'#{name}' does not contain valid date.")
13
13
  end
14
14
 
15
15
  def ==(other)
@@ -1,87 +1,106 @@
1
1
  module Jekyll
2
2
  module Utils
3
- class << self
3
+ extend self
4
4
 
5
- # Merges a master hash with another hash, recursively.
6
- #
7
- # master_hash - the "parent" hash whose values will be overridden
8
- # other_hash - the other hash whose values will be persisted after the merge
9
- #
10
- # This code was lovingly stolen from some random gem:
11
- # http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
12
- #
13
- # Thanks to whoever made it.
14
- def deep_merge_hashes(master_hash, other_hash)
15
- target = master_hash.dup
5
+ # Merges a master hash with another hash, recursively.
6
+ #
7
+ # master_hash - the "parent" hash whose values will be overridden
8
+ # other_hash - the other hash whose values will be persisted after the merge
9
+ #
10
+ # This code was lovingly stolen from some random gem:
11
+ # http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
12
+ #
13
+ # Thanks to whoever made it.
14
+ def deep_merge_hashes(master_hash, other_hash)
15
+ target = master_hash.dup
16
16
 
17
- other_hash.keys.each do |key|
18
- if other_hash[key].is_a? Hash and target[key].is_a? Hash
19
- target[key] = Utils.deep_merge_hashes(target[key], other_hash[key])
20
- next
21
- end
22
-
23
- target[key] = other_hash[key]
17
+ other_hash.keys.each do |key|
18
+ if other_hash[key].is_a? Hash and target[key].is_a? Hash
19
+ target[key] = Utils.deep_merge_hashes(target[key], other_hash[key])
20
+ next
24
21
  end
25
22
 
26
- target
23
+ target[key] = other_hash[key]
27
24
  end
28
25
 
29
- # Read array from the supplied hash favouring the singular key
30
- # and then the plural key, and handling any nil entries.
31
- #
32
- # hash - the hash to read from
33
- # singular_key - the singular key
34
- # plural_key - the plural key
35
- #
36
- # Returns an array
37
- def pluralized_array_from_hash(hash, singular_key, plural_key)
38
- [].tap do |array|
39
- array << (value_from_singular_key(hash, singular_key) || value_from_plural_key(hash, plural_key))
40
- end.flatten.compact
41
- end
42
-
43
- def value_from_singular_key(hash, key)
44
- hash[key] if (hash.has_key?(key) || (hash.default_proc && hash[key]))
45
- end
46
-
47
- def value_from_plural_key(hash, key)
48
- if hash.has_key?(key) || (hash.default_proc && hash[key])
49
- val = hash[key]
50
- case val
51
- when String
52
- val.split
53
- when Array
54
- val.compact
55
- end
56
- end
57
- end
26
+ target
27
+ end
28
+
29
+ # Read array from the supplied hash favouring the singular key
30
+ # and then the plural key, and handling any nil entries.
31
+ #
32
+ # hash - the hash to read from
33
+ # singular_key - the singular key
34
+ # plural_key - the plural key
35
+ #
36
+ # Returns an array
37
+ def pluralized_array_from_hash(hash, singular_key, plural_key)
38
+ [].tap do |array|
39
+ array << (value_from_singular_key(hash, singular_key) || value_from_plural_key(hash, plural_key))
40
+ end.flatten.compact
41
+ end
42
+
43
+ def value_from_singular_key(hash, key)
44
+ hash[key] if (hash.key?(key) || (hash.default_proc && hash[key]))
45
+ end
58
46
 
59
- def transform_keys(hash)
60
- result = {}
61
- hash.each_key do |key|
62
- result[yield(key)] = hash[key]
47
+ def value_from_plural_key(hash, key)
48
+ if hash.key?(key) || (hash.default_proc && hash[key])
49
+ val = hash[key]
50
+ case val
51
+ when String
52
+ val.split
53
+ when Array
54
+ val.compact
63
55
  end
64
- result
65
56
  end
57
+ end
66
58
 
67
- # Apply #to_sym to all keys in the hash
68
- #
69
- # hash - the hash to which to apply this transformation
70
- #
71
- # Returns a new hash with symbolized keys
72
- def symbolize_hash_keys(hash)
73
- transform_keys(hash) { |key| key.to_sym rescue key }
59
+ def transform_keys(hash)
60
+ result = {}
61
+ hash.each_key do |key|
62
+ result[yield(key)] = hash[key]
74
63
  end
64
+ result
65
+ end
75
66
 
76
- # Apply #to_s to all keys in the Hash
77
- #
78
- # hash - the hash to which to apply this transformation
79
- #
80
- # Returns a new hash with stringified keys
81
- def stringify_hash_keys(hash)
82
- transform_keys(hash) { |key| key.to_s rescue key }
83
- end
67
+ # Apply #to_sym to all keys in the hash
68
+ #
69
+ # hash - the hash to which to apply this transformation
70
+ #
71
+ # Returns a new hash with symbolized keys
72
+ def symbolize_hash_keys(hash)
73
+ transform_keys(hash) { |key| key.to_sym rescue key }
74
+ end
84
75
 
76
+ # Apply #to_s to all keys in the Hash
77
+ #
78
+ # hash - the hash to which to apply this transformation
79
+ #
80
+ # Returns a new hash with stringified keys
81
+ def stringify_hash_keys(hash)
82
+ transform_keys(hash) { |key| key.to_s rescue key }
85
83
  end
84
+
85
+ # Parse a date/time and throw an error if invalid
86
+ #
87
+ # input - the date/time to parse
88
+ # msg - (optional) the error message to show the user
89
+ #
90
+ # Returns the parsed date if successful, throws a FatalException
91
+ # if not
92
+ def parse_date(input, msg = "Input could not be parsed.")
93
+ Time.parse(input)
94
+ rescue ArgumentError
95
+ raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
96
+ end
97
+
98
+ # Determines whether a given file has
99
+ #
100
+ # Returns true if the YAML front matter is present.
101
+ def has_yaml_header?(file)
102
+ !!(File.open(file, 'rb') { |f| f.read(5) } =~ /\A---\r?\n/)
103
+ end
104
+
86
105
  end
87
106
  end
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -1,12 +1,14 @@
1
1
  # Site settings
2
2
  title: Your awesome title
3
3
  email: your-email@domain.com
4
- description: "Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description."
5
- baseurl: ""
6
- url: "http://yourdomain.com"
4
+ description: > # this means to ignore newlines until "baseurl:"
5
+ Write an awesome description for your new site here. You can edit this
6
+ line in _config.yml. It will appear in your document head meta (for
7
+ Google search results) and in your feed.xml site description.
8
+ baseurl: "" # the subpath of your site, e.g. /blog/
9
+ url: "http://yourdomain.com" # the base hostname & protocol for your site
7
10
  twitter_username: jekyllrb
8
11
  github_username: jekyll
9
12
 
10
13
  # Build settings
11
14
  markdown: kramdown
12
- permalink: pretty
@@ -1,59 +1,53 @@
1
1
  <footer class="site-footer">
2
2
 
3
- <div class="wrap">
3
+ <div class="wrapper">
4
4
 
5
5
  <h2 class="footer-heading">{{ site.title }}</h2>
6
6
 
7
- <div class="footer-col-1 column">
8
- <ul>
9
- <li>{{ site.title }}</li>
10
- <li><a href="mailto:{{ site.email }}">{{ site.email }}</a></li>
11
- </ul>
12
- </div>
7
+ <div class="footer-col-wrapper">
8
+ <div class="footer-col footer-col-1">
9
+ <ul class="contact-list">
10
+ <li>{{ site.title }}</li>
11
+ <li><a href="mailto:{{ site.email }}">{{ site.email }}</a></li>
12
+ </ul>
13
+ </div>
13
14
 
14
- <div class="footer-col-2 column">
15
- <ul>
16
- {% if site.github_username %}<li>
17
- <a href="https://github.com/{{ site.github_username }}">
18
- <span class="icon github">
19
- <svg version="1.1" class="github-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
20
- viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
21
- <path fill-rule="evenodd" clip-rule="evenodd" fill="#C2C2C2" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761
22
- c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32
23
- c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472
24
- c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037
25
- C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65
26
- c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261
27
- c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082
28
- c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129
29
- c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/>
30
- </svg>
31
- </span>
32
- <span class="username">{{ site.github_username }}</span>
33
- </a>
34
- </li>{% endif %}
35
- {% if site.twitter_username %}<li>
36
- <a href="https://twitter.com/{{ site.twitter_username }}">
37
- <span class="icon twitter">
38
- <svg version="1.1" class="twitter-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
39
- viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
40
- <path fill="#C2C2C2" d="M15.969,3.058c-0.586,0.26-1.217,0.436-1.878,0.515c0.675-0.405,1.194-1.045,1.438-1.809
41
- c-0.632,0.375-1.332,0.647-2.076,0.793c-0.596-0.636-1.446-1.033-2.387-1.033c-1.806,0-3.27,1.464-3.27,3.27
42
- c0,0.256,0.029,0.506,0.085,0.745C5.163,5.404,2.753,4.102,1.14,2.124C0.859,2.607,0.698,3.168,0.698,3.767
43
- c0,1.134,0.577,2.135,1.455,2.722C1.616,6.472,1.112,6.325,0.671,6.08c0,0.014,0,0.027,0,0.041c0,1.584,1.127,2.906,2.623,3.206
44
- C3.02,9.402,2.731,9.442,2.433,9.442c-0.211,0-0.416-0.021-0.615-0.059c0.416,1.299,1.624,2.245,3.055,2.271
45
- c-1.119,0.877-2.529,1.4-4.061,1.4c-0.264,0-0.524-0.015-0.78-0.046c1.447,0.928,3.166,1.469,5.013,1.469
46
- c6.015,0,9.304-4.983,9.304-9.304c0-0.142-0.003-0.283-0.009-0.423C14.976,4.29,15.531,3.714,15.969,3.058z"/>
47
- </svg>
48
- </span>
49
- <span class="username">{{ site.twitter_username }}</span>
50
- </a>
51
- </li>{% endif %}
52
- </ul>
53
- </div>
15
+ <div class="footer-col footer-col-2">
16
+ <ul class="social-media-list">
17
+ {% if site.github_username %}
18
+ <li>
19
+ <a href="https://github.com/{{ site.github_username }}">
20
+ <span class="icon icon--github">
21
+ <svg viewBox="0 0 16 16">
22
+ <path fill="#828282" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761 c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32 c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472 c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037 C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65 c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261 c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082 c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129 c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/>
23
+ </svg>
24
+ </span>
25
+
26
+ <span class="username">{{ site.github_username }}</span>
27
+ </a>
28
+ </li>
29
+ {% endif %}
30
+
31
+ {% if site.twitter_username %}
32
+ <li>
33
+ <a href="https://twitter.com/{{ site.twitter_username }}">
34
+ <span class="icon icon--twitter">
35
+ <svg viewBox="0 0 16 16">
36
+ <path fill="#828282" d="M15.969,3.058c-0.586,0.26-1.217,0.436-1.878,0.515c0.675-0.405,1.194-1.045,1.438-1.809
37
+ c-0.632,0.375-1.332,0.647-2.076,0.793c-0.596-0.636-1.446-1.033-2.387-1.033c-1.806,0-3.27,1.464-3.27,3.27 c0,0.256,0.029,0.506,0.085,0.745C5.163,5.404,2.753,4.102,1.14,2.124C0.859,2.607,0.698,3.168,0.698,3.767 c0,1.134,0.577,2.135,1.455,2.722C1.616,6.472,1.112,6.325,0.671,6.08c0,0.014,0,0.027,0,0.041c0,1.584,1.127,2.906,2.623,3.206 C3.02,9.402,2.731,9.442,2.433,9.442c-0.211,0-0.416-0.021-0.615-0.059c0.416,1.299,1.624,2.245,3.055,2.271 c-1.119,0.877-2.529,1.4-4.061,1.4c-0.264,0-0.524-0.015-0.78-0.046c1.447,0.928,3.166,1.469,5.013,1.469 c6.015,0,9.304-4.983,9.304-9.304c0-0.142-0.003-0.283-0.009-0.423C14.976,4.29,15.531,3.714,15.969,3.058z"/>
38
+ </svg>
39
+ </span>
40
+
41
+ <span class="username">{{ site.twitter_username }}</span>
42
+ </a>
43
+ </li>
44
+ {% endif %}
45
+ </ul>
46
+ </div>
54
47
 
55
- <div class="footer-col-3 column">
56
- <p class="text">{{ site.description }}</p>
48
+ <div class="footer-col footer-col-3">
49
+ <p class="text">{{ site.description }}</p>
50
+ </div>
57
51
  </div>
58
52
 
59
53
  </div>
@@ -1,12 +1,11 @@
1
1
  <head>
2
2
  <meta charset="utf-8">
3
+ <meta name="viewport" content="width=device-width">
3
4
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
+
4
6
  <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
5
- <meta name="viewport" content="width=device-width">
6
7
  <meta name="description" content="{{ site.description }}">
7
- <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
8
8
 
9
- <!-- Custom CSS -->
10
9
  <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
11
-
10
+ <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
12
11
  </head>
@@ -1,24 +1,23 @@
1
1
  <header class="site-header">
2
2
 
3
- <div class="wrap">
3
+ <div class="wrapper">
4
4
 
5
5
  <a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>
6
6
 
7
7
  <nav class="site-nav">
8
8
  <a href="#" class="menu-icon">
9
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
10
- viewBox="0 0 18 15" enable-background="new 0 0 18 15" xml:space="preserve">
11
- <path fill="#505050" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0
12
- h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
13
- <path fill="#505050" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484
14
- h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
15
- <path fill="#505050" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0
16
- c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
9
+ <svg viewBox="0 0 18 15">
10
+ <path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
11
+ <path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
12
+ <path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
17
13
  </svg>
18
14
  </a>
15
+
19
16
  <div class="trigger">
20
17
  {% for page in site.pages %}
21
- {% if page.title %}<a class="page-link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>{% endif %}
18
+ {% if page.title %}
19
+ <a class="page-link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
20
+ {% endif %}
22
21
  {% endfor %}
23
22
  </div>
24
23
  </nav>
@@ -3,17 +3,18 @@
3
3
 
4
4
  {% include head.html %}
5
5
 
6
- <body>
6
+ <body>
7
7
 
8
8
  {% include header.html %}
9
9
 
10
10
  <div class="page-content">
11
- <div class="wrap">
12
- {{ content }}
11
+ <div class="wrapper">
12
+ {{ content }}
13
13
  </div>
14
14
  </div>
15
15
 
16
16
  {% include footer.html %}
17
17
 
18
- </body>
19
- </html>
18
+ </body>
19
+
20
+ </html>
@@ -4,11 +4,11 @@ layout: default
4
4
  <div class="post">
5
5
 
6
6
  <header class="post-header">
7
- <h1>{{ page.title }}</h1>
7
+ <h1 class="post-title">{{ page.title }}</h1>
8
8
  </header>
9
9
 
10
10
  <article class="post-content">
11
- {{ content }}
11
+ {{ content }}
12
12
  </article>
13
13
 
14
- </div>
14
+ </div>
@@ -4,12 +4,12 @@ layout: default
4
4
  <div class="post">
5
5
 
6
6
  <header class="post-header">
7
- <h1>{{ page.title }}</h1>
8
- <p class="meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
7
+ <h1 class="post-title">{{ page.title }}</h1>
8
+ <p class="post-meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
9
9
  </header>
10
10
 
11
11
  <article class="post-content">
12
- {{ content }}
12
+ {{ content }}
13
13
  </article>
14
14
 
15
- </div>
15
+ </div>
@@ -4,9 +4,9 @@ title: "Welcome to Jekyll!"
4
4
  date: <%= Time.now.strftime('%Y-%m-%d %H:%M:%S') %>
5
5
  categories: jekyll update
6
6
  ---
7
+ You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve --watch`, which launches a web server and auto-regenerates your site when a file is updated.
7
8
 
8
- You'll find this post in your `_posts` directory - edit this post and re-build (or run with the `-w` switch) to see your changes!
9
- To add new posts, simply add a file in the `_posts` directory that follows the convention: YYYY-MM-DD-name-of-post.ext.
9
+ To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
10
10
 
11
11
  Jekyll also offers powerful support for code snippets:
12
12
 
@@ -18,7 +18,8 @@ print_hi('Tom')
18
18
  #=> prints 'Hi, Tom' to STDOUT.
19
19
  {% endhighlight %}
20
20
 
21
- Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll's GitHub repo][jekyll-gh].
21
+ Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekylls GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
22
22
 
23
- [jekyll-gh]: https://github.com/jekyll/jekyll
24
- [jekyll]: http://jekyllrb.com
23
+ [jekyll]: http://jekyllrb.com
24
+ [jekyll-gh]: https://github.com/jekyll/jekyll
25
+ [jekyll-help]: https://github.com/jekyll/jekyll-help