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.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/jekyll.rb +0 -1
- data/lib/jekyll/collection.rb +18 -3
- data/lib/jekyll/command.rb +0 -25
- data/lib/jekyll/commands/build.rb +7 -2
- data/lib/jekyll/commands/help.rb +33 -0
- data/lib/jekyll/configuration.rb +36 -28
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/jekyll/convertible.rb +43 -20
- data/lib/jekyll/deprecator.rb +15 -8
- data/lib/jekyll/document.rb +21 -4
- data/lib/jekyll/filters.rb +27 -1
- data/lib/jekyll/frontmatter_defaults.rb +46 -12
- data/lib/jekyll/plugin.rb +10 -1
- data/lib/jekyll/post.rb +6 -13
- data/lib/jekyll/related_posts.rb +2 -2
- data/lib/jekyll/renderer.rb +7 -2
- data/lib/jekyll/site.rb +5 -7
- data/lib/jekyll/static_file.rb +24 -4
- data/lib/jekyll/tags/include.rb +3 -1
- data/lib/jekyll/tags/post_url.rb +2 -2
- data/lib/jekyll/utils.rb +88 -69
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_config.yml +6 -4
- data/lib/site_template/_includes/footer.html +43 -49
- data/lib/site_template/_includes/head.html +3 -4
- data/lib/site_template/_includes/header.html +9 -10
- data/lib/site_template/_layouts/default.html +6 -5
- data/lib/site_template/_layouts/page.html +3 -3
- data/lib/site_template/_layouts/post.html +4 -4
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +6 -5
- data/lib/site_template/_sass/_base.scss +203 -0
- data/lib/site_template/_sass/_layout.scss +236 -0
- data/lib/site_template/_sass/_syntax-highlighting.scss +67 -0
- data/lib/site_template/css/main.scss +49 -0
- data/lib/site_template/feed.xml +1 -1
- data/lib/site_template/index.html +7 -4
- metadata +24 -431
- data/.gitignore +0 -15
- data/.travis.yml +0 -27
- data/CONTRIBUTING.markdown +0 -91
- data/Gemfile +0 -2
- data/History.markdown +0 -1310
- data/Rakefile +0 -268
- data/cucumber.yml +0 -3
- data/docs/jp/CONTRIBUTING.jp.markdown +0 -93
- data/docs/jp/README.jp.markdown +0 -68
- data/features/collections.feature +0 -145
- data/features/create_sites.feature +0 -158
- data/features/data.feature +0 -105
- data/features/drafts.feature +0 -46
- data/features/embed_filters.feature +0 -107
- data/features/frontmatter_defaults.feature +0 -136
- data/features/include_tag.feature +0 -68
- data/features/markdown.feature +0 -67
- data/features/pagination.feature +0 -82
- data/features/permalinks.feature +0 -85
- data/features/post_data.feature +0 -261
- data/features/post_excerpts.feature +0 -50
- data/features/rendering.feature +0 -34
- data/features/site_configuration.feature +0 -283
- data/features/site_data.feature +0 -107
- data/features/step_definitions/jekyll_steps.rb +0 -201
- data/features/support/env.rb +0 -65
- data/jekyll.gemspec +0 -66
- data/lib/site_template/css/main.css +0 -410
- data/script/bootstrap +0 -4
- data/script/branding +0 -11
- data/script/cibuild +0 -7
- data/script/console +0 -38
- data/script/proof +0 -22
- data/script/rebund +0 -140
- data/script/test +0 -17
- data/site/.gitignore +0 -4
- data/site/CNAME +0 -1
- data/site/README +0 -1
- data/site/_config.yml +0 -9
- data/site/_data/docs.yml +0 -46
- data/site/_includes/analytics.html +0 -30
- data/site/_includes/anchor_links.html +0 -32
- data/site/_includes/css/font-awesome.css +0 -44
- data/site/_includes/css/gridism.css +0 -110
- data/site/_includes/css/normalize.css +0 -1
- data/site/_includes/css/pygments.css +0 -72
- data/site/_includes/css/style.css +0 -1045
- data/site/_includes/docs_contents.html +0 -8
- data/site/_includes/docs_contents_mobile.html +0 -10
- data/site/_includes/docs_option.html +0 -11
- data/site/_includes/docs_ul.html +0 -20
- data/site/_includes/footer.html +0 -15
- data/site/_includes/header.html +0 -18
- data/site/_includes/news_contents.html +0 -33
- data/site/_includes/news_contents_mobile.html +0 -11
- data/site/_includes/news_item.html +0 -24
- data/site/_includes/primary-nav-items.html +0 -17
- data/site/_includes/section_nav.html +0 -22
- data/site/_includes/top.html +0 -17
- data/site/_layouts/default.html +0 -13
- data/site/_layouts/docs.html +0 -23
- data/site/_layouts/news.html +0 -19
- data/site/_layouts/news_item.html +0 -27
- data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +0 -23
- data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +0 -27
- data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +0 -28
- data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +0 -25
- data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +0 -27
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +0 -31
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +0 -20
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +0 -20
- data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +0 -23
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +0 -19
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
- data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
- data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
- data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +0 -20
- data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -26
- 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/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +0 -31
- data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +0 -18
- data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +0 -19
- data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +0 -31
- data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +0 -30
- data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +0 -19
- data/site/css/screen.css +0 -31
- data/site/docs/assets.md +0 -66
- data/site/docs/collections.md +0 -259
- data/site/docs/configuration.md +0 -536
- data/site/docs/continuous-integration.md +0 -177
- data/site/docs/contributing.md +0 -133
- data/site/docs/datafiles.md +0 -108
- data/site/docs/deployment-methods.md +0 -127
- data/site/docs/drafts.md +0 -21
- data/site/docs/extras.md +0 -18
- data/site/docs/frontmatter.md +0 -191
- data/site/docs/github-pages.md +0 -91
- data/site/docs/history.md +0 -1514
- data/site/docs/index.md +0 -58
- data/site/docs/installation.md +0 -106
- data/site/docs/migrations.md +0 -11
- data/site/docs/pages.md +0 -86
- data/site/docs/pagination.md +0 -212
- data/site/docs/permalinks.md +0 -188
- data/site/docs/plugins.md +0 -561
- data/site/docs/posts.md +0 -211
- data/site/docs/quickstart.md +0 -26
- data/site/docs/resources.md +0 -43
- data/site/docs/sites.md +0 -29
- data/site/docs/structure.md +0 -190
- data/site/docs/templates.md +0 -376
- data/site/docs/troubleshooting.md +0 -147
- data/site/docs/upgrading.md +0 -146
- data/site/docs/usage.md +0 -74
- data/site/docs/variables.md +0 -382
- data/site/docs/windows.md +0 -44
- data/site/favicon.ico +0 -0
- data/site/feed.xml +0 -48
- data/site/fonts/FontAwesome.otf +0 -0
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +0 -504
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/freenode.txt +0 -1
- data/site/img/article-footer.png +0 -0
- data/site/img/footer-arrow.png +0 -0
- data/site/img/footer-logo.png +0 -0
- data/site/img/jekyll-sticker.jpg +0 -0
- data/site/img/logo-2x.png +0 -0
- data/site/img/logo-rss.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/index.html +0 -90
- data/site/js/html5shiv.min.js +0 -4
- data/site/js/respond.min.js +0 -5
- data/site/news/index.html +0 -10
- data/site/news/releases/index.html +0 -10
- data/test/fixtures/broken_front_matter1.erb +0 -5
- data/test/fixtures/broken_front_matter2.erb +0 -4
- data/test/fixtures/broken_front_matter3.erb +0 -7
- data/test/fixtures/exploit_front_matter.erb +0 -4
- data/test/fixtures/front_matter.erb +0 -4
- data/test/helper.rb +0 -80
- data/test/source/+/%# +.md +0 -6
- data/test/source/+/foo.md +0 -7
- data/test/source/.htaccess +0 -8
- data/test/source/_config.dev.toml +0 -2
- data/test/source/_data/categories/dairy.yaml +0 -6
- data/test/source/_data/languages.yml +0 -2
- data/test/source/_data/members.json +0 -12
- data/test/source/_data/members.yaml +0 -7
- data/test/source/_data/products.yml +0 -4
- data/test/source/_drafts/draft-properties.text +0 -11
- data/test/source/_includes/include.html +0 -1
- data/test/source/_includes/params.html +0 -7
- data/test/source/_includes/sig.markdown +0 -3
- data/test/source/_layouts/default.html +0 -27
- data/test/source/_layouts/post/simple.html +0 -1
- data/test/source/_layouts/simple.html +0 -1
- data/test/source/_methods/_do_not_read_me.md +0 -5
- data/test/source/_methods/configuration.md +0 -8
- data/test/source/_methods/sanitized_path.md +0 -5
- data/test/source/_methods/site/_dont_include_me_either.md +0 -5
- data/test/source/_methods/site/generate.md +0 -6
- data/test/source/_methods/site/initialize.md +0 -4
- data/test/source/_methods/um_hi.md +0 -6
- data/test/source/_plugins/dummy.rb +0 -8
- data/test/source/_posts/2008-02-02-not-published.textile +0 -8
- data/test/source/_posts/2008-02-02-published.textile +0 -8
- data/test/source/_posts/2008-10-18-foo-bar.textile +0 -8
- data/test/source/_posts/2008-11-21-complex.textile +0 -8
- data/test/source/_posts/2008-12-03-permalinked-post.textile +0 -9
- data/test/source/_posts/2008-12-13-include.markdown +0 -8
- data/test/source/_posts/2009-01-27-array-categories.textile +0 -10
- data/test/source/_posts/2009-01-27-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-category.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-category.textile +0 -7
- data/test/source/_posts/2009-01-27-no-category.textile +0 -6
- data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
- data/test/source/_posts/2009-05-18-empty-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-empty-tags.textile +0 -6
- data/test/source/_posts/2009-05-18-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-tags.textile +0 -9
- data/test/source/_posts/2009-06-22-empty-yaml.textile +0 -3
- data/test/source/_posts/2009-06-22-no-yaml.textile +0 -1
- data/test/source/_posts/2010-01-08-triple-dash.markdown +0 -5
- data/test/source/_posts/2010-01-09-date-override.textile +0 -7
- data/test/source/_posts/2010-01-09-time-override.textile +0 -7
- data/test/source/_posts/2010-01-09-timezone-override.textile +0 -7
- data/test/source/_posts/2010-01-16-override-data.textile +0 -4
- data/test/source/_posts/2011-04-12-md-extension.md +0 -7
- data/test/source/_posts/2011-04-12-text-extension.text +0 -0
- data/test/source/_posts/2013-01-02-post-excerpt.markdown +0 -14
- data/test/source/_posts/2013-01-12-nil-layout.textile +0 -6
- data/test/source/_posts/2013-01-12-no-layout.textile +0 -5
- data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
- data/test/source/_posts/2013-04-11-custom-excerpt.markdown +0 -10
- data/test/source/_posts/2013-05-10-number-category.textile +0 -7
- data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +0 -23
- data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
- data/test/source/_posts/2013-12-17-include-variable-filters.markdown +0 -21
- data/test/source/_posts/2013-12-20-properties.text +0 -11
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/_posts/2014-03-03-yaml-with-dots.md +0 -5
- data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +0 -6
- data/test/source/_posts/es/2008-11-21-nested.textile +0 -8
- data/test/source/_sass/_grid.scss +0 -1
- data/test/source/_slides/example-slide-1.html +0 -4
- data/test/source/_slides/example-slide-2.html +0 -7
- data/test/source/_slides/example-slide-3.html +0 -5
- data/test/source/_with.dots/all.dots/2.4.0.md +0 -5
- data/test/source/_with.dots/file.with.dots.md +0 -0
- data/test/source/about.html +0 -6
- data/test/source/category/_posts/2008-9-23-categories.textile +0 -6
- data/test/source/contacts.html +0 -5
- data/test/source/contacts/bar.html +0 -5
- data/test/source/contacts/index.html +0 -5
- data/test/source/css/main.scss +0 -4
- data/test/source/css/screen.css +0 -76
- data/test/source/deal.with.dots.html +0 -7
- data/test/source/environment.html +0 -5
- data/test/source/exploit.md +0 -5
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +0 -8
- data/test/source/index.html +0 -22
- data/test/source/js/coffeescript.coffee +0 -10
- data/test/source/pgp.key +0 -2
- data/test/source/products.yml +0 -4
- data/test/source/properties.html +0 -8
- data/test/source/sitemap.xml +0 -32
- data/test/source/static_files.html +0 -4
- data/test/source/symlink-test/symlinked-file +0 -22
- data/test/source/unpublished.html +0 -7
- data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +0 -7
- data/test/source/z_category/_posts/2008-9-23-categories.textile +0 -6
- data/test/suite.rb +0 -11
- data/test/test_cleaner.rb +0 -77
- data/test/test_coffeescript.rb +0 -49
- data/test/test_collections.rb +0 -224
- data/test/test_command.rb +0 -53
- data/test/test_configuration.rb +0 -201
- data/test/test_convertible.rb +0 -49
- data/test/test_document.rb +0 -193
- data/test/test_draft.rb +0 -56
- data/test/test_entry_filter.rb +0 -124
- data/test/test_excerpt.rb +0 -131
- data/test/test_filters.rb +0 -207
- data/test/test_generated_site.rb +0 -97
- data/test/test_kramdown.rb +0 -62
- data/test/test_layout_reader.rb +0 -34
- data/test/test_liquid_extensions.rb +0 -31
- data/test/test_log_adapter.rb +0 -59
- data/test/test_new_command.rb +0 -104
- data/test/test_page.rb +0 -254
- data/test/test_path_sanitization.rb +0 -18
- data/test/test_post.rb +0 -741
- data/test/test_rdiscount.rb +0 -22
- data/test/test_redcarpet.rb +0 -77
- data/test/test_redcloth.rb +0 -86
- data/test/test_related_posts.rb +0 -47
- data/test/test_sass.rb +0 -26
- data/test/test_site.rb +0 -452
- data/test/test_tags.rb +0 -509
- data/test/test_url.rb +0 -28
- data/test/test_utils.rb +0 -67
data/lib/jekyll/tags/include.rb
CHANGED
@@ -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
|
19
|
+
VARIABLE_SYNTAX = /(?<variable>[^{]*\{\{\s*(?<name>[\w\-\.]+)\s*(\|.*)?\}\}[^\s}]*)(?<params>.*)/
|
18
20
|
|
19
21
|
INCLUDES_DIR = '_includes'
|
20
22
|
|
data/lib/jekyll/tags/post_url.rb
CHANGED
@@ -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 =
|
12
|
+
@date = Utils.parse_date(date, "'#{name}' does not contain valid date.")
|
13
13
|
end
|
14
14
|
|
15
15
|
def ==(other)
|
data/lib/jekyll/utils.rb
CHANGED
@@ -1,87 +1,106 @@
|
|
1
1
|
module Jekyll
|
2
2
|
module Utils
|
3
|
-
|
3
|
+
extend self
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
data/lib/jekyll/version.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# Site settings
|
2
2
|
title: Your awesome title
|
3
3
|
email: your-email@domain.com
|
4
|
-
description:
|
5
|
-
|
6
|
-
|
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="
|
3
|
+
<div class="wrapper">
|
4
4
|
|
5
5
|
<h2 class="footer-heading">{{ site.title }}</h2>
|
6
6
|
|
7
|
-
<div class="footer-col-
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
56
|
-
|
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="
|
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
|
10
|
-
|
11
|
-
<path fill="#
|
12
|
-
|
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 %}
|
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
|
-
|
6
|
+
<body>
|
7
7
|
|
8
8
|
{% include header.html %}
|
9
9
|
|
10
10
|
<div class="page-content">
|
11
|
-
<div class="
|
12
|
-
|
11
|
+
<div class="wrapper">
|
12
|
+
{{ content }}
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
|
16
16
|
{% include footer.html %}
|
17
17
|
|
18
|
-
|
19
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
|
22
22
|
|
23
|
-
[jekyll
|
24
|
-
[jekyll]:
|
23
|
+
[jekyll]: http://jekyllrb.com
|
24
|
+
[jekyll-gh]: https://github.com/jekyll/jekyll
|
25
|
+
[jekyll-help]: https://github.com/jekyll/jekyll-help
|