Compare commits

...

276 Commits

Author SHA1 Message Date
Parker Moore
1c5399b947 Benchmark cached includes.
Calculating -------------------------------------
              cached       634 i/100ms
            uncached       543 i/100ms
-------------------------------------------------
              cached     6570.6 (±3.0%) i/s -      32968 in   5.022063s
            uncached     5613.0 (±2.1%) i/s -      28236 in   5.032667s
2015-01-08 11:30:24 -08:00
Parker Moore
0d6064b1a1 add benchmark-ips to BENCHMARK gemfile 2015-01-08 11:22:35 -08:00
Parker Moore
32ff033f9f Add a cache for the includes.
https://github.com/jekyll/jekyll/issues/3202
2015-01-08 11:13:18 -08:00
Parker Moore
d47b882af2 Update history to reflect merge of #3264 [ci skip] 2015-01-07 14:27:17 -08:00
Parker Moore
2f4e5fa28b Merge pull request #3264 from tkrotoff/fix-nav-items-gaps 2015-01-07 14:25:59 -08:00
Tanguy Krotoff
c4d617e6aa Fix nav items alignment when on multiple lines 2015-01-07 12:30:48 +01:00
Parker Moore
f95d0ba840 Update history to reflect merge of #3172 [ci skip] 2015-01-05 23:19:47 -08:00
Parker Moore
502fd94f2c Merge pull request #3172 from alfredxing/docs-output-overrides 2015-01-05 23:19:12 -08:00
Alfred Xing
c58ac78a5e Expose Publisher in Site 2015-01-05 16:13:04 -08:00
Alfred Xing
7655b533c9 Allow documents to set published in front matter 2015-01-05 16:11:02 -08:00
Parker Moore
620115a986 Update history to reflect merge of #3261 [ci skip] 2015-01-05 00:08:08 -08:00
Parker Moore
1ca06e70d3 Merge branch 'master' of github.com:jekyll/jekyll
* 'master' of github.com:jekyll/jekyll:
  Use FileList instead of Dir.glob
2015-01-05 00:07:39 -08:00
Parker Moore
919d37fb37 Merge pull request #3261 from flyinprogrammer/master 2015-01-05 00:07:35 -08:00
Parker Moore
f7dafb1f04 Update history to reflect merge of #3255 [ci skip] 2015-01-05 00:06:51 -08:00
Parker Moore
6504645c60 Merge pull request #3255 from XhmikosR/readme-badges 2015-01-05 00:06:01 -08:00
Alan Scherger
fc0ea20a85 Use FileList instead of Dir.glob 2015-01-04 20:46:43 -08:00
XhmikosR
b20a175c27 Switch to shields.io for the README badges.
This way we have consistent badges.

[ci skip]
2015-01-04 13:13:16 +02:00
Parker Moore
2f06f4aad7 Update history to reflect merge of #3254 [ci skip] 2015-01-03 23:06:17 -08:00
Parker Moore
ff3fa84b8a Merge pull request #3254 from flyinprogrammer/master 2015-01-03 23:05:57 -08:00
Alan Scherger
7f370cb82f Update rake task site:publish to fix minor bugs.
*  Automate creating gh-pages directory
*  Ensure gh-pages dir always has correct branch checked out
*  Purge gh-pages of files so that a sync of site truly occurs
*  Ensure dot files are synced
*  Be exact with our exclusions to eliminate guess work
2015-01-03 19:50:33 -08:00
Matt Rogers
51951c43e8 Update history to reflect merge of #3253 [ci skip] 2015-01-03 09:49:54 -06:00
Matt Rogers
a88f2567f7 Merge pull request #3253 from SuriyaaKudoIsc/master 2015-01-03 09:49:51 -06:00
Suriyaa Kudo
d159684f87 Update LICENSE 2015-01-03 11:59:24 +01:00
Matt Rogers
d29dd11ae3 Update history to reflect merge of #3233 [ci skip] 2015-01-02 13:39:01 -06:00
Matt Rogers
8d968ebae0 Merge pull request #3233 from jessepinho/punctuation-fixes 2015-01-02 13:38:58 -06:00
Matt Rogers
86f7196ef5 Update history to reflect merge of #3251 [ci skip] 2015-01-02 13:27:10 -06:00
Matt Rogers
064d6de48d Merge pull request #3251 from nternetinspired/article-semantics 2015-01-02 13:27:07 -06:00
Seth Warburton
21bd3e6c5a [imp] Semantic structure improvements 2015-01-02 12:14:58 +00:00
Jesse Pinho
07bd3a3759 Clarify paragraph on the return value of generate 2015-01-01 23:58:40 -06:00
Parker Moore
e40e12fabd Update history to reflect merge of #3234 [ci skip] 2014-12-29 20:49:25 -05:00
Parker Moore
a098dc80cd Merge pull request #3234 from jekyll/ruby-2-2 2014-12-29 20:49:04 -05:00
Parker Moore
419aaba07c Update history to reflect merge of #3244 [ci skip] 2014-12-29 20:48:31 -05:00
Parker Moore
7cd5847826 Merge pull request #3244 from jekyll/store-messages 2014-12-29 20:48:23 -05:00
Parker Moore
9109da32f9 Update test for the date() Liquid filter. 2014-12-29 20:44:10 -05:00
Parker Moore
7bcf8d689e Always call Time#localtime to translate to TZ'd time. 2014-12-29 20:12:35 -05:00
Parker Moore
f66862c508 Install rake if the lib isn't there; upgrade to cucumber 1.3.18 2014-12-29 18:40:53 -05:00
Parker Moore
cb95a72f5a Update history to reflect merge of #2924 [ci skip] 2014-12-29 18:00:54 -05:00
Parker Moore
9b81f29625 Merge pull request #2924 from nitoyon/unescape-document 2014-12-29 18:00:44 -05:00
nitoyon
5e10958faa Unescape Document output path
Document#destination wasn't unescaped properly.

For example, when we have a document named '_langs/c#.md',
we expect its url to be '/langs/c#.html',
but it was actually '/langs/c%23.html'.

We now unecape URL at Document#destination like Post#destination and
Page#destination.
2014-12-29 22:38:50 +09:00
Parker Moore
7f034f51e3 Improvments to script/stackprof. [ci skip] 2014-12-29 02:16:04 -05:00
Parker Moore
1fc99bdd97 Test LogAdapter#messages 2014-12-29 01:21:01 -05:00
Parker Moore
7fc47bfc43 Initialize @messages at instantiation time. 2014-12-29 01:14:16 -05:00
Parker Moore
b2146e8659 Store log messages in an array of messages. 2014-12-29 01:14:16 -05:00
Parker Moore
e0a011c917 Update history to reflect merge of #3185 [ci skip] 2014-12-29 00:52:47 -05:00
Parker Moore
63ec07a062 Merge pr #3185.
add link to tutorial on building dynamic navbars

Conflicts:
	site/_docs/resources.md
2014-12-29 00:51:47 -05:00
Parker Moore
5f03314d85 Update history to reflect merge of #3186 [ci skip] 2014-12-29 00:50:57 -05:00
Parker Moore
442deb6a7e Merge pull request #3186 from eduardoboucas/master 2014-12-29 00:50:24 -05:00
Parker Moore
d7d7d924f7 Update history to reflect merge of #3189 [ci skip] 2014-12-29 00:50:12 -05:00
Parker Moore
35a5af783a Merge pull request #3189 from robschia/patch-1 2014-12-29 00:49:40 -05:00
Parker Moore
a6781bda30 Always, always rebuild (by default) in tests. 2014-12-29 00:37:16 -05:00
Parker Moore
bab7ef4b1d Use backticks here. [ci skip]. 2014-12-29 00:32:14 -05:00
Parker Moore
6f7ea381b3 Update history to reflect merge of #3047 [ci skip] 2014-12-29 00:31:53 -05:00
Parker Moore
612eb737a5 Merge pull request #3047 from karouf/slugify-non-latin 2014-12-29 00:31:34 -05:00
Parker Moore
191c2279d2 Update history to reflect merge of #2908 [ci skip] 2014-12-29 00:26:58 -05:00
Parker Moore
e39dfa3f0b Merge pull request #2908 from alfredxing/document-path 2014-12-29 00:26:35 -05:00
Parker Moore
5af7694f3b Update history to reflect merge of #2790 [ci skip] 2014-12-29 00:23:57 -05:00
Parker Moore
6e5850c6ab Merge PR #2790.
Add jekyll-thumbnail-filter to plugins list
2014-12-29 00:22:55 -05:00
Parker Moore
be23e18555 Say 'since 2.0' 2014-12-28 23:54:03 -05:00
Parker Moore
928be16fab Add Ruby 2.2 to Travis build matrix. 2014-12-28 23:40:32 -05:00
Parker Moore
eac3ac095f Update history to reflect merge of #3240 [ci skip] 2014-12-28 23:36:37 -05:00
Parker Moore
aa4beda868 Merge pull request #3240 from jekyll/snake_case 2014-12-28 23:36:08 -05:00
Parker Moore
1fad3a074f Update history to reflect merge of #3241 [ci skip] 2014-12-28 23:35:54 -05:00
Parker Moore
0fe2094dd2 Merge pull request #3241 from jekyll/separate-jekyll-docs 2014-12-28 23:35:36 -05:00
Parker Moore
c576d23908 Use External instead of Deprecator for requiring gracefully 2014-12-28 14:37:49 -05:00
Parker Moore
8c19a6f430 Print an error message in bin/jekyll with no arguments 2014-12-28 14:37:14 -05:00
Parker Moore
ac41312c5d Separate jekyll-docs out into a separate gem & bless it 2014-12-28 14:37:02 -05:00
Parker Moore
232a58d5b4 Fix test use of Site#getConverterImpl. 2014-12-28 14:14:24 -05:00
Parker Moore
0c0aea3ad7 Improve Site#getConverterImpl and call it Site#find_converter_instance 2014-12-28 14:12:09 -05:00
Parker Moore
657b16519e Update history to reflect merge of #3204 [ci skip] 2014-12-26 23:10:21 -05:00
Parker Moore
f81601ee53 Merge pull request #3204 from jekyll/sort-static-files-once 2014-12-26 23:05:04 -05:00
Parker Moore
b6641be8ef Call it site_payload instead of payload. 2014-12-26 22:40:18 -05:00
Parker Moore
a8ec9cd507 Put the development dependencies in the Gemfile directly. 2014-12-26 22:37:56 -05:00
Parker Moore
2f8248a6f1 Only call #site_payload once for all collection work. 2014-12-26 22:24:18 -05:00
Parker Moore
0eb2796a66 Sort static files just once.
Ref: #2075.
2014-12-26 22:23:45 -05:00
Parker Moore
e120c255ff Update history to reflect merge of #3237 [ci skip] 2014-12-26 22:22:36 -05:00
Parker Moore
990a9e6e6d Merge pull request #3237 from jekyll/enable_coderay 2014-12-26 22:22:15 -05:00
Parker Moore
c24c6b7f3d Use 'enable_coderay' in the tests. 2014-12-26 22:17:33 -05:00
Parker Moore
039c521e8c Update the documentation. 2014-12-26 22:17:07 -05:00
Parker Moore
d35af9c1f3 Read 'enable_coderay' in the Kramdown parser 2014-12-26 22:16:57 -05:00
Parker Moore
f6bff6fb61 Have a deprecation fallback for 'use_coderay' 2014-12-26 22:16:47 -05:00
Parker Moore
a103898980 Set 'use_coderay' to 'enable_coderay' 2014-12-26 22:16:33 -05:00
Parker Moore
3957efac15 Update history to reflect merge of #3002 [ci skip] 2014-12-26 22:00:45 -05:00
Parker Moore
38309569c4 Merge pull request #3002 from jekyll/liquid-3 2014-12-26 22:00:33 -05:00
Parker Moore
8bfc696569 liquid-c 0.0.3 2014-12-26 21:53:56 -05:00
Parker Moore
b68dd3a5cb Add liquid c if it's available. 2014-12-26 21:53:56 -05:00
Parker Moore
3940e1e9df Bump to Liquid 3.0 2014-12-26 21:53:56 -05:00
Parker Moore
70a331d854 Set the error mode to :strict 2014-12-26 21:53:56 -05:00
Parker Moore
5bf1596414 Refactor Highlight tag tests to use a helper method to create the tag. 2014-12-26 21:53:56 -05:00
Parker Moore
3234041510 Update history to reflect merge of #3235 [ci skip] 2014-12-26 16:46:57 -05:00
Parker Moore
37631eefac Merge pull request #3235 from jekyll/drop-ruby-1-9 2014-12-26 16:46:38 -05:00
Parker Moore
82b1ad0552 Update history to reflect merge of #3236 [ci skip] 2014-12-26 16:35:56 -05:00
Parker Moore
2c2347fac1 Merge pull request #3236 from tkrotoff/remove-end-tag 2014-12-26 16:35:33 -05:00
Tanguy Krotoff
0aa61f66a8 Remove unneeded end tag 2014-12-26 12:10:03 +01:00
Jesse Pinho
b1a517ccb6 Remove unnecessary 'where' 2014-12-25 18:29:50 -06:00
Jesse Pinho
4070143d5b Tweak sentence structure 2014-12-25 15:17:21 -06:00
Parker Moore
6e4e290ab0 Requires >= 2.0.0 2014-12-25 16:11:14 -05:00
Parker Moore
d6995d347a Drop support for Ruby 1.9.3. 2014-12-25 16:00:59 -05:00
Jesse Pinho
52085d2e34 Fix a few punctuation errors 2014-12-24 17:01:51 -06:00
Parker Moore
f3a274377a Update history to reflect merge of #3229 [ci skip] 2014-12-23 16:49:43 -05:00
Parker Moore
0fcba080c3 Merge pull request #3229 from megalomono/master 2014-12-23 16:49:25 -05:00
Fonso
922ba5d0ea Fixing the default host on docs 2014-12-23 13:26:08 +01:00
Parker Moore
cb2eea0e41 Release 💎 2.5.3 2014-12-22 09:16:40 -05:00
Parker Moore
8284714d8a Release 💎 2.5.3 2014-12-22 09:15:57 -05:00
Parker Moore
aaf6f28fde Update history to reflect merge of #3116 [ci skip] 2014-12-22 08:58:29 -05:00
Parker Moore
7227ad4ebb Merge pull request #3116 from alfredxing/incremental 2014-12-22 08:57:50 -05:00
Parker Moore
c3e47437a3 Update history to reflect merge of #3222 [ci skip] 2014-12-20 10:45:15 -08:00
Parker Moore
76301722e9 Merge pull request #3222 from jasonbellamy/jekyll-mermaid-plugin 2014-12-20 10:44:47 -08:00
Jason Bellamy
d05df326b9 Add jekyll-mermaid to the list of plugins. 2014-12-19 22:55:40 -05:00
Parker Moore
dc12bd3023 Update history to reflect merge of #3218 [ci skip] 2014-12-18 23:03:27 -08:00
Parker Moore
878c689f76 Merge pull request #3218 from jekyll/alfredxing 2014-12-18 23:02:48 -08:00
Parker Moore
68a7ebf2ee Add @alfredxing to the @jekyll/core team. 2014-12-18 23:01:16 -08:00
Parker Moore
63ed335463 Update history to reflect merge of #3212 [ci skip] 2014-12-17 19:00:57 -08:00
Parker Moore
fe14434f8d Merge pull request #3212 from bdesham/add-inline-highlight-plugin 2014-12-17 18:59:22 -08:00
Benjamin Esham
a069ad77c0 Add link to inline_highlight plugin 2014-12-14 15:36:59 -05:00
Parker Moore
5343fc3b54 Update history to reflect merge of #3196 [ci skip] 2014-12-09 18:10:02 -08:00
Parker Moore
2dad0d3304 Merge pull request #3196 from jekyll/site-troubleshooting-updates 2014-12-09 18:09:16 -08:00
Joel Glovier
f789168522 use rake instructions instead 2014-12-09 20:45:01 -05:00
Parker Moore
7656b9d295 Update history to reflect merge of #3198 [ci skip] 2014-12-09 10:55:08 -08:00
Parker Moore
176dc3cef7 Merge pull request #3198 from mehdisadeghi/master 2014-12-09 10:54:19 -08:00
Parker Moore
360412364e Update history to reflect merge of #3158 [ci skip] 2014-12-09 10:51:11 -08:00
Parker Moore
49115dbdab Merge pull request #3158 from afeld/as-liquid-refactor 2014-12-09 10:50:42 -08:00
Aidan Feldman
383a0d0aa7 modify as_liquid to use case statement 2014-12-09 07:42:14 -05:00
Mehdi Sadeghi
b735170ceb Jekyll-jalali plugin added to the plugins list. 2014-12-09 12:44:50 +01:00
robschia
59acdaab9a Fixed itemprop="author name"
You are right, I tried to oversimplify it. Also, {{ page.date | %Y-%m-%d }} doesn't output what I expected. I think it's fixed now, I tried the code with a couple of validators and everything seems fine.
2014-12-08 19:46:49 +01:00
Joel Glovier
12651c19e5 further clarify local dev steps 2014-12-08 10:15:25 -05:00
Joel Glovier
1694f8609c update site dir readme
Add some helpful info to the readme.
2014-12-08 10:08:54 -05:00
Joel Glovier
e80469b7b0 add in page nav to troubleshooting file 2014-12-08 10:08:13 -05:00
Parker Moore
032139bd2f Ensure only one converter is found for .Rmd in the tests. Ref: #3147. 2014-12-07 16:08:16 -08:00
Parker Moore
6deed4c66b Update history to reflect merge of #3180 [ci skip] 2014-12-07 15:38:45 -08:00
Parker Moore
253bcc2faf Merge pull request #3180 from jekyll/fix-coverage-reporting 2014-12-07 15:38:03 -08:00
Alfred Xing
43a28aed96 Fix indentation 2014-12-05 19:38:43 -08:00
Alfred Xing
5d9662f80f Always regenerate asset files 2014-12-05 19:07:18 -08:00
robschia
ed9cc80ff9 Update post.html 2014-12-06 00:49:04 +01:00
robschia
9b6eeba81e Added basic microdata 2014-12-06 00:32:05 +01:00
Eduardo Boucas
40e4c031e3 Add site to Resources page 2014-12-05 12:36:34 +00:00
Jordan Thornquest
f80dc07f82 add link to tutorial on building dynamic navbars 2014-12-04 21:54:02 -07:00
Alfred Xing
52f0b36558 Add incremental rebuild info to build command output 2014-12-04 20:09:49 -08:00
Matt Rogers
f8af94431d Fix coverage reporting for built-in bundles 2014-12-02 20:50:39 -06:00
Parker Moore
89bdd47ebc Update history to reflect merge of #3176 [ci skip] 2014-12-02 14:23:45 -08:00
Parker Moore
2c85f4ef24 Merge pull request #3176 from rud/bugfix/site-feed-is-rss 2014-12-02 14:23:02 -08:00
Laust Rud Jacobsen
c8fc567c8d Site /feed.xml is RSS 2.0, fix auto-discovery header
Refs #2996
2014-12-02 22:40:22 +01:00
Parker Moore
460dd81fe1 Update history to reflect merge of #3177 [ci skip] 2014-12-01 14:41:42 -08:00
Parker Moore
7c8c41f0d7 Merge pull request #3177 from rpherbig/master 2014-12-01 14:41:14 -08:00
Robert Herbig
3b57879e71 Simplified platform detection for Windows 2014-12-01 05:40:07 -06:00
Parker Moore
19527b47ab Update history to reflect merge of #3170 [ci skip] 2014-11-30 15:17:43 -08:00
Parker Moore
8298733e67 Merge pull request #3170 from tkrotoff/fix-viewport 2014-11-30 15:16:51 -08:00
Tanguy Krotoff
64b0102686 Fix viewport meta tag 2014-11-29 12:30:43 +01:00
Parker Moore
bfab00a65a Update history to reflect merge of #3163 [ci skip] 2014-11-28 21:38:49 -08:00
Parker Moore
fea79dcbab Merge pull request #3163 from lkorth/patch-1 2014-11-28 21:38:27 -08:00
Parker Moore
b4bc3b0aa0 Update history to reflect merge of #3161 [ci skip] 2014-11-28 21:38:15 -08:00
Parker Moore
ac7f592839 Merge pull request #3161 from dnozay/patch-3 2014-11-28 21:32:23 -08:00
Parker Moore
4ccf9ea683 Update history to reflect merge of #3162 [ci skip] 2014-11-28 21:27:32 -08:00
Parker Moore
7de9433fbc Merge pull request #3162 from dnozay/patch-4 2014-11-28 21:27:07 -08:00
Parker Moore
9c8acdd3ea Update history to reflect merge of #3165 [ci skip] 2014-11-28 21:22:58 -08:00
Parker Moore
e9904fd44b Merge pull request #3165 from fabschurt/fix-doc-typos 2014-11-28 21:22:32 -08:00
Damien Nozay
ba9a309572 Update configuration.md
`keep_files` is a very useful option when using tools such as `grunt-build-control`, `grunt`, `gulp` or `yeoman`.
2014-11-28 21:09:08 -08:00
Alfred Xing
d0e12d69bc Last few revisions 2014-11-28 14:05:40 -08:00
Fabien Schurter
75cf2d73f6 Fix erroneous 'next_section' value
According to /site/_data/docs.yml, the document next to
'deployment-methods' is 'continuous-integration', not 'troubleshooting'
(the 'prev_section' value in 'troubleshooting' is correctly set to
'deployment-methods' though).
2014-11-28 04:26:22 +01:00
Fabien Schurter
974fab6c9c Fix a typo
Replaced "capaibilities" with correct spelling: "capabilities".
2014-11-28 04:14:26 +01:00
Luke Korth
2a37f459d4 Add jekyll-500px-embed to tag plugins 2014-11-27 16:35:23 -08:00
Damien Nozay
5a554572e3 Update configuration.md
repeat warning about `destination` that is found in <http://jekyllrb.com/docs/usage/>
(see also pull request #3159)
2014-11-27 15:11:28 -08:00
Alfred Xing
a701e59c07 Add lots more unit tests 2014-11-27 10:40:31 -08:00
Alfred Xing
b6d81c58df Perform less expensive operation first 2014-11-27 10:00:29 -08:00
Aidan Feldman
4776b27ff3 reduce nesting of #as_liquid 2014-11-27 04:20:05 -06:00
Aidan Feldman
87d08ec827 refactor #as_liquid 2014-11-27 04:16:29 -06:00
Aidan Feldman
229303bbc8 compare resulting data in jsonify test 2014-11-27 04:01:31 -06:00
Parker Moore
8603738a89 Update history to reflect merge of #3154 [ci skip] 2014-11-27 01:14:35 -08:00
Parker Moore
932cd3b575 Merge pull request #3154 from afeld/jsonify-bool 2014-11-27 01:14:04 -08:00
Alfred Xing
02f281eef3 Add unit and cucumber tests 2014-11-26 21:15:53 -08:00
Alfred Xing
8a257aca6b Implement more suggestions 2014-11-26 20:15:42 -08:00
Parker Moore
588f21f5cd Compress SCSS when pushing to jekyllrb.com.
Fixes #3153.
Rel: #3145.
Since d26202936e.
2014-11-26 11:32:09 -08:00
Aidan Feldman
0662d31bf6 fix jsonify filter when used with boolean values 2014-11-26 02:40:41 -06:00
Matt Rogers
a6f8b6c7d6 Update history to reflect merge of #3149 [ci skip] 2014-11-25 12:34:38 -06:00
Matt Rogers
e51f94a038 Merge pull request #3149 from jekyll/document-build-serve-quiet-option 2014-11-25 12:34:34 -06:00
Parker Moore
1aa5c7a820 Update history to reflect merge of #3147 [ci skip] 2014-11-25 10:21:03 -08:00
Parker Moore
37af23b5d7 Merge pull request #3147 from blbradley/markdown-file-ext-regexp 2014-11-25 10:20:27 -08:00
Matt Rogers
df87a51ade Expand the description for the -q option. 2014-11-25 08:40:37 -06:00
Ruslan Korolev
2a138e4ca9 jekyll build/serve -q option to docs 2014-11-25 08:21:08 -06:00
Brandon Bradley
e546eb3e9f force markdown regexp to match the full extension 2014-11-24 20:08:31 -06:00
Brandon Bradley
d250efccb9 add test for broken markdown regexp 2014-11-24 19:56:26 -06:00
Alfred Xing
dc30114605 Use site.in_source_dir 2014-11-23 16:16:19 -08:00
Alfred Xing
2a5cf11ee2 Add --no-metadata option 2014-11-23 15:38:00 -08:00
Parker Moore
e23a74aad9 Release 💎 2.5.2 2014-11-23 15:02:08 -08:00
Parker Moore
5b77d02e3b Merge pull request #3141 from jekyll/bundle-require-is-borking-pygments
Fix Bundler-integration Plugin Manager
2014-11-23 14:18:06 -08:00
Parker Moore
c2b24e82e5 Refactor the case statement in highlighter for better readability. [ci skip] 2014-11-23 14:17:21 -08:00
Parker Moore
10030ae8cd Put that Bundle.require statement back. 2014-11-23 14:13:47 -08:00
Alfred Xing
75c5c16297 Handle path overrides 2014-11-23 14:06:29 -08:00
Parker Moore
ef53e677a4 Better tests for plugin manager. 2014-11-23 13:14:51 -08:00
Parker Moore
03d9396b85 Capture the output of Jekyll::Commands::New when looking for an error. 2014-11-23 12:53:36 -08:00
Alfred Xing
4acf343fea Add clean command 2014-11-23 12:51:19 -08:00
Parker Moore
665178d210 Merge pull request #3117 from jekyll/release-2-5-2 2014-11-23 12:39:58 -08:00
Parker Moore
b1bba1945a Prepare for a v2.5.2 release. 2014-11-22 15:37:07 -08:00
Parker Moore
8ed6c7b077 Update history to reflect merge of #3119 [ci skip] 2014-11-22 14:27:06 -08:00
Parker Moore
9a94829bcb Merge pull request #3119 from jekyll/fix-bundle-require 2014-11-22 14:25:07 -08:00
Parker Moore
d17b80bf2a Keep track of the required gems. 2014-11-22 12:38:36 -08:00
Alfred Xing
ac03af3229 Implement @mattr-'s suggestions 2014-11-21 22:12:21 -08:00
Alfred Xing
fe6bfc6f1b Fix failing tests 2014-11-21 22:12:21 -08:00
Alfred Xing
d438362971 Add regenerate front-matter variable 2014-11-21 22:12:21 -08:00
Alfred Xing
842470b0c4 Refinements 2014-11-21 22:12:21 -08:00
Alfred Xing
11917645f2 Incremental regeneration 2014-11-21 22:12:20 -08:00
Parker Moore
cb8a4b4d62 Update history to reflect merge of #3136 [ci skip] 2014-11-21 10:09:54 -08:00
Parker Moore
a75ed0b33d Merge pull request #3136 from knorthfield/patch-1 2014-11-21 10:09:10 -08:00
Kris Northfield
58511822e6 Add remote-include plugin to list 2014-11-21 17:37:54 +00:00
Parker Moore
876253edce Add Slack build notifications. 2014-11-20 20:50:47 -08:00
Parker Moore
0f669ba9b1 Update history to reflect merge of #3132 [ci skip] 2014-11-20 12:37:27 -08:00
Parker Moore
a9a21e6572 Merge pull request #3132 from XhmikosR/gridism 2014-11-20 12:37:06 -08:00
Parker Moore
3b05b0d867 Update history to reflect merge of #3133 [ci skip] 2014-11-20 12:36:33 -08:00
Parker Moore
b16d47a444 Merge pull request #3133 from XhmikosR/patch-11 2014-11-20 12:36:08 -08:00
XhmikosR
d2d3087d3b Slightly compress jekyll-sticker.jpg. 2014-11-20 22:18:02 +02:00
XhmikosR
b9a4cf0485 Update gridism. 2014-11-20 22:11:50 +02:00
Parker Moore
848e402937 Update history to reflect merge of #2904 [ci skip] 2014-11-20 10:36:10 -08:00
Parker Moore
c0951b0a19 Merge pull request #2904 from XhmikosR/mixins 2014-11-20 10:35:27 -08:00
Parker Moore
3592284969 Update history to reflect merge of #3127 [ci skip] 2014-11-18 12:50:28 -08:00
Parker Moore
0f458edf2b Merge pull request #3127 from aarongustafson/master 2014-11-18 12:50:07 -08:00
Aaron Gustafson
1adf8974bf Adding Webmentions in the right place this time :-) 2014-11-18 15:06:24 -05:00
XhmikosR
da443039e1 Move custom code from _font-awesome.scss to _style.scss.
Also change the order of includes so that _style.scss is last for precedence reasons.
2014-11-18 08:15:53 +02:00
XhmikosR
4aee950418 Add Sass mixins and use them.
Reduces code duplication and makes things cleaner.
2014-11-18 08:15:53 +02:00
Parker Moore
9e454d24a0 Update history to reflect merge of #3123 [ci skip] 2014-11-17 13:06:29 -08:00
Parker Moore
5185c8d72b Merge pull request #3123 from jekyll/site-sass-improvements 2014-11-17 13:05:57 -08:00
Joel Glovier
6f9d28f398 use sass selector nesting in pygments 2014-11-17 14:55:32 -05:00
Joel Glovier
2195e5e469 use sass selector nesting for styles 2014-11-17 14:48:34 -05:00
Parker Moore
60202782ea Only try bundler if the Gemfile is there. 2014-11-16 21:21:50 -08:00
Parker Moore
32b14d6402 First, setup Bundler. Then, require it.
Per a conversation in
https://github.com/bundler/bundler/issues/3252#issuecomment-63208769
2014-11-16 21:18:23 -08:00
Parker Moore
22275e571d Add note about page vs post. [ci skip]
Closes #3056.
2014-11-16 20:40:23 -08:00
Parker Moore
4142630614 Use the text lexer instead of the non-existant CSV one. [ci skip]
Ref #3101.
2014-11-16 20:29:17 -08:00
Parker Moore
3d8368fa4f Update history to reflect merge of #3058 [ci skip] 2014-11-16 20:21:09 -08:00
Parker Moore
687b9cdf19 Merge pull request #3058 from alfredxing/fix-post-url-equality 2014-11-16 20:19:37 -08:00
Parker Moore
ecca3accdc Update history to reflect merge of #3094 [ci skip] 2014-11-16 20:17:27 -08:00
Parker Moore
5aa747e99a Merge branch 'master' of github.com:jekyll/jekyll
* 'master' of github.com:jekyll/jekyll:
  Get rid of noifniof
2014-11-16 20:16:48 -08:00
Parker Moore
b5a32a6d46 Merge pull request #3094 from alfredxing/no-noifniof 2014-11-16 20:16:45 -08:00
Parker Moore
426f2a79fc Update history to reflect merge of #3091 [ci skip] 2014-11-16 20:15:13 -08:00
Parker Moore
d9cdc7992a Merge pull request #3091 from rovrov/master 2014-11-16 20:14:50 -08:00
Matt Rogers
829133cf98 Update history to reflect merge of #3101 [ci skip] 2014-11-13 21:34:48 -06:00
Matt Rogers
27362a1984 Merge pull request #3101 from ndarville/patch-1 2014-11-13 21:34:31 -06:00
Niclas Darville
3014fbd344 Added CSV example for data-file docs 2014-11-13 16:04:28 +01:00
Niclas Darville
596b9e0785 Mentioned CSV extension in docs for data files
Since CSV files are supported as collections.
2014-11-13 10:30:00 +01:00
Parker Moore
39c9fb120f Update history to reflect merge of #3089 [ci skip] 2014-11-12 18:47:03 -08:00
Parker Moore
314fb875b5 Merge pull request #3089 from jekyll/remove-duplication-in-regexp 2014-11-12 18:46:44 -08:00
Parker Moore
3b40d964fb Update history to reflect merge of #3093 [ci skip] 2014-11-11 18:22:37 -08:00
Parker Moore
a48379a715 Merge pull request #3093 from shinnn/ga 2014-11-11 18:22:14 -08:00
Alfred Xing
d4c15efff9 Cache name matching regex 2014-11-11 17:35:09 -08:00
Alfred Xing
2a41945014 Get rid of noifniof 2014-11-11 15:14:24 -08:00
Shinnosuke Watanabe
dc248345a9 Change variables of Google Analytics script
`i` `s` `o` `g` `r` `a` `m` -> `j` `e` `k` `y` `l` `L`

Generated by isogram
https://github.com/shinnn/isogram
2014-11-11 18:42:54 +09:00
rovrov
b6f3adb6e3 Add trailing slash to paginate_path example.
https://github.com/jekyll/jekyll-paginate/issues/15#issuecomment-62322554
2014-11-10 16:02:52 -05:00
Parker Moore
472c18e409 Update history to reflect merge of #3090 [ci skip] 2014-11-10 12:02:26 -08:00
Parker Moore
e42f5ac2dc Merge pull request #3090 from alfredxing/fix-error-output 2014-11-10 12:01:46 -08:00
Alfred Xing
06750b8502 Print error message in renderer 2014-11-10 11:45:56 -08:00
Parker Moore
bd907c5be6 Remove duplicate regexp phrase: ^\A.
Addresses @mastahyeti's comment in #3077: https://github.com/jekyll/jekyll/pull/3077#discussion_r20077150
2014-11-10 11:36:05 -08:00
Parker Moore
c79fe1125c Update history to reflect merge of #3088 [ci skip] 2014-11-10 10:51:01 -08:00
Parker Moore
20f0940455 Merge pull request #3088 from alfredxing/fix-error-output 2014-11-10 10:50:32 -08:00
Alfred Xing
84cef2202d Remove duplicate 'Conversion error:' message 2014-11-10 09:12:51 -08:00
Alfred Xing
eaa132c65b Fall back to old method with deprecation warning 2014-11-09 11:55:47 -08:00
Parker Moore
2d31d07602 Update site history page with v2.5.1 2014-11-09 10:39:18 -08:00
Parker Moore
d99814baa5 v2.5.1 was released on Nov 9, not Nov 8. 2014-11-09 09:48:21 -08:00
Parker Moore
ab05a2cd4f Release 💎 2.5.1 2014-11-09 09:45:05 -08:00
Parker Moore
db8163b6e8 Merge pull request #3080 from jekyll/release-2-5-1
Release v2.5.1
2014-11-09 09:42:31 -08:00
Parker Moore
22d11bef2d Prepare a 💎 v2.5.1 release. 2014-11-08 22:29:47 -08:00
Parker Moore
70159ac8cb Use paginator.(next|previous)_page_path instead of just the number.
Closes #3074
2014-11-08 22:25:05 -08:00
Parker Moore
5eb300043f Update history to reflect merge of #3077 [ci skip] 2014-11-08 22:10:03 -08:00
Parker Moore
95b62e564b Merge pull request #3077 from jekyll/fix-windows-path-sanitation 2014-11-08 22:07:52 -08:00
Parker Moore
ad745702ca New title for new times. 2014-11-08 22:05:02 -08:00
Parker Moore
4b0089712e Add the contributors to the v2.5.0 release post.
I'm such a doofus for forgetting!!!!
2014-11-08 22:03:54 -08:00
Parker Moore
264caac94c Update history to reflect merge of #3075 [ci skip] 2014-11-08 21:15:13 -08:00
Parker Moore
58180b1ac1 Merge pull request #3075 from joshk/patch-1 2014-11-08 21:14:46 -08:00
Parker Moore
067f8b6be7 Strip the drive name from both paths when checking the prefix. 2014-11-08 13:10:28 -08:00
Parker Moore
4df73ced0d Add benchmark for Jekyll.sanitized_path 2014-11-08 12:54:02 -08:00
Josh Kalderimis
c7603f3ebf use built in travis caching
also run bundle update to make sure the cache is not too old
2014-11-08 16:12:03 +13:00
Parker Moore
ae7f10b922 Something about a Travis Beta Build that @joshk mentioned 2014-11-06 18:17:28 -08:00
Parker Moore
023e4e6ceb Update history to reflect merge of #3064 [ci skip] 2014-11-06 13:19:00 -08:00
Parker Moore
742893410c Merge pull request #3064 from ribbons/cygwin-env 2014-11-06 13:18:38 -08:00
Matt Robinson
90bdcaddb7 Add development dependencies for Cygwin
In the Cygwin environment, minitest and test-unit aren't bundled with
Ruby.  Add these as explicit development dependencies when running under
Cygwin.
2014-11-06 09:28:52 +00:00
Alfred Xing
50d0fc3c85 Match post.name instead of slugs and dates 2014-11-04 16:13:04 -08:00
Renaud Martinet
f9e249ae20 Generalize Utils#slugify for any scripts
It replaces any non alphanumeric glyphs by an hyphen.
2014-10-31 15:56:03 +01:00
Alfred Xing
c3ec158f2d Keep backwards compatibility
Re-add `relative_path` Liquid variable too keep compatibility
2014-09-11 18:25:21 -07:00
Alfred Xing
6c0e791236 Use relative path for path Liquid variable in Documents 2014-09-10 21:04:40 -07:00
Carlos Matallín
1aa9d6255e Add jekyll-thumbnail-filter to plugins list 2014-08-20 22:34:43 +02:00
100 changed files with 2140 additions and 985 deletions

1
.gitignore vendored
View File

@@ -14,3 +14,4 @@ coverage
.ruby-version
.sass-cache
tmp/stackprof-*
.jekyll-metadata

View File

@@ -1,15 +1,16 @@
language: ruby
cache: bundler
install:
- script/rebund download
- travis_retry bundle install --path vendor/bundle -j8
sudo: false
rvm:
- 2.2
- 2.1
- 2.0
- 1.9.3
env:
matrix:
- TEST_SUITE=test
- TEST_SUITE=cucumber
before_script: bundle update
script: script/cibuild
after_script:
- script/rebund upload
notifications:
irc:
on_success: change
@@ -17,14 +18,9 @@ notifications:
channels:
- irc.freenode.org#jekyll
template:
- '%{repository}#%{build_number} (%{branch}) %{message} %{build_url}'
- "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}"
email:
on_success: never
on_failure: never
env:
global:
- secure: bt5nglPTdsc0N5fB1dOJz2WbM81dGpDuVD8PnhEsxgUfoo6xavhU4+pNrUADlSUqQ1aJrdU+MKW4x+JZ2ZnJS8vOpNzRymuMZSbFaljK4pgFGiKFgBdMKxVikvoYcxKCjLAl7NJZ11W6hUw+JtJScClDZwrJJAQB6I7Isp/LsdM=
- secure: Ym8nx7nbfGYGo47my92M+deJykaiMkdZdb615EO51liv/xy/0aQ919Jpfieugc9d3zVnm+zFGPbpv4YzRpsik6OlVBNa4lP+BnQ27ptf5YcLWD8Hksi7845WFLecXMoaTCoYer/TvYZsIWJb2nSDMH9qbfZhnd1YZKuvUpK0rEU=
matrix:
- TEST_SUITE=test
- TEST_SUITE=cucumber
slack:
secure: dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4YGEilNRzKPz18AsFptVXofpwyqcBxaCfmHP809NX5PHBaadydveLm+TNVao2XeLXSWu+HUNAYO1AanCUbJSEyJTju347xCBGzESU=

22
Gemfile
View File

@@ -1,7 +1,29 @@
source 'https://rubygems.org'
gemspec
gem 'rake', '~> 10.1'
gem 'rdoc', '~> 3.11'
gem 'redgreen', '~> 1.2'
gem 'shoulda', '~> 3.5'
gem 'rr', '~> 1.1'
gem 'cucumber', '1.3.18'
gem 'RedCloth', '~> 4.2'
gem 'maruku', '~> 0.7.0'
gem 'rdiscount', '~> 1.6'
gem 'launchy', '~> 2.3'
gem 'simplecov', '~> 0.9'
gem 'simplecov-gem-adapter', '~> 1.0.1'
gem 'mime-types', '~> 1.5'
gem 'activesupport', '~> 3.2.13'
gem 'jekyll_test_plugin'
gem 'jekyll_test_plugin_malicious'
gem 'rouge', '~> 1.7'
gem 'liquid-c', '~> 0.0.3'
gem 'minitest' if RUBY_PLATFORM =~ /cygwin/
gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
if ENV['BENCHMARK']
gem 'benchmark-ips'
gem 'rbtrace'
gem 'stackprof'
end

View File

@@ -2,14 +2,110 @@
### Major Enhancements
* Incremental regeneration (#3116)
* Drop support for Ruby 1.9.3. (#3235)
* Upgrade to Liquid 3.0.0 (#3002)
* Support Ruby v2.2 (#3234)
### Minor Enhancements
* Sort static files just once, and call `site_payload` once for all collections (#3204)
* Separate `jekyll docs` and optimize external gem handling (#3241)
* Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240)
* Use relative path for `path` Liquid variable in Documents for consistency (#2908)
* Generalize `Utils#slugify` for any scripts (#3047)
* Added basic microdata to post template in site template (#3189)
* Store log messages in an array of messages. (#3244)
* Allow collection documents to override `output` property in front matter (#3172)
### Bug Fixes
* Remove unneeded end tag for `link` in site template (#3236)
* Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237)
* Unescape `Document` output path (#2924)
* Fix nav items alignment when on multiple rows (#3264)
### Development Fixes
* Improve the grammar in the documentation (#3233)
* Update the LICENSE text to match the MIT license exactly (#3253)
* Update rake task `site:publish` to fix minor bugs. (#3254)
* Switch to shields.io for the README badges. (#3255)
* Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261)
### Site Enhancements
* Fixing the default host on docs (#3229)
* Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790)
* Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186)
* Add a Resources link to tutorial on building dynamic navbars (#3185)
* Semantic structure improvements to the post and page layouts (#3251)
## 2.5.3 / 2014-12-22
### Bug Fixes
* When checking a Markdown extname, include position of the `.` (#3147)
* Fix `jsonify` Liquid filter handling of boolean values (#3154)
* Add comma to value of `viewport` meta tag (#3170)
* Set the link type for the RSS feed to `application/rss+xml` (#3176)
* Refactor `#as_liquid` (#3158)
### Development Fixes
* Exclude built-in bundles from being added to coverage report (#3180)
### Site Enhancements
* Add `@alfredxing` to the `@jekyll/core` team. :tada: (#3218)
* Document the `-q` option for the `build` and `serve` commands (#3149)
* Fix some minor typos/flow fixes in documentation website content (#3165)
* Add `keep_files` to configuration documentation (#3162)
* Repeat warning about cleaning of the `destination` directory (#3161)
* Add jekyll-500px-embed to list of third-party plugins (#3163)
* Simplified platform detection in Gemfile example for Windows (#3177)
* Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198)
* Add Table of Contents to Troubleshooting page (#3196)
* Add `inline_highlight` plugin to list of third-party plugins (#3212)
* Add `jekyll-mermaid` plugin to list of third-party plugins (#3222)
## 2.5.2 / 2014-11-17
### Minor Enhancements
* `post_url` should match `post.name` instead of slugs and dates (#3058)
### Bug Fixes
* Fix bundle require for `:jekyll_plugins` (#3119)
* Remove duplicate regexp phrase: `^\A` (#3089)
* Remove duplicate `Conversion error:` message in `Convertible` (#3088)
* Print full conversion error message in `Renderer#convert` (#3090)
### Site Enhancements
* Change variable names in Google Analytics script (#3093)
* Mention CSV files in the docs for data files (#3101)
* Add trailing slash to `paginate_path` example. (#3091)
* Get rid of noifniof (`excerpt_separator`) (#3094)
* Sass improvements, around nesting mostly. (#3123)
* Add webmentions.io plugin to the list of third-party plugins (#3127)
* Add Sass mixins and use them. (#2904)
* Slightly compress jekyll-sticker.jpg. (#3133)
* Update gridism and separate out related but custom styles. (#3132)
* Add remote-include plugin to list of third-party plugins (#3136)
## 2.5.1 / 2014-11-09
### Bug Fixes
* Fix path sanitation bug related to Windows drive names (#3077)
### Development Fixes
* Add development time dependencies on minitest and test-unit to gemspec for cygwin (#3064)
* Use Travis's built-in caching. (#3075)
## 2.5.0 / 2014-11-06
### Minor Enhancements

View File

@@ -1,9 +1,9 @@
(The MIT License)
The MIT License (MIT)
Copyright (c) 2008-2014 Tom Preston-Werner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

View File

@@ -1,9 +1,9 @@
# [Jekyll](http://jekyllrb.com/)
[![Gem Version](https://badge.fury.io/rb/jekyll.svg)](https://rubygems.org/gems/jekyll)
[![Build Status](https://secure.travis-ci.org/jekyll/jekyll.svg?branch=master)](https://travis-ci.org/jekyll/jekyll)
[![Code Climate](http://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)](https://rubygems.org/gems/jekyll)
[![Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg)](https://travis-ci.org/jekyll/jekyll)
[![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)](https://hakiri.io/github/jekyll/jekyll/master)
By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!

View File

@@ -179,25 +179,44 @@ namespace :site do
# Ensure the gh-pages dir exists so we can generate into it.
puts "Checking for gh-pages dir..."
unless File.exist?("./gh-pages")
puts "No gh-pages directory found. Run the following commands first:"
puts " `git clone git@github.com:jekyll/jekyll gh-pages"
puts " `cd gh-pages"
puts " `git checkout gh-pages`"
exit(1)
puts "Creating gh-pages dir..."
sh "git clone git@github.com:jekyll/jekyll gh-pages"
end
# Ensure gh-pages branch is up to date.
# Ensure latest gh-pages branch history.
Dir.chdir('gh-pages') do
sh "git checkout gh-pages"
sh "git pull origin gh-pages"
end
# Copy to gh-pages dir.
# Proceed to purge all files in case we removed a file in this release.
puts "Cleaning gh-pages directory..."
purge_exclude = %w[
gh-pages/.
gh-pages/..
gh-pages/.git
]
FileList["gh-pages/{*,.*}"].exclude(*purge_exclude).each do |path|
sh "rm -rf #{path}"
end
# Copy site to gh-pages dir.
puts "Copying site to gh-pages branch..."
Dir.glob("site/*") do |path|
next if path.include? "_site"
copy_exclude = %w[
site/.
site/..
site/.jekyll-metadata
site/_site
]
FileList["site/{*,.*}"].exclude(*copy_exclude).each do |path|
sh "cp -R #{path} gh-pages/"
end
# Change any configuration settings for production.
config = YAML.load_file("gh-pages/_config.yml")
config.merge!({'sass' => {'style' => 'compressed'}})
File.write('gh-pages/_config.yml', YAML.dump(config))
# Commit and push.
puts "Committing and pushing to GitHub Pages..."
sha = `git log`.match(/[a-z0-9]{40}/)[0]

View File

@@ -0,0 +1,32 @@
require 'benchmark/ips'
require 'jekyll'
site = Jekyll::Site.new(Jekyll.configuration({
'source' => File.expand_path('../site', __dir__),
'destination' => File.expand_path('../site/_site', __dir__)
}))
payload = Jekyll::Utils.deep_merge_hashes(
site.site_payload,
{ 'site' => {'page' => site.pages.first.to_liquid } }
)
info = {
filters: [Jekyll::Filters],
registers: { :site => site, :page => payload['page'] }
}
class WithoutCacheInclude < Jekyll::Tags::IncludeTag
def source(file, context)
File.read(file, file_read_opts(context))
end
end
Liquid::Template.register_tag('include_woc', WithoutCacheInclude)
def parse(tag, payload, info)
Liquid::Template.parse("{% #{tag} footer.html %}").render!(payload, info)
end
Benchmark.ips do |x|
x.report('cached') { parse 'include', payload, info }
x.report('uncached') { parse 'include_woc', payload, info }
end

View File

@@ -0,0 +1,46 @@
#!/usr/bin/env ruby
require_relative '../lib/jekyll'
require 'benchmark/ips'
base_directory = Dir.pwd
Benchmark.ips do |x|
#
# Does not include the base_directory
#
x.report('with no questionable path') do
Jekyll.sanitized_path(base_directory, '')
end
x.report('with a single-part questionable path') do
Jekyll.sanitized_path(base_directory, 'thingy')
end
x.report('with a multi-part questionable path') do
Jekyll.sanitized_path(base_directory, 'thingy/in/my/soup')
end
x.report('with a single-part traversal path') do
Jekyll.sanitized_path(base_directory, '../thingy')
end
x.report('with a multi-part traversal path') do
Jekyll.sanitized_path(base_directory, '../thingy/in/my/../../soup')
end
#
# Including the base_directory
#
x.report('with the exact same paths') do
Jekyll.sanitized_path(base_directory, base_directory)
end
x.report('with a single-part absolute path including the base_directory') do
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy'))
end
x.report('with a multi-part absolute path including the base_directory') do
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy/in/my/soup'))
end
x.report('with a single-part traversal path including the base_directory') do
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy/..'))
end
x.report('with a multi-part traversal path including the base_directory') do
Jekyll.sanitized_path(base_directory, File.join('thingy/in/my/../../soup'))
end
end

View File

@@ -6,12 +6,9 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
require 'jekyll'
require 'mercenary'
%w[jekyll-import].each do |blessed_gem|
begin
require blessed_gem
rescue LoadError
end
end
Jekyll::External.require_if_present(
Jekyll::External.blessed_gems
)
Jekyll::PluginManager.require_from_bundler
@@ -32,6 +29,7 @@ Mercenary.program(:jekyll) do |p|
p.action do |args, options|
if args.empty?
Jekyll.logger.error "A subcommand is required."
puts p
else
unless p.has_command?(args.first)

View File

@@ -9,7 +9,7 @@ Feature: Collections
And I have a configuration file with "collections" set to "['methods']"
When I run jekyll build
Then the _site directory should exist
And I should see "Collections: <p>Use <code>Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>\n<p><code>Jekyll.sanitized_path</code> is used to make sure your path is in your source.</p>\n<p>Run your generators! default</p>\n<p>Page without title.</p>\n<p>Run your generators! default</p>" in "_site/index.html"
And I should see "Collections: <p>Use <code>Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>\n<p>Signs are nice</p>\n<p><code>Jekyll.sanitized_path</code> is used to make sure your path is in your source.</p>\n<p>Run your generators! default</p>\n<p>Page without title.</p>\n<p>Run your generators! default</p>" in "_site/index.html"
And the "_site/methods/configuration.html" file should not exist
Scenario: Rendered collection
@@ -70,7 +70,7 @@ Feature: Collections
"""
When I run jekyll build
Then the _site directory should exist
And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: Collections specified as an hash
Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
@@ -82,7 +82,7 @@ Feature: Collections
"""
When I run jekyll build
Then the _site directory should exist
And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: All the documents
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
@@ -94,7 +94,7 @@ Feature: Collections
"""
When I run jekyll build
Then the _site directory should exist
And I should see "All documents: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
And I should see "All documents: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: Documents have an output attribute, which is the converted HTML
Given I have an "index.html" page that contains "First document's output: {{ site.documents.first.output }}"
@@ -130,7 +130,7 @@ Feature: Collections
"""
When I run jekyll build
Then the _site directory should exist
And I should see "1. of 5: <p>Page without title.</p>" in "_site/index.html"
And I should see "1. of 6: <p>Page without title.</p>" in "_site/index.html"
Scenario: Sort by relative_path
Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{% for method in methods %}{{ method.title }}, {% endfor %}"
@@ -142,4 +142,4 @@ Feature: Collections
"""
When I run jekyll build
Then the _site directory should exist
And I should see "Collections: Jekyll.configuration, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html"
And I should see "Collections: Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html"

View File

@@ -0,0 +1,60 @@
Feature: Incremental rebuild
As an impatient hacker who likes to blog
I want to be able to make a static site
Without waiting too long for it to build
Scenario: Produce correct output site
Given I have a _layouts directory
And I have a _posts directory
And I have the following posts:
| title | date | layout | content |
| Wargames | 2009-03-27 | default | The only winning move is not to play. |
And I have a default layout that contains "Post Layout: {{ content }}"
When I run jekyll build
Then the _site directory should exist
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
When I run jekyll build
Then the _site directory should exist
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
Scenario: Generate a metadata file
Given I have an "index.html" file that contains "Basic Site"
When I run jekyll build
Then the ".jekyll-metadata" file should exist
Scenario: Rebuild when content is changed
Given I have an "index.html" file that contains "Basic Site"
When I run jekyll build
Then the _site directory should exist
And I should see "Basic Site" in "_site/index.html"
When I wait 1 second
Then I have an "index.html" file that contains "Bacon Site"
When I run jekyll build
Then the _site directory should exist
And I should see "Bacon Site" in "_site/index.html"
Scenario: Rebuild when layout is changed
Given I have a _layouts directory
And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
And I have a default layout that contains "Page Layout: {{ content }}"
When I run jekyll build
Then the _site directory should exist
And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"
When I wait 1 second
Then I have a default layout that contains "Page Layout Changed: {{ content }}"
When I run jekyll build --full-rebuild
Then the _site directory should exist
And I should see "Page Layout Changed: Basic Site with Layout" in "_site/index.html"
Scenario: Rebuild when an include is changed
Given I have a _includes directory
And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
When I run jekyll build
Then the _site directory should exist
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
When I wait 1 second
Then I have an "_includes/about.textile" file that contains "Regenerated by Jekyll"
When I run jekyll build
Then the _site directory should exist
And I should see "Basic Site with include tag: Regenerated by Jekyll" in "_site/index.html"

View File

@@ -47,7 +47,7 @@ Feature: Markdown
And I should see "My awesome code" in "_site/index.html"
And I should see "<pre><code>My awesome code</code></pre>" in "_site/index.html"
Scenario: Maruku fenced codeblocks
Scenario: Maruku fenced codeblocks with syntax highlighting
Given I have a configuration file with "markdown" set to "maruku"
And I have an "index.markdown" file with content:
"""

View File

@@ -24,6 +24,7 @@ end
After do
FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR)
FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exist?(JEKYLL_COMMAND_OUTPUT_FILE)
Dir.chdir(File.dirname(TEST_DIR))
end
World(Test::Unit::Assertions)
@@ -133,6 +134,10 @@ Given /^I have fixture collections$/ do
FileUtils.cp_r File.join(JEKYLL_SOURCE_DIR, "test", "source", "_methods"), source_dir
end
Given /^I wait (\d+) second(s?)$/ do |time, plural|
sleep(time.to_f)
end
##################
#
# Changing stuff
@@ -188,7 +193,15 @@ Then /^I should see escaped "(.*)" in "(.*)"$/ do |text, file|
end
Then /^the "(.*)" file should +exist$/ do |file|
assert File.file?(file), "The file \"#{file}\" does not exist"
file_does_exist = File.file?(file)
unless file_does_exist
all_steps_to_path(file).each do |dir|
STDERR.puts ""
STDERR.puts "Dir #{dir}:"
STDERR.puts Dir["#{dir}/**/*"]
end
end
assert file_does_exist, "The file \"#{file}\" does not exist.\n"
end
Then /^the "(.*)" file should not exist$/ do |file|

View File

@@ -13,6 +13,17 @@ def source_dir(*files)
File.join(TEST_DIR, *files)
end
def all_steps_to_path(path)
source = Pathname.new(source_dir('_site')).expand_path
dest = Pathname.new(path).expand_path
paths = []
dest.ascend do |f|
break if f.eql? source
paths.unshift f.to_s
end
paths
end
def jekyll_output_file
JEKYLL_COMMAND_OUTPUT_FILE
end

View File

@@ -5,62 +5,44 @@ require 'jekyll/version'
Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.rubygems_version = '2.2.2'
s.required_ruby_version = '>= 1.9.3'
s.required_ruby_version = '>= 2.0.0'
s.name = 'jekyll'
s.version = Jekyll::VERSION
s.license = 'MIT'
s.name = 'jekyll'
s.version = Jekyll::VERSION
s.license = 'MIT'
s.summary = "A simple, blog aware, static site generator."
s.description = "Jekyll is a simple, blog aware, static site generator."
s.summary = 'A simple, blog aware, static site generator.'
s.description = 'Jekyll is a simple, blog aware, static site generator.'
s.authors = ["Tom Preston-Werner"]
s.email = 'tom@mojombo.com'
s.homepage = 'https://github.com/jekyll/jekyll'
s.authors = ['Tom Preston-Werner']
s.email = 'tom@mojombo.com'
s.homepage = 'https://github.com/jekyll/jekyll'
all_files = `git ls-files -z`.split("\x0")
s.files = all_files.grep(%r{^(bin|lib)/})
s.executables = all_files.grep(%r{^bin/}) { |f| File.basename(f) }
s.require_paths = ["lib"]
s.require_paths = ['lib']
s.rdoc_options = ["--charset=UTF-8"]
s.rdoc_options = ['--charset=UTF-8']
s.extra_rdoc_files = %w[README.markdown LICENSE]
s.add_runtime_dependency('liquid', "~> 2.6.1")
s.add_runtime_dependency('kramdown', "~> 1.3")
s.add_runtime_dependency('mercenary', "~> 0.3.3")
s.add_runtime_dependency('safe_yaml', "~> 1.0")
s.add_runtime_dependency('colorator', "~> 0.1")
s.add_runtime_dependency('liquid', '~> 3.0')
s.add_runtime_dependency('kramdown', '~> 1.3')
s.add_runtime_dependency('mercenary', '~> 0.3.3')
s.add_runtime_dependency('safe_yaml', '~> 1.0')
s.add_runtime_dependency('colorator', '~> 0.1')
# Before 3.0 drops, phase the following gems out as dev dependencies
# and gracefully handle their absence.
s.add_runtime_dependency('pygments.rb', "~> 0.6.0")
s.add_runtime_dependency('redcarpet', "~> 3.1")
s.add_runtime_dependency('pygments.rb', '~> 0.6.0')
s.add_runtime_dependency('redcarpet', '~> 3.1')
s.add_runtime_dependency('toml', '~> 0.1.0')
s.add_runtime_dependency('jekyll-paginate', '~> 1.0')
s.add_runtime_dependency('jekyll-gist', '~> 1.0')
s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0')
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
s.add_runtime_dependency('classifier-reborn', "~> 2.0")
s.add_development_dependency('rake', "~> 10.1")
s.add_development_dependency('rdoc', "~> 3.11")
s.add_development_dependency('redgreen', "~> 1.2")
s.add_development_dependency('shoulda', "~> 3.5")
s.add_development_dependency('rr', "~> 1.1")
s.add_development_dependency('cucumber', "1.3.11")
s.add_development_dependency('RedCloth', "~> 4.2")
s.add_development_dependency('maruku', "~> 0.7.0")
s.add_development_dependency('rdiscount', "~> 1.6")
s.add_development_dependency('launchy', "~> 2.3")
s.add_development_dependency('simplecov', "~> 0.9")
s.add_development_dependency('simplecov-gem-adapter', "~> 1.0.1")
s.add_development_dependency('mime-types', "~> 1.5")
s.add_development_dependency('activesupport', '~> 3.2.13')
s.add_development_dependency('jekyll_test_plugin')
s.add_development_dependency('jekyll_test_plugin_malicious')
s.add_development_dependency('rouge', '~> 1.7')
s.add_runtime_dependency('classifier-reborn', '~> 2.0')
end

View File

@@ -21,6 +21,7 @@ require 'time'
require 'English'
require 'pathname'
require 'logger'
require 'set'
# 3rd party
require 'safe_yaml/load'
@@ -29,6 +30,7 @@ require 'kramdown'
require 'colorator'
SafeYAML::OPTIONS[:suppress_warnings] = true
Liquid::Template.error_mode = :strict
module Jekyll
@@ -43,11 +45,13 @@ module Jekyll
autoload :EntryFilter, 'jekyll/entry_filter'
autoload :Errors, 'jekyll/errors'
autoload :Excerpt, 'jekyll/excerpt'
autoload :External, 'jekyll/external'
autoload :Filters, 'jekyll/filters'
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
autoload :Layout, 'jekyll/layout'
autoload :LayoutReader, 'jekyll/layout_reader'
autoload :LogAdapter, 'jekyll/log_adapter'
autoload :Metadata, 'jekyll/metadata'
autoload :Page, 'jekyll/page'
autoload :PluginManager, 'jekyll/plugin_manager'
autoload :Post, 'jekyll/post'
@@ -141,15 +145,21 @@ module Jekyll
#
# Returns the sanitized path.
def sanitized_path(base_directory, questionable_path)
return base_directory if base_directory.eql?(questionable_path)
clean_path = File.expand_path(questionable_path, "/")
clean_path.gsub!(/\A\w\:\//, '/')
unless clean_path.start_with?(base_directory)
clean_path = clean_path.sub(/\A\w\:\//, '/')
unless clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
File.join(base_directory, clean_path)
else
clean_path
end
end
# Conditional optimizations
Jekyll::External.require_if_present('liquid-c')
end
end
@@ -160,7 +170,7 @@ require_all 'jekyll/generators'
require_all 'jekyll/tags'
# Eventually remove these for 3.0 as non-core
Jekyll::Deprecator.gracefully_require(%w[
Jekyll::External.require_with_graceful_fail(%w[
toml
jekyll-paginate
jekyll-gist

View File

@@ -13,6 +13,7 @@ module Jekyll
# Cleans up the site's destination directory
def cleanup!
FileUtils.rm_rf(obsolete_files)
FileUtils.rm_rf(metadata_file) if @site.full_rebuild?
end
private
@@ -24,6 +25,13 @@ module Jekyll
(existing_files - new_files - new_dirs + replaced_files).to_a
end
# Private: The metadata file storing dependency tree and build history
#
# Returns an Array with the metdata file as the only item
def metadata_file
[site.metadata.metadata_file]
end
# Private: The list of existing files, apart from those included in keep_files and hidden files.
#
# Returns a Set with the file paths

View File

@@ -40,7 +40,7 @@ module Jekyll
if Utils.has_yaml_header? full_path
doc = Jekyll::Document.new(full_path, { site: site, collection: self })
doc.read
docs << doc
docs << doc if site.publisher.publish?(doc)
else
relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.")
files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
@@ -183,6 +183,5 @@ module Jekyll
{}
end
end
end
end

View File

@@ -58,6 +58,7 @@ module Jekyll
c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished'
c.option 'quiet', '-q', '--quiet', 'Silence output.'
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
c.option 'full_rebuild', '-f', '--full-rebuild', 'Disable incremental rebuild.'
end
end

View File

@@ -50,8 +50,10 @@ module Jekyll
def build(site, options)
source = options['source']
destination = options['destination']
full_build = options['full_rebuild']
Jekyll.logger.info "Source:", source
Jekyll.logger.info "Destination:", destination
Jekyll.logger.info "Incremental build:", (full_build ? "disabled" : "enabled")
Jekyll.logger.info "Generating..."
process_site(site)
Jekyll.logger.info "", "done."
@@ -64,7 +66,7 @@ module Jekyll
#
# Returns nothing.
def watch(site, options)
Deprecator.gracefully_require 'jekyll-watch'
External.require_with_graceful_fail 'jekyll-watch'
Jekyll::Watcher.watch(options)
end

View File

@@ -0,0 +1,42 @@
module Jekyll
module Commands
class Clean < Command
class << self
def init_with_program(prog)
prog.command(:clean) do |c|
c.syntax 'clean [subcommand]'
c.description 'Clean the site (removes site output and metadata file) without building.'
c.action do |args, _|
Jekyll::Commands::Clean.process({})
end
end
end
def process(options)
options = configuration_from_options(options)
destination = options['destination']
metadata_file = File.join(options['source'], '.jekyll-metadata')
if File.directory? destination
Jekyll.logger.info "Cleaning #{destination}..."
FileUtils.rm_rf(destination)
Jekyll.logger.info "", "done."
else
Jekyll.logger.info "Nothing to do for #{destination}."
end
if File.file? metadata_file
Jekyll.logger.info "Removing #{metadata_file}..."
FileUtils.rm_rf(metadata_file)
Jekyll.logger.info "", "done."
else
Jekyll.logger.info "Nothing to do for #{metadata_file}."
end
end
end
end
end
end

View File

@@ -1,30 +0,0 @@
module Jekyll
module Commands
class Docs < Command
class << self
def init_with_program(prog)
prog.command(:docs) do |c|
c.syntax 'docs'
c.description "Launch local server with docs for Jekyll v#{Jekyll::VERSION}"
c.option 'port', '-P', '--port [PORT]', 'Port to listen on'
c.option 'host', '-H', '--host [HOST]', 'Host to bind to'
c.action do |args, options|
options.merge!({
'source' => File.expand_path("../../../site", File.dirname(__FILE__)),
'destination' => File.expand_path("../../../site/_site", File.dirname(__FILE__))
})
Jekyll::Commands::Build.process(options)
Jekyll::Commands::Serve.process(options)
end
end
end
end
end
end
end

View File

@@ -22,6 +22,7 @@ module Jekyll
'encoding' => 'utf-8',
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
'textile_ext' => 'textile',
'full_rebuild' => false,
# Filtering Content
'show_drafts' => nil,
@@ -74,12 +75,12 @@ module Jekyll
},
'kramdown' => {
'auto_ids' => true,
'footnote_nr' => 1,
'entity_output' => 'as_char',
'toc_levels' => '1..6',
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
'use_coderay' => false,
'auto_ids' => true,
'footnote_nr' => 1,
'entity_output' => 'as_char',
'toc_levels' => '1..6',
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
'enable_coderay' => false,
'coderay' => {
'coderay_wrap' => 'div',
@@ -253,6 +254,12 @@ module Jekyll
config[option].map!(&:to_s)
end
if (config['kramdown'] || {}).key?('use_coderay')
Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" +
" to 'enable_coderay' in your configuration file."
config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay')
end
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " +
"Markdown processor. Maruku support has been deprecated and will " +

View File

@@ -48,7 +48,7 @@ module Jekyll
def extname_matches_regexp
@extname_matches_regexp ||= Regexp.new(
'(' + @config['markdown_ext'].gsub(',','|') +')$',
'^\.(' + @config['markdown_ext'].gsub(',','|') +')$',
Regexp::IGNORECASE
)
end

View File

@@ -13,14 +13,14 @@ module Jekyll
def convert(content)
# Check for use of coderay
if @config['kramdown']['use_coderay']
if @config['kramdown']['enable_coderay']
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
key = "coderay_#{opt}"
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
end
end
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config["kramdown"])).to_html
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config['kramdown'])).to_html
end
end

View File

@@ -3,7 +3,7 @@ module Jekyll
class Markdown
class RDiscountParser
def initialize(config)
Jekyll::Deprecator.gracefully_require "rdiscount"
Jekyll::External.require_with_graceful_fail "rdiscount"
@config = config
@rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
end

View File

@@ -14,7 +14,7 @@ module Jekyll
module WithPygments
include CommonMethods
def block_code(code, lang)
Jekyll::Deprecator.gracefully_require("pygments")
Jekyll::External.require_with_graceful_fail("pygments")
lang = lang && lang.split.first || "text"
add_code_tags(
Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }),
@@ -55,7 +55,7 @@ module Jekyll
def initialize(config)
Deprecator.gracefully_require("redcarpet")
External.require_with_graceful_fail("redcarpet")
@config = config
@redcarpet_extensions = {}
@config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true }
@@ -71,7 +71,7 @@ module Jekyll
end
when "rouge"
Class.new(Redcarpet::Render::HTML) do
Jekyll::Deprecator.gracefully_require(%w[
Jekyll::External.require_with_graceful_fail(%w[
rouge
rouge/plugins/redcarpet
])

View File

@@ -66,8 +66,8 @@ module Jekyll
begin
converter.convert output
rescue => e
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{path}'."
Jekyll.logger.error("Conversion error:", e.to_s)
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error while converting '#{path}':"
Jekyll.logger.error("", e.to_s)
raise e
end
end
@@ -168,6 +168,15 @@ module Jekyll
true
end
# Determine whether to regenerate the file based on metadata.
#
# Returns true if file needs to be regenerated
def regenerate?
asset_file? ||
data['regenerate'] ||
site.metadata.regenerate?(site.in_source_dir(relative_path))
end
# Determine whether the file should be placed into layouts.
#
# Returns false if the document is an asset file.
@@ -207,6 +216,12 @@ module Jekyll
info,
File.join(site.config['layouts'], layout.name))
# Add layout to dependency tree
site.metadata.add_dependency(
site.in_source_dir(path),
site.in_source_dir(layout.path)
)
if layout = layouts[layout.data["layout"]]
if used.include?(layout)
layout = nil # avoid recursive chain

View File

@@ -40,22 +40,5 @@ module Jekyll
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'."
end
def gracefully_require(gem_name)
Array(gem_name).each do |name|
begin
require name
rescue LoadError => e
Jekyll.logger.error "Dependency Error:", <<-MSG
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
In order to use Jekyll as currently configured, you'll need to install this gem.
The full error message from Ruby is: '#{e.message}'
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
MSG
raise Errors::MissingDependencyException.new(name)
end
end
end
end
end

View File

@@ -105,6 +105,13 @@ module Jekyll
!(coffeescript_file? || yaml_file?)
end
# Determine whether the document should be regenerated based on metadata.
#
# Returns true if the document needs to be regenerated.
def regenerate?
data['regenerate'] || site.metadata.regenerate?(path, write?)
end
# Determine whether the file should be placed into layouts.
#
# Returns false if the document is either an asset file or a yaml file,
@@ -160,7 +167,7 @@ module Jekyll
# Returns the full path to the output file of this document.
def destination(base_directory)
dest = site.in_dest_dir(base_directory)
path = site.in_dest_dir(dest, url)
path = site.in_dest_dir(dest, URL.unescape_path(url))
path = File.join(path, "index.html") if url =~ /\/$/
path
end
@@ -233,8 +240,8 @@ module Jekyll
Utils.deep_merge_hashes data, {
"output" => output,
"content" => content,
"path" => path,
"relative_path" => relative_path,
"path" => relative_path,
"url" => url,
"collection" => collection.label
}

59
lib/jekyll/external.rb Normal file
View File

@@ -0,0 +1,59 @@
module Jekyll
module External
class << self
#
# Gems that, if installed, should be loaded.
# Usually contain subcommands.
#
def blessed_gems
%w{
jekyll-docs
jekyll-import
}
end
#
# Require a gem or file if it's present, otherwise silently fail.
#
# names - a string gem name or array of gem names
#
def require_if_present(names)
Array(names).each do |name|
begin
require name
rescue LoadError
Jekyll.logger.debug "Couldn't load #{name}. Skipping."
false
end
end
end
#
# Require a gem or gems. If it's not present, show a very nice error
# message that explains everything and is much more helpful than the
# normal LoadError.
#
# names - a string gem name or array of gem names
#
def require_with_graceful_fail(names)
Array(names).each do |name|
begin
require name
rescue LoadError => e
Jekyll.logger.error "Dependency Error:", <<-MSG
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
In order to use Jekyll as currently configured, you'll need to install this gem.
The full error message from Ruby is: '#{e.message}'
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
MSG
raise Jekyll::Errors::MissingDependencyException.new(name)
end
end
end
end
end
end

View File

@@ -10,7 +10,7 @@ module Jekyll
# Returns the HTML formatted String.
def textilize(input)
site = @context.registers[:site]
converter = site.getConverterImpl(Jekyll::Converters::Textile)
converter = site.find_converter_instance(Jekyll::Converters::Textile)
converter.convert(input)
end
@@ -21,7 +21,7 @@ module Jekyll
# Returns the HTML formatted String.
def markdownify(input)
site = @context.registers[:site]
converter = site.getConverterImpl(Jekyll::Converters::Markdown)
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
converter.convert(input)
end
@@ -32,7 +32,7 @@ module Jekyll
# Returns the CSS formatted String.
def sassify(input)
site = @context.registers[:site]
converter = site.getConverterImpl(Jekyll::Converters::Sass)
converter = site.find_converter_instance(Jekyll::Converters::Sass)
converter.convert(input)
end
@@ -43,7 +43,7 @@ module Jekyll
# Returns the CSS formatted String.
def scssify(input)
site = @context.registers[:site]
converter = site.getConverterImpl(Jekyll::Converters::Scss)
converter = site.find_converter_instance(Jekyll::Converters::Scss)
converter.convert(input)
end
@@ -309,7 +309,7 @@ module Jekyll
else
Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
exit(1)
end
end.localtime
end
def groupable?(element)
@@ -328,14 +328,23 @@ module Jekyll
def as_liquid(item)
case item
when String, Numeric, nil
item.to_liquid
when Hash
Hash[item.map { |k, v| [as_liquid(k), as_liquid(v)] }]
pairs = item.map { |k, v| as_liquid([k, v]) }
Hash[pairs]
when Array
item.map{ |i| as_liquid(i) }
else
item.respond_to?(:to_liquid) ? as_liquid(item.to_liquid) : item
if item.respond_to?(:to_liquid)
liquidated = item.to_liquid
# prevent infinite recursion for simple types (which return `self`)
if liquidated == item
item
else
as_liquid(liquidated)
end
else
item
end
end
end
end

View File

@@ -8,6 +8,9 @@ module Jekyll
# Gets the name of this layout.
attr_reader :name
# Gets the path to this layout.
attr_reader :path
# Gets/Sets the extension of this layout.
attr_accessor :ext
@@ -26,6 +29,7 @@ module Jekyll
@site = site
@base = base
@name = name
@path = site.in_source_dir(base, name)
self.data = {}

View File

@@ -1,6 +1,6 @@
module Jekyll
class LogAdapter
attr_reader :writer
attr_reader :writer, :messages
LOG_LEVELS = {
:debug => ::Logger::DEBUG,
@@ -16,6 +16,7 @@ module Jekyll
#
# Returns nothing
def initialize(writer, level = :info)
@messages = []
@writer = writer
self.log_level = level
end
@@ -87,7 +88,9 @@ module Jekyll
#
# Returns the formatted message
def message(topic, message)
formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
msg = formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
messages << msg
msg
end
# Internal: Format the topic

121
lib/jekyll/metadata.rb Normal file
View File

@@ -0,0 +1,121 @@
module Jekyll
class Metadata
attr_reader :site, :metadata, :cache
def initialize(site)
@site = site
# Read metadata from file
read_metadata
# Initialize cache to an empty hash
@cache = {}
end
# Add a path to the metadata
#
# Returns true, also on failure.
def add(path)
return true unless File.exist?(path)
metadata[path] = {
"mtime" => File.mtime(path),
"deps" => []
}
cache[path] = true
end
# Force a path to regenerate
#
# Returns true.
def force(path)
cache[path] = true
end
# Clear the metadata and cache
#
# Returns nothing
def clear
@metadata = {}
@cache = {}
end
# Checks if a path should be regenerated
#
# Returns a boolean.
def regenerate?(path, add = true)
return true if disabled?
# Check for path in cache
if cache.has_key? path
return cache[path]
end
# Check path that exists in metadata
data = metadata[path]
if data
data["deps"].each do |dependency|
if regenerate?(dependency)
return cache[dependency] = cache[path] = true
end
end
if data["mtime"].eql? File.mtime(path)
return cache[path] = false
else
return !add || add(path)
end
end
# Path does not exist in metadata, add it
return !add || add(path)
end
# Add a dependency of a path
#
# Returns nothing.
def add_dependency(path, dependency)
return if (metadata[path].nil? || @disabled)
metadata[path]["deps"] << dependency unless metadata[path]["deps"].include? dependency
regenerate? dependency
end
# Write the metadata to disk
#
# Returns nothing.
def write
File.open(metadata_file, 'w') do |f|
f.write(metadata.to_yaml)
end
end
# Produce the absolute path of the metadata file
#
# Returns the String path of the file.
def metadata_file
site.in_source_dir('.jekyll-metadata')
end
# Check if metadata has been disabled
#
# Returns a Boolean (true for disabled, false for enabled).
def disabled?
@disabled = site.full_rebuild? if @disabled.nil?
@disabled
end
private
# Read metadata from the metadata file, if no file is found,
# initialize with an empty hash
#
# Returns the read metadata.
def read_metadata
@metadata = if !disabled? && File.file?(metadata_file)
SafeYAML.load(File.read(metadata_file))
else
{}
end
end
end
end

View File

@@ -17,7 +17,6 @@ module Jekyll
def conscientious_require
require_plugin_files
require_gems
self.class.require_from_bundler
end
# Require each of the gem plugins specified.
@@ -33,14 +32,15 @@ module Jekyll
end
def self.require_from_bundler
if ENV["JEKYLL_NO_BUNDLER_REQUIRE"]
false
else
if !ENV["JEKYLL_NO_BUNDLER_REQUIRE"] && File.file?("Gemfile")
require "bundler"
required_gems = Bundler.require(:jekyll_plugins)
Bundler.setup # puts all groups on the load path
required_gems = Bundler.require(:jekyll_plugins) # requires the gems in this group only
Jekyll.logger.debug("PluginManager:", "Required #{required_gems.map(&:name).join(', ')}")
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = "true"
true
else
false
end
rescue LoadError, Bundler::GemfileNotFound
false

View File

@@ -3,11 +3,12 @@
module Jekyll
class Renderer
attr_reader :document, :site
attr_reader :document, :site, :site_payload
def initialize(site, document)
@site = site
@document = document
def initialize(site, document, site_payload = nil)
@site = site
@document = document
@site_payload = site_payload
end
# Determine which converters to use based on this document's
@@ -32,7 +33,7 @@ module Jekyll
def run
payload = Utils.deep_merge_hashes({
"page" => document.to_liquid
}, site.site_payload)
}, site_payload || site.site_payload)
info = {
filters: [Jekyll::Filters],
@@ -73,7 +74,8 @@ module Jekyll
begin
converter.convert output
rescue => e
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{document.relative_path}'."
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error while converting '#{document.relative_path}':"
Jekyll.logger.error("", e.to_s)
raise e
end
end
@@ -137,6 +139,12 @@ module Jekyll
File.join(site.config['layouts'], layout.name)
)
# Add layout to dependency tree
site.metadata.add_dependency(
site.in_source_dir(document.path),
site.in_source_dir(layout.path)
) if document.write?
if layout = site.layouts[layout.data["layout"]]
if used.include?(layout)
layout = nil # avoid recursive chain

View File

@@ -11,6 +11,7 @@ module Jekyll
:gems, :plugin_manager
attr_accessor :converters, :generators
attr_reader :metadata
# Public: Initialize a new Site.
#
@@ -27,6 +28,9 @@ module Jekyll
@source = File.expand_path(config['source']).freeze
@dest = File.expand_path(config['destination']).freeze
# Build metadata
@metadata = Metadata.new(self)
self.plugin_manager = Jekyll::PluginManager.new(self)
self.plugins = plugin_manager.plugins_path
@@ -183,6 +187,7 @@ module Jekyll
end
pages.sort_by!(&:name)
static_files.sort_by!(&:relative_path)
end
# Read all the files in <source>/<dir>/_posts and create a new Post
@@ -287,15 +292,16 @@ module Jekyll
def render
relative_permalinks_deprecation_method
payload = site_payload
collections.each do |label, collection|
collection.docs.each do |document|
document.output = Jekyll::Renderer.new(self, document).run
document.output = Jekyll::Renderer.new(self, document, payload).run if document.regenerate?
end
end
payload = site_payload
[posts, pages].flatten.each do |page_or_post|
page_or_post.render(layouts, payload)
page_or_post.render(layouts, payload) if page_or_post.regenerate?
end
rescue Errno::ENOENT => e
# ignore missing layout dir
@@ -312,7 +318,10 @@ module Jekyll
#
# Returns nothing.
def write
each_site_file { |item| item.write(dest) }
each_site_file { |item|
item.write(dest) if item.regenerate?
}
metadata.write unless full_rebuild?
end
# Construct a Hash of Posts indexed by the specified Post attribute.
@@ -377,7 +386,7 @@ module Jekyll
"time" => time,
"posts" => posts.sort { |a, b| b <=> a },
"pages" => pages,
"static_files" => static_files.sort { |a, b| a.relative_path <=> b.relative_path },
"static_files" => static_files,
"html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") },
"categories" => post_attr_hash('categories'),
"tags" => post_attr_hash('tags'),
@@ -405,13 +414,8 @@ module Jekyll
# klass - The Class of the Converter to fetch.
#
# Returns the Converter instance implementing the given Converter.
def getConverterImpl(klass)
matches = converters.select { |c| c.class == klass }
if impl = matches.first
impl
else
raise "Converter implementation not found for #{klass}"
end
def find_converter_instance(klass)
converters.find { |c| c.class == klass } || proc { raise "No converter for #{klass}" }.call
end
# Create array of instances of the subclasses of the class or module
@@ -453,7 +457,7 @@ module Jekyll
def relative_permalinks_deprecation_method
if config['relative_permalinks'] && has_relative_page?
Jekyll.logger.warn "Deprecation:", "Starting in 2.0, permalinks for pages" +
Jekyll.logger.warn "Deprecation:", "Since v2.0, permalinks for pages" +
" in subfolders must be relative to the" +
" site source directory, not the parent" +
" directory. Check http://jekyllrb.com/docs/upgrading/"+
@@ -483,6 +487,17 @@ module Jekyll
@frontmatter_defaults ||= FrontmatterDefaults.new(self)
end
# Whether to perform a full rebuild without metadata
#
# Returns a Boolean: true for a full rebuild, false for normal build
def full_rebuild?(override = {})
override['full_rebuild'] || config['full_rebuild']
end
def publisher
@publisher ||= Publisher.new(self)
end
private
def has_relative_page?
@@ -503,9 +518,5 @@ module Jekyll
name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
name.gsub(/\s+/, '_')
end
def publisher
@publisher ||= Publisher.new(self)
end
end
end

View File

@@ -3,6 +3,8 @@ module Jekyll
# The cache of last modification times [path] -> mtime.
@@mtimes = Hash.new
attr_reader :relative_path
# Initialize a new StaticFile.
#
# site - The Site.
@@ -15,6 +17,7 @@ module Jekyll
@dir = dir
@name = name
@collection = collection
@relative_path = File.join(*[@dir, @name].compact)
end
# Returns source file path.
@@ -22,11 +25,6 @@ module Jekyll
File.join(*[@base, @dir, @name].compact)
end
# Returns the source file path relative to the site source
def relative_path
@relative_path ||= File.join(*[@dir, @name].compact)
end
def extname
File.extname(path)
end
@@ -67,6 +65,8 @@ module Jekyll
true
end
alias_method :regenerate?, :write?
# Write the static file to the destination directory (if modified).
#
# dest - The String path to the destination dir.

View File

@@ -46,14 +46,15 @@ eos
is_safe = !!context.registers[:site].safe
output = case context.registers[:site].highlighter
when 'pygments'
render_pygments(code, is_safe)
when 'rouge'
render_rouge(code)
else
render_codehighlighter(code)
end
output =
case context.registers[:site].highlighter
when 'pygments'
render_pygments(code, is_safe)
when 'rouge'
render_rouge(code)
else
render_codehighlighter(code)
end
rendered_output = add_code_tag(output)
prefix + rendered_output + suffix

View File

@@ -18,6 +18,12 @@ module Jekyll
VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/
VARIABLE_SYNTAX = /(?<variable>[^{]*\{\{\s*(?<name>[\w\-\.]+)\s*(\|.*)?\}\}[^\s}]*)(?<params>.*)/
class << self
def source_cache
@@source_cache ||= {}
end
end
def initialize(tag_name, markup, tokens)
super
@includes_dir = tag_includes_dir
@@ -105,13 +111,22 @@ eos
end
def render(context)
site = context.registers[:site]
dir = resolved_includes_dir(context)
file = render_variable(context) || @file
validate_file_name(file)
path = File.join(dir, file)
validate_path(path, dir, context.registers[:site].safe)
validate_path(path, dir, site.safe)
# Add include to dependency tree
if context.registers[:page] and context.registers[:page].has_key? "path"
site.metadata.add_dependency(
site.in_source_dir(context.registers[:page]["path"]),
path
)
end
begin
partial = Liquid::Template.parse(source(path, context))
@@ -147,7 +162,7 @@ eos
# This method allows to modify the file content by inheriting from the class.
def source(file, context)
File.read(file, file_read_opts(context))
self.class.source_cache[file] ||= File.read(file, file_read_opts(context))
end
end

View File

@@ -3,16 +3,22 @@ module Jekyll
class PostComparer
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)$/
attr_accessor :date, :slug
attr_reader :path, :date, :slug, :name
def initialize(name)
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
@name = name
all, @path, @date, @slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError.new("'#{name}' does not contain valid date and/or title.") unless all
@slug = path ? path + slug : slug
@date = Utils.parse_date(date, "'#{name}' does not contain valid date.")
@name_regex = /^#{path}#{date}-#{slug}\.[^.]+/
end
def ==(other)
other.name.match(@name_regex)
end
def deprecated_equality(other)
date = Utils.parse_date(name, "'#{name}' does not contain valid date and/or title.")
slug == post_slug(other) &&
date.year == other.date.year &&
date.month == other.date.month &&
@@ -59,6 +65,19 @@ eos
end
end
# New matching method did not match, fall back to old method
# with deprecation warning if this matches
site.posts.each do |p|
if @post.deprecated_equality p
Jekyll::Deprecator.deprecation_message "A call to '{{ post_url #{name} }}' did not match " +
"a post using the new matching method of checking name " +
"(path-date-slug) equality. Please make sure that you " +
"change this tag to match the post's name exactly."
return p.url
end
end
raise ArgumentError.new <<-eos
Could not find post "#{@orig_post}" in tag 'post_url'.

View File

@@ -90,7 +90,7 @@ module Jekyll
# Returns the parsed date if successful, throws a FatalException
# if not
def parse_date(input, msg = "Input could not be parsed.")
Time.parse(input)
Time.parse(input).localtime
rescue ArgumentError
raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
end
@@ -113,7 +113,7 @@ module Jekyll
unless string.nil?
string \
# Replace each non-alphanumeric character sequence with a hyphen
.gsub(/[^a-z0-9]+/i, '-') \
.gsub(/[^[:alnum:]]+/i, '-') \
# Remove leading/trailing hyphen
.gsub(/^\-|\-$/i, '') \
# Downcase it

View File

@@ -1,3 +1,3 @@
module Jekyll
VERSION = '2.5.0'
VERSION = '2.5.3'
end

View File

@@ -1,12 +1,12 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
</head>

View File

@@ -1,14 +1,14 @@
---
layout: default
---
<div class="post">
<article class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<article class="post-content">
<div class="post-content">
{{ content }}
</article>
</div>
</div>
</article>

View File

@@ -1,15 +1,15 @@
---
layout: default
---
<div class="post">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
</header>
<article class="post-content">
<div class="post-content" itemprop="articleBody">
{{ content }}
</article>
</div>
</div>
</article>

View File

@@ -35,9 +35,9 @@
color: $text-color;
line-height: $base-line-height;
// Gaps between nav items, but not on the first one
&:not(:first-child) {
margin-left: 20px;
// Gaps between nav items, but not on the last one
&:not(:last-child) {
margin-right: 20px;
}
}

View File

@@ -1,4 +1,4 @@
#!/bin/sh
script/branding
bundle install
bundle install -j8

View File

@@ -6,11 +6,11 @@ export BENCHMARK=true
command -v stackprof > /dev/null || script/bootstrap
TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})"
PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d).dump
PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d%H%M).dump
test -f "$PROF_OUTPUT_FILE" || {
bundle exec ruby -r./lib/jekyll -rstackprof \
-e "StackProf.run(mode: :cpu, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }"
-e "StackProf.run(mode: :cpu, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }"
}
bundle exec stackprof $PROF_OUTPUT_FILE $@

View File

@@ -10,7 +10,15 @@ else
TEST_FILES="$@"
fi
RAKE_LIB_DIR=$(ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir + '/lib'")
# bundle exec gem env
GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2)
RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'")
RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}"
test -d "${RAKE_LIB_DIR}" || {
echo "No ${RAKE_LIB_DIR}. Installing Rake."
bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v
}
set -x

View File

@@ -1 +0,0 @@
Jekyll's awesome website.

15
site/README.md Normal file
View File

@@ -0,0 +1,15 @@
# Jekyll docs site
This directory contains the code for the Jekyll docs site, [jekyllrb.com](http://jekyllrb.com/).
## Contributing
For information about contributing, see the [Contributing page](http://jekyllrb.com/docs/contributing/).
## Running locally
You can preview your contributions before opening a pull request by running from within the directory:
1. `bundle install`
2. `bundle exec rake site:preview`
It's just a jekyll site, afterall! :wink:

View File

@@ -2,7 +2,7 @@ markdown: kramdown
highlighter: pygments
relative_permalinks: false
permalink: /news/:year/:month/:day/:title/
excerpt_separator: noifniof3nioaniof3nioafafinoafnoif
excerpt_separator: ""
gauges_id: 503c5af6613f5d0f19000027
google_analytics_id: UA-50755011-1

View File

@@ -87,6 +87,20 @@ class="flag">flags</code> (specified on the command-line) that control them.
<p><code class="option">include: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Keep files</strong></p>
<p class="description">
When clobbering the site destination, keep the selected files.
Useful for files that are not generated by jekyll; e.g. files or
assets that are generated by your build tool.
The paths are relative to the <code>destination</code>.
</p>
</td>
<td class="align-center">
<p><code class="option">keep_files: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Time Zone</strong></p>
@@ -137,6 +151,17 @@ class="flag">flags</code> (specified on the command-line) that control them.
</table>
</div>
<div class="note warning">
<h5>Destination folders are cleaned on site builds</h5>
<p>
The contents of <code>&lt;destination&gt;</code> are automatically
cleaned when the site is built. Files or folders that are not
created by your site will be removed. Do not use an important
location for <code>&lt;destination&gt;</code>; instead, use it as
a staging area and copy files from there to your web server.
</p>
</div>
### Build Command Options
<div class="mobile-side-scroller">
@@ -223,6 +248,16 @@ class="flag">flags</code> (specified on the command-line) that control them.
<p><code class="flag">-V, --verbose</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Silence Output</strong></p>
<p class="description">Silence the normal output from Jekyll
during a build</p>
</td>
<td class="align-center">
<p><code class="flag">-q, --quiet</code></p>
</td>
</tr>
</tbody>
</table>
</div>
@@ -462,7 +497,7 @@ excerpt_separator: "\n\n"
# Serving
detach: false
port: 4000
host: 0.0.0.0
host: 127.0.0.1
baseurl: "" # does not include hostname
# Backwards-compatibility
@@ -492,12 +527,12 @@ redcarpet:
extensions: []
kramdown:
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
use_coderay: false
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
enable_coderay: false
coderay:
coderay_wrap: div

View File

@@ -23,8 +23,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
As explained on the [directory structure](../structure/) page, the `_data`
folder is where you can store additional data for Jekyll to use when generating
your site. These files must be YAML files (using either the `.yml`, `.yaml` or `.json`
extension) and they will be accessible via `site.data`.
your site. These files must be YAML files (using either the `.yml`, `.yaml`, `.json`
or `csv` extension) and they will be accessible via `site.data`.
## Example: List of members
@@ -44,6 +44,15 @@ In `_data/members.yml`:
github: liufengyun
{% endhighlight %}
Or `_data/members.csv`:
{% highlight text %}
name,github
Tom Preston-Werner,mojombo
Parker Moore,parkr
Liu Fengyun,liufengyun
{% endhighlight %}
This data can be accessed via `site.data.members` (notice that the filename
determines the variable name).

View File

@@ -2,7 +2,7 @@
layout: docs
title: Deployment methods
prev_section: github-pages
next_section: troubleshooting
next_section: continuous-integration
permalink: /docs/deployment-methods/
---

View File

@@ -5,6 +5,85 @@ permalink: "/docs/history/"
prev_section: contributing
---
## 2.5.3 / 2014-12-22
{: #v2-5-3}
### Bug Fixes
{: #bug-fixes-v2-5-3}
- When checking a Markdown extname, include position of the `.` ([#3147]({{ site.repository }}/issues/3147))
- Fix `jsonify` Liquid filter handling of boolean values ([#3154]({{ site.repository }}/issues/3154))
- Add comma to value of `viewport` meta tag ([#3170]({{ site.repository }}/issues/3170))
- Set the link type for the RSS feed to `application/rss+xml` ([#3176]({{ site.repository }}/issues/3176))
- Refactor `#as_liquid` ([#3158]({{ site.repository }}/issues/3158))
### Development Fixes
{: #development-fixes-v2-5-3}
- Exclude built-in bundles from being added to coverage report ([#3180]({{ site.repository }}/issues/3180))
### Site Enhancements
{: #site-enhancements-v2-5-3}
- Add `[@alfredxing](https://github.com/alfredxing)` to the `[@jekyll](https://github.com/jekyll)/core` team. :tada: ([#3218]({{ site.repository }}/issues/3218))
- Document the `-q` option for the `build` and `serve` commands ([#3149]({{ site.repository }}/issues/3149))
- Fix some minor typos/flow fixes in documentation website content ([#3165]({{ site.repository }}/issues/3165))
- Add `keep_files` to configuration documentation ([#3162]({{ site.repository }}/issues/3162))
- Repeat warning about cleaning of the `destination` directory ([#3161]({{ site.repository }}/issues/3161))
- Add jekyll-500px-embed to list of third-party plugins ([#3163]({{ site.repository }}/issues/3163))
- Simplified platform detection in Gemfile example for Windows ([#3177]({{ site.repository }}/issues/3177))
- Add the `jekyll-jalali` plugin added to the list of third-party plugins. ([#3198]({{ site.repository }}/issues/3198))
- Add Table of Contents to Troubleshooting page ([#3196]({{ site.repository }}/issues/3196))
- Add `inline_highlight` plugin to list of third-party plugins ([#3212]({{ site.repository }}/issues/3212))
- Add `jekyll-mermaid` plugin to list of third-party plugins ([#3222]({{ site.repository }}/issues/3222))
## 2.5.2 / 2014-11-17
{: #v2-5-2}
### Minor Enhancements
{: #minor-enhancements-v2-5-2}
- `post_url` should match `post.name` instead of slugs and dates ([#3058]({{ site.repository }}/issues/3058))
### Bug Fixes
{: #bug-fixes-v2-5-2}
- Fix bundle require for `:jekyll_plugins` ([#3119]({{ site.repository }}/issues/3119))
- Remove duplicate regexp phrase: `^\A` ([#3089]({{ site.repository }}/issues/3089))
- Remove duplicate `Conversion error:` message in `Convertible` ([#3088]({{ site.repository }}/issues/3088))
- Print full conversion error message in `Renderer#convert` ([#3090]({{ site.repository }}/issues/3090))
### Site Enhancements
{: #site-enhancements-v2-5-2}
- Change variable names in Google Analytics script ([#3093]({{ site.repository }}/issues/3093))
- Mention CSV files in the docs for data files ([#3101]({{ site.repository }}/issues/3101))
- Add trailing slash to `paginate_path` example. ([#3091]({{ site.repository }}/issues/3091))
- Get rid of noifniof (`excerpt_separator`) ([#3094]({{ site.repository }}/issues/3094))
- Sass improvements, around nesting mostly. ([#3123]({{ site.repository }}/issues/3123))
- Add webmentions.io plugin to the list of third-party plugins ([#3127]({{ site.repository }}/issues/3127))
- Add Sass mixins and use them. ([#2904]({{ site.repository }}/issues/2904))
- Slightly compress jekyll-sticker.jpg. ([#3133]({{ site.repository }}/issues/3133))
- Update gridism and separate out related but custom styles. ([#3132]({{ site.repository }}/issues/3132))
- Add remote-include plugin to list of third-party plugins ([#3136]({{ site.repository }}/issues/3136))
## 2.5.1 / 2014-11-09
{: #v2-5-1}
### Bug Fixes
{: #bug-fixes-v2-5-1}
- Fix path sanitation bug related to Windows drive names ([#3077]({{ site.repository }}/issues/3077))
### Development Fixes
{: #development-fixes-v2-5-1}
- Add development time dependencies on minitest and test-unit to gemspec for cygwin ([#3064]({{ site.repository }}/issues/3064))
- Use Travis's built-in caching. ([#3075]({{ site.repository }}/issues/3075))
## 2.5.0 / 2014-11-06
{: #v2-5-0}

View File

@@ -60,7 +60,7 @@ and associated URLs might look like:
### Named folders containing index HTML files
There is nothing wrong with the above method, however some people like to keep
There is nothing wrong with the above method. However, some people like to keep
their URLs free from things like filename extensions. To achieve clean URLs for
pages using Jekyll, you simply need to create a folder for each top-level page
you want, and then place an `index.html` file in each pages folder. This way

View File

@@ -32,14 +32,14 @@ paginate: 5
The number should be the maximum number of Posts youd like to be displayed per-
page in the generated site.
You may also specify where the destination of the pagination pages:
You may also specify the destination of the pagination pages:
{% highlight yaml %}
paginate_path: "blog/page:num"
paginate_path: "blog/page:num/"
{% endhighlight %}
This will read in `blog/index.html`, send it each pagination page in Liquid as `paginator`
and write the output to `blog/page:num`, where `:num` is the pagination page number,
and write the output to `blog/page:num/`, where `:num` is the pagination page number,
starting with `2`. If a site has 12 posts and specifies `paginate: 5`, Jekyll will write
`blog/index.html` with the first 5 posts, `blog/page2/index.html` with the next 5 posts
and `blog/page3/index.html` with the last 2 posts into the destination directory.
@@ -155,13 +155,13 @@ title: My Blog
<!-- Pagination links -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="/page{{ paginator.previous_page }}" class="previous">Previous</a>
<a href="{{ paginator.previous_page_path }}" class="previous">Previous</a>
{% else %}
<span class="previous">Previous</span>
{% endif %}
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
{% if paginator.next_page %}
<a href="/page{{ paginator.next_page }}" class="next">Next</a>
<a href="{{ paginator.next_page_path }}" class="next">Next</a>
{% else %}
<span class="next ">Next</span>
{% endif %}

View File

@@ -13,8 +13,8 @@ having to modify the Jekyll source itself.
<div class="note info">
<h5>Plugins on GitHub Pages</h5>
<p>
<a href="http://pages.github.com/">GitHub Pages</a> is powered by Jekyll,
however all Pages sites are generated using the <code>--safe</code> option
<a href="http://pages.github.com/">GitHub Pages</a> is powered by Jekyll.
However, all Pages sites are generated using the <code>--safe</code> option
to disable custom plugins for security reasons. Unfortunately, this means
your plugins wont work if youre deploying to GitHub Pages.<br><br>
You can still use GitHub Pages to publish your site, but youll need to
@@ -66,11 +66,8 @@ based on your own rules.
A generator is a subclass of `Jekyll::Generator` that defines a `generate`
method, which receives an instance of
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb).
Generation is triggered for its side-effects, the return value of `generate` is
ignored. Jekyll does not assume any particular side-effect to happen, it just
runs the method.
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). The
return value of `generate` is ignored.
Generators run after Jekyll has made an inventory of the existing content, and
before the site is generated. Pages with YAML Front Matters are stored as
@@ -533,6 +530,8 @@ You can find a few useful plugins at the following locations:
- [jekyll-humanize](https://github.com/23maverick23/jekyll-humanize): This is a port of the Django app humanize which adds a "human touch" to data. Each method represents a Fluid type filter that can be used in your Jekyll site templates. Given that Jekyll produces static sites, some of the original methods do not make logical sense to port (e.g. naturaltime).
- [Jekyll-Ordinal](https://github.com/PatrickC8t/Jekyll-Ordinal): Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th".
- [Deprecated articles keeper](https://github.com/kzykbys/JekyllPlugins) by [Kazuya Kobayashi](http://blog.kazuya.co/): A simple Jekyll filter which monitor how old an article is.
- [Jekyll-jalali](https://github.com/mehdisadeghi/jekyll-jalali) by [Mehdi Sadeghi](http://mehdix.ir): A simple Gregorian to Jalali date converter filter.
- [Jekyll Thumbnail Filter](https://github.com/matallo/jekyll-thumbnail-filter): Related posts thumbnail filter.
#### Tags
@@ -579,7 +578,10 @@ You can find a few useful plugins at the following locations:
- [Jekyll Project Version Tag](https://github.com/rob-murray/jekyll-version-plugin): A Liquid tag plugin that renders a version identifier for your Jekyll site sourced from the git repository containing your code.
- [Piwigo Gallery](https://github.com/AlessandroLorenzi/piwigo_gallery) by [Alessandro Lorenzi](http://www.alorenzi.eu/): Jekyll plugin to generate thumbnails from a Piwigo gallery and display them with a Liquid tag
- [mathml.rb](https://github.com/tmthrgd/jekyll-plugins) by [Tom Thorogood](http://tomthorogood.co.uk/): A plugin to convert TeX mathematics into MathML for display.
- [webmention_io.rb](https://github.com/aarongustafson/jekyll-webmention_io) by [Aaron Gustafson](http://aaron-gustafson.com/): A plugin to enable [webmention](http://indiewebcamp.com/webmention) integration using [Webmention.io](http://webmention.io). Includes an optional JavaScript for updating webmentions automatically between publishes and, if available, in realtime using WebSockets.
- [Jekyll 500px Embed](https://github.com/lkorth/jekyll-500px-embed) by [Luke Korth](https://lukekorth.com/). A Liquid tag plugin that embeds [500px](https://500px.com/) photos.
- [inline\_highlight](https://github.com/bdesham/inline_highlight): A tag for inline syntax highlighting.
- [jekyll-mermaid](https://github.com/jasonbellamy/jekyll-mermaid): Simplify the creation of mermaid diagrams and flowcharts in your posts and pages.
#### Collections
@@ -612,6 +614,7 @@ You can find a few useful plugins at the following locations:
- [jekyll-postfiles](https://github.com/indirect/jekyll-postfiles): Add `_postfiles` directory and {% raw %}`{{ postfile }}`{% endraw %} tag so the files a post refers to will always be right there inside your repo.
- [A layout that compresses HTML](https://github.com/penibelst/jekyll-compress-html) by [Anatol Broder](http://penibelst.de/): Github Pages compatible, configurable way to compress HTML files on site build.
- [Jekyll CO₂](https://github.com/wdenton/jekyll-co2): Generates HTML showing the monthly change in atmospheric CO₂ at the Mauna Loa observatory in Hawaii.
- [remote-include](http://www.northfieldx.co.uk/remote-include/): Includes files using remote URLs
#### Editors

View File

@@ -134,6 +134,11 @@ Of course, you have full control over how (and where) you display your posts,
and how you structure your site. You should read more about [how templates
work](../templates/) with Jekyll if you want to know more.
Note that the `post` variable only exists inside the `for` loop above. If
you wish to access the currently-rendering page/posts's variables (the
variables of the post/page that has the `for` loop in it), use the `page`
variable instead.
## Post excerpts
Each post automatically takes the first block of text, from the beginning of the content

View File

@@ -38,9 +38,11 @@ Jekylls growing use is producing a wide variety of tutorials, frameworks, ext
> “Jekyll is everything that I ever wanted in a blogging engine. Really. It isnt perfect, but whats excellent about it is that if theres something wrong, I know exactly how it works and how to fix it. It runs on the your machine only, and is essentially an added”build" step between you and the browser. I coded this entire site in TextMate using standard HTML5 and CSS3, and then at the end I added just a few little variables to the markup. Presto-chango, my site is built and I am at peace with the world.”
- [Build A Blog With Jekyll And GitHub Pages, by Barry Clark](http://www.smashingmagazine.com/2014/08/01/build-blog-jekyll-github-pages/)
> “I recently migrated my blog from WordPress to Jekyll, a fantastic website generator thats designed for building minimal, static blogs to be hosted on GitHub Pages. The simplicity of Jekylls theming layer and writing workflow is fantastic; however, setting up my website took a lot longer than expected. In this article we'll walk through: the quickest way to set up a Jekyll powered blog, how to avoid common problems with using Jekyll, how to import your content from Wordpress, and more.”
- [Generating a Tag Cloud in Jekyll](http://www.justkez.com/generating-a-tag-cloud-in-jekyll/)
- [Generating a Tag Cloud in Jekyll](http://www.justkez.com/generating-a-tag-cloud-in-jekyll/)
A guide to implementing a tag cloud and per-tag content pages using Jekyll.
- A way to [extend Jekyll](https://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](https://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared.
- [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll)
- [Adding Ajax pagination to Jekyll](http://eduardoboucas.com/blog/2014/11/10/adding-ajax-pagination-to-jekyll.html)
- [Using Jekylls Data Files to build a dynamic navbar](http://www.jordanthornque.st/blog/building-dynamic-navbars-with-jekyll/)

View File

@@ -303,10 +303,10 @@ You can also choose to include file fragments relative to the current file:
You won't need to place your included content within the `_includes` directory. Instead,
the inclusion is specifically relative to the file where the tag is being used. For example,
if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file
must be within the `_posts` directory, or one of it's subdirectories. You cannot include
must be within the `_posts` directory, or one of its subdirectories. You cannot include
files in other locations.
All the other capaibilities of the `include` tag are available to the `include_relative` tag,
All the other capabilities of the `include` tag are available to the `include_relative` tag,
such as using variables.
### Code snippet highlighting

View File

@@ -11,6 +11,12 @@ that might be of help. If the problem youre experiencing isnt covered belo
please [report an issue]({{site.help_url}}/issues/new) so the
Jekyll community can make everyones experience better.
- [Installation Problems](#installation-problems)
- [Problems running Jekyll](#problems-running-jekyll)
- [Base-URL Problems](#base-url-problems)
- [Configuration problems](#configuration-problems)
- [Markup Problems](#markup-problems)
## Installation Problems
If you encounter errors during gem installation, you may need to install

View File

@@ -81,4 +81,7 @@ $ jekyll build --source _source --destination _deploy
{% endhighlight %}
For more about the possible configuration options, see the
[configuration](../configuration/) page.
[configuration](../configuration/) page.
If you're interested in browsing these docs on-the-go, install the
`jekyll-docs` gem and run `jekyll docs` in your terminal.

View File

@@ -39,6 +39,5 @@ built-in support for UNIX systems, it requires an extra gem for compatibility
with Windows. Add the following to the Gemfile for your site:
{% highlight ruby %}
require 'rbconfig'
gem 'wdm', '~> 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
gem 'wdm', '~> 0.1.0' if Gem.win_platform?
{% endhighlight %}

View File

@@ -18,10 +18,10 @@
{% if site.google_analytics_id %}
<!-- Google Analytics (http://google.com/analytics) -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
!function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
(j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
L=e.getElementsByTagName(k)[0],l.src='//www.google-analytics.com/analytics.js',
L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
ga('create', '{{ site.google_analytics_id }}', 'jekyllrb.com');
ga('send', 'pageview');

View File

@@ -1,6 +1,6 @@
---
layout: news_item
title: "Jekyll's Mid-Life Crisis"
title: "Jekyll's Mid-Life Crisis (Or, Jekyll turns 2.5.0)"
date: 2014-11-05 10:48:22 -0800
author: parkr
version: 2.5.0
@@ -38,3 +38,10 @@ tidbits, such as the old name for Jekyll was "autoblog", and was first
released via Rubyforge. What a difference 6 years has made!*
Thanks to the following contributors for making this release possible:
Parker Moore, XhmikosR, Alfred Xing, Ruslan Korolev, Pat Hawks,
chrisfinazzo, Mike Kruk, Tanguy Krotoff, Matt Hickford, Philipp Rudloff,
Rob Murray, Sean Collins, Seth Warburton, Tom Thorogood, Vasily Vasinov,
Veres Lajos, feivel, mitaa, nitoyon, snrbrnjna, tmthrgd, Bret Comnes,
Charles Baynham, Christian Mayer, Dan Croak, Frederic Hemberger, Glauco
Custódio, Igor Kapkov, and Kevin Ndung'u!

View File

@@ -0,0 +1,29 @@
---
layout: news_item
title: 'Jekyll 2.5.1 Released'
date: 2014-11-09 09:47:52 -0800
author: parkr
version: 2.5.1
categories: [release]
---
Hot on the heels of v2.5.0, this release brings relief to our Windows
users. It includes a fix for a 2.5.0 path sanitation change that has been
confirmed to work on Windows.
To our Windows users: while we don't officially support Windows, we don't
wish to impede your normal use of Jekyll at all. Our lack of full support
for Windows is due to our lack of a Windows machine for development testing
(no one on the core team has a Windows machine upon which to test new
release candidates), not due to any malice or willful oversight. If you
come to us with an issue, we are more than happy to work through it with
you to come to a solution that works for all platforms. Along those lines,
we have created a [**Windows Test Force**][] (WTF) which is a group of Jekyll
users dedicated to making sure all future releases work on Windows *before*
they're released so we don't have this issue again. A special thanks goes
out to the initial WTF team members, XhmikosR, Julian Thilo, Pedro Rogério,
and Alfred Xing.
Happy Jekylling!
[**Windows Test Force**]: https://github.com/jekyll/jekyll/issues/3069

View File

@@ -0,0 +1,18 @@
---
layout: news_item
title: 'Jekyll 2.5.2 Released'
date: 2014-11-12 18:49:08 -0800
author: parkr
version: 2.5.2
categories: [release]
---
A very minor release, 2.5.2 fixes a bug with path sanitation that 2.5.1
introduced. It also improves the `post_url` tag such that it checks the
posts' name (e.g. `2014-03-03-my-cool-post`) instead of a compiled time and
name. This fixes issues where posts are created and the day changes based
on timezone discrepancies.
[Full history here.](/docs/history/)
Happy Jekylling!

View File

@@ -0,0 +1,27 @@
---
layout: news_item
title: 'Alfred Xing has joined the Jekyll core team'
date: 2014-12-17 11:16:21 -0800
author: parkr
version: alfredxing
categories: [team]
---
We're excited to announce that [@alfredxing][] has joined the @jekyll/core
team!
He hails from Vancouver, BC, Canada, where he is studying Economics and
Computer Science at the [University of British Columbia][]. Alfred popped up in
the issues a few months ago with terrific insights, focus, and humility.
Performance buffs may be pleased to hear incremental regeneration will be
released in a future version of Jekyll -- a significant piece of the
feature written by Alfred.
Please join me in welcoming Alfred to the Jekyll core team. We're excited
he's agreed to lend his talents to this project. The future is an exciting
place!
Happy Jekylling!
[@alfredxing]: https://github.com/alfredxing
[University of British Columbia]: http://ubc.ca

View File

@@ -0,0 +1,20 @@
---
layout: news_item
title: 'Jekyll Release for the Holidays! v2.5.3 Out'
date: 2014-12-22 09:03:30 -0500
author: parkr
version: 2.5.3
categories: [release]
---
Happy Holidays, everyone.
Jekyll v2.5.3 is a quick patch release, containing some minor fixes. See the
[full history](/docs/history/) for more info. If you notice any problems,
please [let us know]({{ site.help_url }}).
This release also marks the start of Jekyll 3 development. I wrote about it
over on my personal blog: [Jekyll 3 &mdash; The Road Ahead](https://byparker.com/blog/2014/jekyll-3-the-road-ahead/).
Feel free to chime in over on GitHub.
Happy Jekylling!

View File

@@ -20,24 +20,3 @@
.fa-link:before {
content: "\f0c1";
}
/*
* This code is courtesy Ben Balter, modified by Parker Moore for jekyllrb.com
* http://ben.balter.com/2014/03/13/pages-anchor-links/
*/
.header-link {
position: relative;
left: 0.5em;
opacity: 0;
font-size: 0.8em;
-webkit-transition: opacity 0.2s ease-in-out 0.1s;
-moz-transition: opacity 0.2s ease-in-out 0.1s;
-o-transition: opacity 0.2s ease-in-out 0.1s;
transition: opacity 0.2s ease-in-out 0.1s;
}
h2:hover .header-link,
h3:hover .header-link,
h4:hover .header-link,
h5:hover .header-link,
h6:hover .header-link {
opacity: 1;
}

View File

@@ -53,8 +53,10 @@
.grid .half, .grid .w-1-2 { width: 50%; }
.grid .one-third, .grid .w-1-3 { width: 33.3332%; }
.grid .two-thirds, .grid .w-2-3 { width: 66.6665%; }
.grid .one-quarter, .grid .w-1-4 { width: 25%; }
.grid .three-quarters, .grid .w-3-4 { width: 75%; }
.grid .one-quarter,
.grid .one-fourth, .grid .w-1-4 { width: 25%; }
.grid .three-quarters,
.grid .three-fourths, .grid .w-3-4 { width: 75%; }
.grid .one-fifth, .grid .w-1-5 { width: 20%; }
.grid .two-fifths, .grid .w-2-5 { width: 40%; }
.grid .three-fifths, .grid .w-3-5 { width: 60%; }
@@ -62,6 +64,19 @@
.grid .golden-small, .grid .w-g-s { width: 38.2716%; } /* Golden section: smaller piece */
.grid .golden-large, .grid .w-g-l { width: 61.7283%; } /* Golden section: larger piece */
/* Clearfix after every .grid */
.grid {
*zoom: 1;
}
.grid:before, .grid:after {
display: table;
content: "";
line-height: 0;
}
.grid:after {
clear: both;
}
/* Utility classes */
.align-center { text-align: center; }
.align-left { text-align: left; }
@@ -69,14 +84,18 @@
.pull-left { float: left; }
.pull-right { float: right; }
.show-on-mobiles {
display: none;
/* A property for a better rendering of images in units: in
this way bigger pictures are just resized if the unit
becomes smaller */
.unit img {
max-width: 100%;
}
/* Responsive Stuff */
@media screen and (max-width: 568px) {
/* Stack anything that isnt full-width on smaller screens */
.grid .unit {
/* Stack anything that isnt full-width on smaller screens
and doesn't provide the no-stacking-on-mobiles class */
.grid:not(.no-stacking-on-mobiles) > .unit {
width: 100% !important;
padding-left: 20px;
padding-right: 20px;
@@ -93,18 +112,13 @@
.hide-on-mobiles {
display: none !important;
}
.show-on-mobiles {
display: block !important;
}
a .show-on-mobiles {
display: inline !important;
}
}
/* Expand the wrap a bit further on larger screens */
/*@media screen and (min-width: 1180px) {
.wrap .grid {
@media screen and (min-width: 1180px) {
.wider .grid,
.grid.wider {
max-width: 1180px;
margin: 0 auto;
}
}*/
}

38
site/_sass/_mixins.scss Normal file
View File

@@ -0,0 +1,38 @@
@mixin box-shadow($shadow...) {
-webkit-box-shadow: $shadow;
-moz-box-shadow: $shadow;
box-shadow: $shadow;
}
@mixin border-radius($radius...) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
@mixin border-top-left-radius($radius...) {
-webkit-border-top-left-radius: $radius;
-moz-border-radius-topleft: $radius;
border-top-left-radius: $radius;
}
@mixin border-top-right-radius($radius...) {
-webkit-border-top-right-radius: $radius;
-moz-border-radius-topright: $radius;
border-top-right-radius: $radius;
}
@mixin transition($transition...) {
-webkit-transition: $transition;
-moz-transition: $transition;
-o-transition: $transition;
transition: $transition;
}
@mixin user-select($select...) {
-webkit-user-select: $select; /* Chrome all / Safari all */
-moz-user-select: $select; /* Firefox all */
-ms-user-select: $select; /* IE 10+ */
-o-user-select: $select;
user-select: $select;
}

View File

@@ -1,72 +1,78 @@
/*.highlight { background: #333333; color: #ffffff}*/
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #87ceeb} /* Comment */
.highlight .err { color: #ffffff} /* Error */
.highlight .g { color: #ffffff} /* Generic */
.highlight .k { color: #f0e68c} /* Keyword */
.highlight .l { color: #ffffff} /* Literal */
.highlight .n { color: #ffffff} /* Name */
.highlight .o { color: #ffffff} /* Operator */
.highlight .x { color: #ffffff} /* Other */
.highlight .p { color: #ffffff} /* Punctuation */
.highlight .cm { color: #87ceeb} /* Comment.Multiline */
.highlight .cp { color: #cd5c5c} /* Comment.Preproc */
.highlight .c1 { color: #87ceeb} /* Comment.Single */
.highlight .cs { color: #87ceeb} /* Comment.Special */
.highlight .gd { color: #0000c0; font-weight: bold; background-color: #008080 } /* Generic.Deleted */
.highlight .ge { color: #c000c0; text-decoration: underline} /* Generic.Emph */
.highlight .gr { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Error */
.highlight .gh { color: #cd5c5c} /* Generic.Heading */
.highlight .gi { color: #ffffff; background-color: #0000c0 } /* Generic.Inserted */
.highlight span.go { color: #add8e6; font-weight: bold; background-color: #4d4d4d } /* Generic.Output, qualified with span to prevent applying this style to the Go language, see #1153. */
.highlight .gp { color: #ffffff} /* Generic.Prompt */
.highlight .gs { color: #ffffff} /* Generic.Strong */
.highlight .gu { color: #cd5c5c} /* Generic.Subheading */
.highlight .gt { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Traceback */
.highlight .kc { color: #f0e68c} /* Keyword.Constant */
.highlight .kd { color: #f0e68c} /* Keyword.Declaration */
.highlight .kn { color: #f0e68c} /* Keyword.Namespace */
.highlight .kp { color: #f0e68c} /* Keyword.Pseudo */
.highlight .kr { color: #f0e68c} /* Keyword.Reserved */
.highlight .kt { color: #bdb76b} /* Keyword.Type */
.highlight .ld { color: #ffffff} /* Literal.Date */
.highlight .m { color: #ffffff} /* Literal.Number */
.highlight .s { color: #ffffff} /* Literal.String */
.highlight .na { color: #ffffff} /* Name.Attribute */
.highlight .nb { color: #ffffff} /* Name.Builtin */
.highlight .nc { color: #ffffff} /* Name.Class */
.highlight .no { color: #ffa0a0} /* Name.Constant */
.highlight .nd { color: #ffffff} /* Name.Decorator */
.highlight .ni { color: #ffdead} /* Name.Entity */
.highlight .ne { color: #ffffff} /* Name.Exception */
.highlight .nf { color: #ffffff} /* Name.Function */
.highlight .nl { color: #ffffff} /* Name.Label */
.highlight .nn { color: #ffffff} /* Name.Namespace */
.highlight .nx { color: #ffffff} /* Name.Other */
.highlight .py { color: #ffffff} /* Name.Property */
.highlight .nt { color: #f0e68c} /* Name.Tag */
.highlight .nv { color: #98fb98} /* Name.Variable */
.highlight .ow { color: #ffffff} /* Operator.Word */
.highlight .w { color: #ffffff} /* Text.Whitespace */
.highlight .mf { color: #ffffff} /* Literal.Number.Float */
.highlight .mh { color: #ffffff} /* Literal.Number.Hex */
.highlight .mi { color: #ffffff} /* Literal.Number.Integer */
.highlight .mo { color: #ffffff} /* Literal.Number.Oct */
.highlight .sb { color: #ffffff} /* Literal.String.Backtick */
.highlight .sc { color: #ffffff} /* Literal.String.Char */
.highlight .sd { color: #ffffff} /* Literal.String.Doc */
.highlight .s2 { color: #ffffff} /* Literal.String.Double */
.highlight .se { color: #ffffff} /* Literal.String.Escape */
.highlight .sh { color: #ffffff} /* Literal.String.Heredoc */
.highlight .si { color: #ffffff} /* Literal.String.Interpol */
.highlight .sx { color: #ffffff} /* Literal.String.Other */
.highlight .sr { color: #ffffff} /* Literal.String.Regex */
.highlight .s1 { color: #ffffff} /* Literal.String.Single */
.highlight .ss { color: #ffffff} /* Literal.String.Symbol */
.highlight .bp { color: #ffffff} /* Name.Builtin.Pseudo */
.highlight .vc { color: #98fb98} /* Name.Variable.Class */
.highlight .vg { color: #98fb98} /* Name.Variable.Global */
.highlight .vi { color: #98fb98} /* Name.Variable.Instance */
.highlight .il { color: #ffffff} /* Literal.Number.Integer.Long */
.highlight .bash .nv {-webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; }
.highlight {
.hll { background-color: #ffffcc }
.c { color: #87ceeb} /* Comment */
.err { color: #ffffff} /* Error */
.g { color: #ffffff} /* Generic */
.k { color: #f0e68c} /* Keyword */
.l { color: #ffffff} /* Literal */
.n { color: #ffffff} /* Name */
.o { color: #ffffff} /* Operator */
.x { color: #ffffff} /* Other */
.p { color: #ffffff} /* Punctuation */
.cm { color: #87ceeb} /* Comment.Multiline */
.cp { color: #cd5c5c} /* Comment.Preproc */
.c1 { color: #87ceeb} /* Comment.Single */
.cs { color: #87ceeb} /* Comment.Special */
.gd { color: #0000c0; font-weight: bold; background-color: #008080 } /* Generic.Deleted */
.ge { color: #c000c0; text-decoration: underline} /* Generic.Emph */
.gr { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Error */
.gh { color: #cd5c5c} /* Generic.Heading */
.gi { color: #ffffff; background-color: #0000c0 } /* Generic.Inserted */
span.go { color: #add8e6; font-weight: bold; background-color: #4d4d4d } /* Generic.Output, qualified with span to prevent applying this style to the Go language, see #1153. */
.gp { color: #ffffff} /* Generic.Prompt */
.gs { color: #ffffff} /* Generic.Strong */
.gu { color: #cd5c5c} /* Generic.Subheading */
.gt { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Traceback */
.kc { color: #f0e68c} /* Keyword.Constant */
.kd { color: #f0e68c} /* Keyword.Declaration */
.kn { color: #f0e68c} /* Keyword.Namespace */
.kp { color: #f0e68c} /* Keyword.Pseudo */
.kr { color: #f0e68c} /* Keyword.Reserved */
.kt { color: #bdb76b} /* Keyword.Type */
.ld { color: #ffffff} /* Literal.Date */
.m { color: #ffffff} /* Literal.Number */
.s { color: #ffffff} /* Literal.String */
.na { color: #ffffff} /* Name.Attribute */
.nb { color: #ffffff} /* Name.Builtin */
.nc { color: #ffffff} /* Name.Class */
.no { color: #ffa0a0} /* Name.Constant */
.nd { color: #ffffff} /* Name.Decorator */
.ni { color: #ffdead} /* Name.Entity */
.ne { color: #ffffff} /* Name.Exception */
.nf { color: #ffffff} /* Name.Function */
.nl { color: #ffffff} /* Name.Label */
.nn { color: #ffffff} /* Name.Namespace */
.nx { color: #ffffff} /* Name.Other */
.py { color: #ffffff} /* Name.Property */
.nt { color: #f0e68c} /* Name.Tag */
.nv { color: #98fb98} /* Name.Variable */
.ow { color: #ffffff} /* Operator.Word */
.w { color: #ffffff} /* Text.Whitespace */
.mf { color: #ffffff} /* Literal.Number.Float */
.mh { color: #ffffff} /* Literal.Number.Hex */
.mi { color: #ffffff} /* Literal.Number.Integer */
.mo { color: #ffffff} /* Literal.Number.Oct */
.sb { color: #ffffff} /* Literal.String.Backtick */
.sc { color: #ffffff} /* Literal.String.Char */
.sd { color: #ffffff} /* Literal.String.Doc */
.s2 { color: #ffffff} /* Literal.String.Double */
.se { color: #ffffff} /* Literal.String.Escape */
.sh { color: #ffffff} /* Literal.String.Heredoc */
.si { color: #ffffff} /* Literal.String.Interpol */
.sx { color: #ffffff} /* Literal.String.Other */
.sr { color: #ffffff} /* Literal.String.Regex */
.s1 { color: #ffffff} /* Literal.String.Single */
.ss { color: #ffffff} /* Literal.String.Symbol */
.bp { color: #ffffff} /* Name.Builtin.Pseudo */
.vc { color: #98fb98} /* Name.Variable.Class */
.vg { color: #98fb98} /* Name.Variable.Global */
.vi { color: #98fb98} /* Name.Variable.Instance */
.il { color: #ffffff} /* Literal.Number.Integer.Long */
.bash .nv {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,9 @@
---
---
@import "mixins";
@import "normalize";
@import "gridism";
@import "style";
@import "pygments";
@import "font-awesome"
@import "font-awesome";
@import "style";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -1 +1 @@
2.5.0
2.5.3

View File

@@ -1,6 +1,9 @@
require 'simplecov'
require 'simplecov-gem-adapter'
SimpleCov.start('gem')
SimpleCov.start('gem') do
add_filter "/vendor/bundle"
add_filter "/vendor/gem"
end
require 'rubygems'
require 'test/unit'
@@ -32,7 +35,8 @@ class Test::Unit::TestCase
def site_configuration(overrides = {})
full_overrides = build_configs(overrides, build_configs({"destination" => dest_dir}))
build_configs({
"source" => source_dir,
"source" => source_dir,
"full_rebuild" => true
}, full_overrides)
end
@@ -46,6 +50,7 @@ class Test::Unit::TestCase
def clear_dest
FileUtils.rm_rf(dest_dir)
FileUtils.rm_rf(source_dir('.jekyll-metadata'))
end
def test_dir(*subdirs)

View File

@@ -0,0 +1,5 @@
---
title: "Jekyll.escape"
---
Signs are nice

View File

@@ -0,0 +1,7 @@
---
title: Non outputted slide
layout: slide
published: false
---
This should not be output

View File

@@ -138,6 +138,7 @@ class TestCollections < Test::Unit::TestCase
_methods/site/generate.md
_methods/site/initialize.md
_methods/um_hi.md
_methods/escape-+\ #%20[].md
], doc.relative_path
end
end

View File

@@ -48,6 +48,10 @@ class TestDocument < Test::Unit::TestCase
assert_equal @document.to_liquid['collection'], "methods"
end
should "output its relative path as path in Liquid" do
assert_equal @document.to_liquid['path'], "_methods/configuration.md"
end
end
context "a document as part of a collection with frontmatter defaults" do
@@ -237,7 +241,7 @@ class TestDocument < Test::Unit::TestCase
end
end
context "a static file in a collection" do
context "documents in a collection" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
@@ -249,6 +253,35 @@ class TestDocument < Test::Unit::TestCase
"destination" => dest_dir
}))
@site.process
@files = @site.collections["slides"].docs
end
context "without output overrides" do
should "be output according to collection defaults" do
assert_not_nil @files.find { |doc| doc.relative_path == "_slides/example-slide-4.html" }
end
end
context "with output overrides" do
should "be output according its front matter" do
assert_nil @files.find { |doc| doc.relative_path == "_slides/non-outputted-slide.html" }
end
end
end
context "a static file in a collection" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
"slides" => {
"output" => true
}
},
"source" => source_dir,
"destination" => dest_dir,
"full_rebuild" => true
}))
@site.process
@document = @site.collections["slides"].files.find { |doc| doc.relative_path == "_slides/octojekyll.png" }
@dest_file = dest_dir("slides/octojekyll.png")
end
@@ -270,4 +303,34 @@ class TestDocument < Test::Unit::TestCase
end
end
context "a document in a collection with non-alphabetic file name" do
setup do
@site = Site.new(Jekyll.configuration({
"collections" => {
"methods" => {
"output" => true
}
},
"source" => source_dir,
"destination" => dest_dir
}))
@site.process
@document = @site.collections["methods"].docs.find { |doc| doc.relative_path == "_methods/escape-+ #%20[].md" }
@dest_file = dest_dir("methods/escape-+ #%20[].html")
end
should "produce the right URL" do
assert_equal "/methods/escape-+%20%23%2520%5B%5D.html", @document.url
end
should "produce the right destination" do
assert_equal @dest_file, @document.destination(dest_dir)
end
should "be output in the correct place" do
assert_equal true, File.file?(@dest_file)
end
end
end

View File

@@ -72,11 +72,11 @@ class TestFilters < Test::Unit::TestCase
end
should "format a time with xmlschema" do
assert_equal "2013-03-27T11:22:33Z", @filter.date_to_xmlschema(@sample_time)
assert_equal "2013-03-27T11:22:33+00:00", @filter.date_to_xmlschema(@sample_time)
end
should "format a time according to RFC-822" do
assert_equal "Wed, 27 Mar 2013 11:22:33 -0000", @filter.date_to_rfc822(@sample_time)
assert_equal "Wed, 27 Mar 2013 11:22:33 +0000", @filter.date_to_rfc822(@sample_time)
end
end
@@ -90,11 +90,11 @@ class TestFilters < Test::Unit::TestCase
end
should "format a time with xmlschema" do
assert_equal "2001-09-11T12:46:30Z", @filter.date_to_xmlschema(@time_as_string)
assert_equal "2001-09-11T12:46:30+00:00", @filter.date_to_xmlschema(@time_as_string)
end
should "format a time according to RFC-822" do
assert_equal "Tue, 11 Sep 2001 12:46:30 -0000", @filter.date_to_rfc822(@time_as_string)
assert_equal "Tue, 11 Sep 2001 12:46:30 +0000", @filter.date_to_rfc822(@time_as_string)
end
end
@@ -155,19 +155,75 @@ class TestFilters < Test::Unit::TestCase
end
class T < Struct.new(:name)
def to_liquid
{ "name" => name, :v => 1, :thing => M.new({:kay => "jewelers"}) }
{ "name" => name, :v => 1, :thing => M.new({:kay => "jewelers"}), :stuff => true }
end
end
should "call #to_liquid " do
expected = "[{\"name\":\"Jeremiah\",\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]},{\"name\":\"Smathers\",\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]}]"
assert_equal expected, @filter.jsonify([T.new("Jeremiah"), T.new("Smathers")])
expected = [
{
"name" => "Jeremiah",
"v" => 1,
"thing" => [
{
"kay" => "jewelers"
}
],
"stuff" => true
},
{
"name" => "Smathers",
"v" => 1,
"thing" => [
{
"kay" => "jewelers"
}
],
"stuff" => true
}
]
result = @filter.jsonify([T.new("Jeremiah"), T.new("Smathers")])
assert_equal expected, JSON.parse(result)
end
should "handle hashes with all sorts of weird keys and values" do
my_hash = { "posts" => Array.new(5) { |i| T.new(i) } }
expected = "{\"posts\":[{\"name\":0,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]},{\"name\":1,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]},{\"name\":2,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]},{\"name\":3,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]},{\"name\":4,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}]}]}"
assert_equal expected, @filter.jsonify(my_hash)
my_hash = { "posts" => Array.new(3) { |i| T.new(i) } }
expected = {
"posts" => [
{
"name" => 0,
"v" => 1,
"thing" => [
{
"kay" => "jewelers"
}
],
"stuff" => true
},
{
"name" => 1,
"v" => 1,
"thing" => [
{
"kay" => "jewelers"
}
],
"stuff" => true
},
{
"name" => 2,
"v" => 1,
"thing" => [
{
"kay" => "jewelers"
}
],
"stuff" => true
}
]
}
result = @filter.jsonify(my_hash)
assert_equal expected, JSON.parse(result)
end
end

View File

@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
end
should "ensure post count is as expected" do
assert_equal 43, @site.posts.size
assert_equal 44, @site.posts.size
end
should "insert site.posts into the index" do

View File

@@ -14,7 +14,7 @@ class TestKramdown < Test::Unit::TestCase
'toc_levels' => '1..6',
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
'use_coderay' => true,
'enable_coderay' => true,
'coderay_bold_every'=> 12,
'coderay' => {
'coderay_css' => :style,

View File

@@ -3,6 +3,11 @@ require 'helper'
class TestLogAdapter < Test::Unit::TestCase
class LoggerDouble
attr_accessor :level
def debug(*); end
def info(*); end
def warn(*); end
def error(*); end
end
context "#log_level=" do
@@ -56,4 +61,20 @@ class TestLogAdapter < Test::Unit::TestCase
assert_raise(SystemExit) { logger.abort_with('topic', 'log message') }
end
end
context "#messages" do
should "return an array" do
assert_equal [], Jekyll::LogAdapter.new(LoggerDouble.new).messages
end
should "store each log value in the array" do
logger = Jekyll::LogAdapter.new(LoggerDouble.new)
values = %w{one two three four}
logger.debug(values[0])
logger.info(values[1])
logger.warn(values[2])
logger.error(values[3])
assert_equal values.map { |value| "#{value} ".rjust(20) }, logger.messages
end
end
end

140
test/test_metadata.rb Normal file
View File

@@ -0,0 +1,140 @@
require 'helper'
class TestMetadata < Test::Unit::TestCase
context "The site metadata" do
setup do
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
@site = Site.new(Jekyll.configuration({
"source" => source_dir,
"destination" => dest_dir
}))
@site.process
@path = @site.in_source_dir(@site.pages.first.path)
@metadata = @site.metadata
end
should "store modification times" do
assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"]
end
should "cache processed entries" do
assert @metadata.cache[@path]
end
should "write to the metadata file" do
@metadata.clear
@metadata.add(@path)
@metadata.write
assert File.file?(source_dir(".jekyll-metadata"))
end
should "read from the metadata file" do
@metadata = Metadata.new(@site)
assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"]
end
# Methods
should "be able to add a path to the metadata" do
@metadata.clear
@metadata.add(@path)
assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"]
assert_equal [], @metadata.metadata[@path]["deps"]
assert @metadata.cache[@path]
end
should "return true on nonexistent path" do
@metadata.clear
assert @metadata.add("/bogus/path.md")
assert @metadata.regenerate?("/bogus/path.md")
end
should "be able to force a path to regenerate" do
@metadata.clear
@metadata.force(@path)
assert @metadata.cache[@path]
assert @metadata.regenerate?(@path)
end
should "be able to clear metadata and cache" do
@metadata.clear
@metadata.add(@path)
assert_equal 1, @metadata.metadata.length
assert_equal 1, @metadata.cache.length
@metadata.clear
assert_equal 0, @metadata.metadata.length
assert_equal 0, @metadata.cache.length
end
should "not regenerate a path if it is not modified" do
@metadata.clear
@metadata.add(@path)
@metadata.write
@metadata = Metadata.new(@site)
assert !@metadata.regenerate?(@path)
end
should "not regenerate if path in cache is false" do
@metadata.clear
@metadata.add(@path)
@metadata.write
@metadata = Metadata.new(@site)
assert !@metadata.regenerate?(@path)
assert !@metadata.cache[@path]
assert !@metadata.regenerate?(@path)
end
should "regenerate if path in not in metadata" do
@metadata.clear
@metadata.add(@path)
assert @metadata.regenerate?(@path)
end
should "regenerate if path in cache is true" do
@metadata.clear
@metadata.add(@path)
assert @metadata.regenerate?(@path)
assert @metadata.cache[@path]
assert @metadata.regenerate?(@path)
end
should "regenerate if file is modified" do
@metadata.clear
@metadata.add(@path)
@metadata.metadata[@path]["mtime"] = Time.at(0)
@metadata.write
@metadata = Metadata.new(@site)
assert_not_same File.mtime(@path), @metadata.metadata[@path]["mtime"]
assert @metadata.regenerate?(@path)
end
should "regenerate if dependency is modified" do
@metadata.clear
@metadata.add(@path)
@metadata.write
@metadata = Metadata.new(@site)
@metadata.add_dependency(@path, "new.dependency")
assert_equal ["new.dependency"], @metadata.metadata[@path]["deps"]
assert @metadata.regenerate?("new.dependency")
assert @metadata.regenerate?(@path)
end
should "regenerate everything if metadata is disabled" do
@site.config["full_rebuild"] = true
@metadata.clear
@metadata.add(@path)
@metadata.write
@metadata = Metadata.new(@site)
assert @metadata.regenerate?(@path)
end
end
end

View File

@@ -79,8 +79,10 @@ class TestNewCommand < Test::Unit::TestCase
should 'force created folder' do
capture_stdout { Jekyll::Commands::New.process(@args) }
assert_nothing_raised(SystemExit) { Jekyll::Commands::New.process(@args, '--force') }
end
assert_nothing_raised(SystemExit) do
capture_stdout {Jekyll::Commands::New.process(@args, '--force') }
end
end
end
context 'when multiple args are given' do

View File

@@ -1,9 +1,16 @@
require 'helper'
class TestPluginManager < Test::Unit::TestCase
def with_no_gemfile
FileUtils.mv "Gemfile", "Gemfile.old"
yield
ensure
FileUtils.mv "Gemfile.old", "Gemfile"
end
def test_requiring_from_bundler
with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do
Jekyll::PluginManager.require_from_bundler
assert Jekyll::PluginManager.require_from_bundler, 'require_from_bundler should return true.'
assert ENV["JEKYLL_NO_BUNDLER_REQUIRE"], 'Gemfile plugins were not required.'
end
end
@@ -11,6 +18,16 @@ class TestPluginManager < Test::Unit::TestCase
def test_blocking_requiring_from_bundler
with_env("JEKYLL_NO_BUNDLER_REQUIRE", "true") do
assert_equal false, Jekyll::PluginManager.require_from_bundler, "Gemfile plugins were required but shouldn't have been"
assert ENV["JEKYLL_NO_BUNDLER_REQUIRE"]
end
end
def test_no_gemfile
with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do
with_no_gemfile do
assert_equal false, Jekyll::PluginManager.require_from_bundler, "Gemfile plugins were required but shouldn't have been"
assert_nil ENV["JEKYLL_NO_BUNDLER_REQUIRE"]
end
end
end
end

View File

@@ -677,6 +677,14 @@ class TestPost < Test::Unit::TestCase
assert conv.kind_of? Jekyll::Converters::Identity
end
should "process .Rmd under text if it is not in the markdown config" do
@site.config['markdown_ext'] = 'markdown,mkd,md,text'
post = setup_post '2014-11-24-Rmd-extension.Rmd'
assert_equal 1, post.converters.size
conv = post.converters.first
assert conv.kind_of?(Jekyll::Converters::Identity), "The converter for .Rmd should be the Identity converter."
end
should "process .text as textile under alternate configuration" do
@site.config['textile_ext'] = 'textile,text'
post = setup_post '2011-04-12-text-extension.text'

View File

@@ -16,11 +16,11 @@ class TestSass < Test::Unit::TestCase
end
should "register the SCSS converter" do
assert !!@site.getConverterImpl(Jekyll::Converters::Scss), "SCSS converter implementation should exist."
assert !!@site.find_converter_instance(Jekyll::Converters::Scss), "SCSS converter implementation should exist."
end
should "register the Sass converter" do
assert !!@site.getConverterImpl(Jekyll::Converters::Sass), "Sass converter implementation should exist."
assert !!@site.find_converter_instance(Jekyll::Converters::Sass), "Sass converter implementation should exist."
end
end
end

View File

@@ -99,6 +99,7 @@ class TestSite < Test::Unit::TestCase
should "write only modified static files" do
clear_dest
StaticFile.reset_cache
@site.metadata.clear
@site.process
some_static_file = @site.static_files[0].path
@@ -128,6 +129,7 @@ class TestSite < Test::Unit::TestCase
should "write static files if not modified but missing in destination" do
clear_dest
StaticFile.reset_cache
@site.metadata.clear
@site.process
some_static_file = @site.static_files[0].path
@@ -241,6 +243,7 @@ class TestSite < Test::Unit::TestCase
context 'with orphaned files in destination' do
setup do
clear_dest
@site.metadata.clear
@site.process
# generate some orphaned files:
# single file
@@ -328,7 +331,7 @@ class TestSite < Test::Unit::TestCase
end
bad_processor = "Custom::Markdown"
s = Site.new(site_configuration('markdown' => bad_processor))
s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true))
assert_raise Jekyll::Errors::FatalException do
s.process
end
@@ -348,7 +351,7 @@ class TestSite < Test::Unit::TestCase
should 'throw FatalException at process time' do
bad_processor = 'not a processor name'
s = Site.new(site_configuration('markdown' => bad_processor))
s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true))
assert_raise Jekyll::Errors::FatalException do
s.process
end
@@ -418,7 +421,9 @@ class TestSite < Test::Unit::TestCase
context "manipulating the Jekyll environment" do
setup do
@site = Site.new(site_configuration)
@site = Site.new(site_configuration({
'full_rebuild' => true
}))
@site.process
@page = @site.pages.find { |p| p.name == "environment.html" }
end
@@ -430,7 +435,9 @@ class TestSite < Test::Unit::TestCase
context "in production" do
setup do
ENV["JEKYLL_ENV"] = "production"
@site = Site.new(site_configuration)
@site = Site.new(site_configuration({
'full_rebuild' => true
}))
@site.process
@page = @site.pages.find { |p| p.name == "environment.html" }
end

View File

@@ -43,6 +43,10 @@ CONTENT
create_post(content, override)
end
def highlight_block_with_opts(options_string)
Jekyll::Tags::HighlightBlock.parse('highlight', options_string, ["test", "{% endhighlight %}", "\n"], {})
end
context "language name" do
should "match only the required set of chars" do
r = Jekyll::Tags::HighlightBlock::SYNTAX
@@ -59,37 +63,51 @@ CONTENT
end
end
context "initialized tag" do
should "set the correct options" do
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby ', ["test", "{% endhighlight %}", "\n"])
context "highlight tag in unsafe mode" do
should "set the no options with just a language name" do
tag = highlight_block_with_opts('ruby ')
assert_equal({}, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos ', ["test", "{% endhighlight %}", "\n"])
should "set the linenos option as 'inline' if no linenos value" do
tag = highlight_block_with_opts('ruby linenos ')
assert_equal({ :linenos => 'inline' }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table ', ["test", "{% endhighlight %}", "\n"])
should "set the linenos option to 'table' if the linenos key is given the table value" do
tag = highlight_block_with_opts('ruby linenos=table ')
assert_equal({ :linenos => 'table' }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table nowrap', ["test", "{% endhighlight %}", "\n"])
should "recognize nowrap option with linenos set" do
tag = highlight_block_with_opts('ruby linenos=table nowrap ')
assert_equal({ :linenos => 'table', :nowrap => true }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
should "recognize the cssclass option" do
tag = highlight_block_with_opts('ruby linenos=table cssclass=hl ')
assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos=3', ["test", "{% endhighlight %}", "\n"])
should "recognize the hl_linenos option and its value" do
tag = highlight_block_with_opts('ruby linenos=table cssclass=hl hl_linenos=3 ')
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => '3' }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos="3 5 6"', ["test", "{% endhighlight %}", "\n"])
should "recognize multiple values of hl_linenos" do
tag = highlight_block_with_opts('ruby linenos=table cssclass=hl hl_linenos="3 5 6" ')
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => ['3', '5', '6'] }, tag.instance_variable_get(:@options))
end
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"])
should "treat language name as case insensitive" do
tag = highlight_block_with_opts('Ruby ')
assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive"
end
end
context "in safe mode" do
setup do
@tag = Jekyll::Tags::HighlightBlock.new('highlight', 'text ', ["test", "{% endhighlight %}", "\n"])
@tag = highlight_block_with_opts('text ')
end
should "allow linenos" do

View File

@@ -120,6 +120,7 @@ class TestUtils < Test::Unit::TestCase
should "drop trailing punctuation" do
assert_equal "so-what-is-jekyll-exactly", Utils.slugify("So what is Jekyll, exactly?")
assert_equal "كيف-حالك", Utils.slugify("كيف حالك؟")
end
should "ignore hyphens" do
@@ -134,6 +135,10 @@ class TestUtils < Test::Unit::TestCase
assert_equal "customizing-git-git-hooks", Utils.slugify("Customizing Git - Git Hooks")
end
should "replace punctuation in any scripts by hyphens" do
assert_equal "5時-6時-三-一四", Utils.slugify("5時〜6時 三・一四")
end
should "not modify the original string" do
title = "Quick-start guide"
Utils.slugify(title)