Compare commits

..

193 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
Alfred Xing
75c5c16297 Handle path overrides 2014-11-23 14:06:29 -08:00
Alfred Xing
4acf343fea Add clean command 2014-11-23 12:51:19 -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
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
80 changed files with 1205 additions and 255 deletions

1
.gitignore vendored
View File

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

View File

@@ -2,9 +2,9 @@ language: ruby
cache: bundler
sudo: false
rvm:
- 2.2
- 2.1
- 2.0
- 1.9.3
env:
matrix:
- TEST_SUITE=test

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,73 @@
### 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

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

@@ -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,64 +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_development_dependency('minitest') if RUBY_PLATFORM =~ /cygwin/
s.add_development_dependency('test-unit') if RUBY_PLATFORM =~ /cygwin/
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'
@@ -153,6 +157,9 @@ module Jekyll
end
end
# Conditional optimizations
Jekyll::External.require_if_present('liquid-c')
end
end
@@ -163,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

@@ -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

@@ -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],
@@ -138,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

@@ -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

@@ -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.2'
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

@@ -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

@@ -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,39 @@ 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}

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,7 +32,7 @@ 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/"

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
@@ -580,6 +579,9 @@ You can find a few useful plugins at the following locations:
- [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

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

@@ -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

@@ -1 +1 @@
2.5.2
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

@@ -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)