mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
670 Commits
v2.3.0
...
cache-incl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c5399b947 | ||
|
|
0d6064b1a1 | ||
|
|
32ff033f9f | ||
|
|
d47b882af2 | ||
|
|
2f4e5fa28b | ||
|
|
c4d617e6aa | ||
|
|
f95d0ba840 | ||
|
|
502fd94f2c | ||
|
|
c58ac78a5e | ||
|
|
7655b533c9 | ||
|
|
620115a986 | ||
|
|
1ca06e70d3 | ||
|
|
919d37fb37 | ||
|
|
f7dafb1f04 | ||
|
|
6504645c60 | ||
|
|
fc0ea20a85 | ||
|
|
b20a175c27 | ||
|
|
2f06f4aad7 | ||
|
|
ff3fa84b8a | ||
|
|
7f370cb82f | ||
|
|
51951c43e8 | ||
|
|
a88f2567f7 | ||
|
|
d159684f87 | ||
|
|
d29dd11ae3 | ||
|
|
8d968ebae0 | ||
|
|
86f7196ef5 | ||
|
|
064d6de48d | ||
|
|
21bd3e6c5a | ||
|
|
07bd3a3759 | ||
|
|
e40e12fabd | ||
|
|
a098dc80cd | ||
|
|
419aaba07c | ||
|
|
7cd5847826 | ||
|
|
9109da32f9 | ||
|
|
7bcf8d689e | ||
|
|
f66862c508 | ||
|
|
cb95a72f5a | ||
|
|
9b81f29625 | ||
|
|
5e10958faa | ||
|
|
7f034f51e3 | ||
|
|
1fc99bdd97 | ||
|
|
7fc47bfc43 | ||
|
|
b2146e8659 | ||
|
|
e0a011c917 | ||
|
|
63ec07a062 | ||
|
|
5f03314d85 | ||
|
|
442deb6a7e | ||
|
|
d7d7d924f7 | ||
|
|
35a5af783a | ||
|
|
a6781bda30 | ||
|
|
bab7ef4b1d | ||
|
|
6f7ea381b3 | ||
|
|
612eb737a5 | ||
|
|
191c2279d2 | ||
|
|
e39dfa3f0b | ||
|
|
5af7694f3b | ||
|
|
6e5850c6ab | ||
|
|
be23e18555 | ||
|
|
928be16fab | ||
|
|
eac3ac095f | ||
|
|
aa4beda868 | ||
|
|
1fad3a074f | ||
|
|
0fe2094dd2 | ||
|
|
c576d23908 | ||
|
|
8c19a6f430 | ||
|
|
ac41312c5d | ||
|
|
232a58d5b4 | ||
|
|
0c0aea3ad7 | ||
|
|
657b16519e | ||
|
|
f81601ee53 | ||
|
|
b6641be8ef | ||
|
|
a8ec9cd507 | ||
|
|
2f8248a6f1 | ||
|
|
0eb2796a66 | ||
|
|
e120c255ff | ||
|
|
990a9e6e6d | ||
|
|
c24c6b7f3d | ||
|
|
039c521e8c | ||
|
|
d35af9c1f3 | ||
|
|
f6bff6fb61 | ||
|
|
a103898980 | ||
|
|
3957efac15 | ||
|
|
38309569c4 | ||
|
|
8bfc696569 | ||
|
|
b68dd3a5cb | ||
|
|
3940e1e9df | ||
|
|
70a331d854 | ||
|
|
5bf1596414 | ||
|
|
3234041510 | ||
|
|
37631eefac | ||
|
|
82b1ad0552 | ||
|
|
2c2347fac1 | ||
|
|
0aa61f66a8 | ||
|
|
b1a517ccb6 | ||
|
|
4070143d5b | ||
|
|
6e4e290ab0 | ||
|
|
d6995d347a | ||
|
|
52085d2e34 | ||
|
|
f3a274377a | ||
|
|
0fcba080c3 | ||
|
|
922ba5d0ea | ||
|
|
cb2eea0e41 | ||
|
|
8284714d8a | ||
|
|
aaf6f28fde | ||
|
|
7227ad4ebb | ||
|
|
c3e47437a3 | ||
|
|
76301722e9 | ||
|
|
d05df326b9 | ||
|
|
dc12bd3023 | ||
|
|
878c689f76 | ||
|
|
68a7ebf2ee | ||
|
|
63ed335463 | ||
|
|
fe14434f8d | ||
|
|
a069ad77c0 | ||
|
|
5343fc3b54 | ||
|
|
2dad0d3304 | ||
|
|
f789168522 | ||
|
|
7656b9d295 | ||
|
|
176dc3cef7 | ||
|
|
360412364e | ||
|
|
49115dbdab | ||
|
|
383a0d0aa7 | ||
|
|
b735170ceb | ||
|
|
59acdaab9a | ||
|
|
12651c19e5 | ||
|
|
1694f8609c | ||
|
|
e80469b7b0 | ||
|
|
032139bd2f | ||
|
|
6deed4c66b | ||
|
|
253bcc2faf | ||
|
|
43a28aed96 | ||
|
|
5d9662f80f | ||
|
|
ed9cc80ff9 | ||
|
|
9b6eeba81e | ||
|
|
40e4c031e3 | ||
|
|
f80dc07f82 | ||
|
|
52f0b36558 | ||
|
|
f8af94431d | ||
|
|
89bdd47ebc | ||
|
|
2c85f4ef24 | ||
|
|
c8fc567c8d | ||
|
|
460dd81fe1 | ||
|
|
7c8c41f0d7 | ||
|
|
3b57879e71 | ||
|
|
19527b47ab | ||
|
|
8298733e67 | ||
|
|
64b0102686 | ||
|
|
bfab00a65a | ||
|
|
fea79dcbab | ||
|
|
b4bc3b0aa0 | ||
|
|
ac7f592839 | ||
|
|
4ccf9ea683 | ||
|
|
7de9433fbc | ||
|
|
9c8acdd3ea | ||
|
|
e9904fd44b | ||
|
|
ba9a309572 | ||
|
|
d0e12d69bc | ||
|
|
75cf2d73f6 | ||
|
|
974fab6c9c | ||
|
|
2a37f459d4 | ||
|
|
5a554572e3 | ||
|
|
a701e59c07 | ||
|
|
b6d81c58df | ||
|
|
4776b27ff3 | ||
|
|
87d08ec827 | ||
|
|
229303bbc8 | ||
|
|
8603738a89 | ||
|
|
932cd3b575 | ||
|
|
02f281eef3 | ||
|
|
8a257aca6b | ||
|
|
588f21f5cd | ||
|
|
0662d31bf6 | ||
|
|
a6f8b6c7d6 | ||
|
|
e51f94a038 | ||
|
|
1aa5c7a820 | ||
|
|
37af23b5d7 | ||
|
|
df87a51ade | ||
|
|
2a138e4ca9 | ||
|
|
e546eb3e9f | ||
|
|
d250efccb9 | ||
|
|
dc30114605 | ||
|
|
2a5cf11ee2 | ||
|
|
e23a74aad9 | ||
|
|
5b77d02e3b | ||
|
|
c2b24e82e5 | ||
|
|
10030ae8cd | ||
|
|
75c5c16297 | ||
|
|
ef53e677a4 | ||
|
|
03d9396b85 | ||
|
|
4acf343fea | ||
|
|
665178d210 | ||
|
|
b1bba1945a | ||
|
|
8ed6c7b077 | ||
|
|
9a94829bcb | ||
|
|
d17b80bf2a | ||
|
|
ac03af3229 | ||
|
|
fe6bfc6f1b | ||
|
|
d438362971 | ||
|
|
842470b0c4 | ||
|
|
11917645f2 | ||
|
|
cb8a4b4d62 | ||
|
|
a75ed0b33d | ||
|
|
58511822e6 | ||
|
|
876253edce | ||
|
|
0f669ba9b1 | ||
|
|
a9a21e6572 | ||
|
|
3b05b0d867 | ||
|
|
b16d47a444 | ||
|
|
d2d3087d3b | ||
|
|
b9a4cf0485 | ||
|
|
848e402937 | ||
|
|
c0951b0a19 | ||
|
|
3592284969 | ||
|
|
0f458edf2b | ||
|
|
1adf8974bf | ||
|
|
da443039e1 | ||
|
|
4aee950418 | ||
|
|
9e454d24a0 | ||
|
|
5185c8d72b | ||
|
|
6f9d28f398 | ||
|
|
2195e5e469 | ||
|
|
60202782ea | ||
|
|
32b14d6402 | ||
|
|
22275e571d | ||
|
|
4142630614 | ||
|
|
3d8368fa4f | ||
|
|
687b9cdf19 | ||
|
|
ecca3accdc | ||
|
|
5aa747e99a | ||
|
|
b5a32a6d46 | ||
|
|
426f2a79fc | ||
|
|
d9cdc7992a | ||
|
|
829133cf98 | ||
|
|
27362a1984 | ||
|
|
3014fbd344 | ||
|
|
596b9e0785 | ||
|
|
39c9fb120f | ||
|
|
314fb875b5 | ||
|
|
3b40d964fb | ||
|
|
a48379a715 | ||
|
|
d4c15efff9 | ||
|
|
2a41945014 | ||
|
|
dc248345a9 | ||
|
|
b6f3adb6e3 | ||
|
|
472c18e409 | ||
|
|
e42f5ac2dc | ||
|
|
06750b8502 | ||
|
|
bd907c5be6 | ||
|
|
c79fe1125c | ||
|
|
20f0940455 | ||
|
|
84cef2202d | ||
|
|
eaa132c65b | ||
|
|
2d31d07602 | ||
|
|
d99814baa5 | ||
|
|
ab05a2cd4f | ||
|
|
db8163b6e8 | ||
|
|
22d11bef2d | ||
|
|
70159ac8cb | ||
|
|
5eb300043f | ||
|
|
95b62e564b | ||
|
|
ad745702ca | ||
|
|
4b0089712e | ||
|
|
264caac94c | ||
|
|
58180b1ac1 | ||
|
|
067f8b6be7 | ||
|
|
4df73ced0d | ||
|
|
c7603f3ebf | ||
|
|
ae7f10b922 | ||
|
|
023e4e6ceb | ||
|
|
742893410c | ||
|
|
c1aba46a1e | ||
|
|
23712cf4dc | ||
|
|
21de59a90e | ||
|
|
e11fb4d427 | ||
|
|
328fbd83d4 | ||
|
|
ffe7860625 | ||
|
|
5b54f78875 | ||
|
|
989c70fe4a | ||
|
|
2f4448eab6 | ||
|
|
90bdcaddb7 | ||
|
|
a0afa19e9a | ||
|
|
7918dad26f | ||
|
|
13bb7360c0 | ||
|
|
5d23760280 | ||
|
|
5a350788e7 | ||
|
|
e543fedf3f | ||
|
|
b02a5ba76a | ||
|
|
5a288e7de4 | ||
|
|
8ee1b2a1fd | ||
|
|
b0a7f9c8c9 | ||
|
|
519b60d012 | ||
|
|
0ad2c338c4 | ||
|
|
34de676713 | ||
|
|
01b11d098e | ||
|
|
1b68a29f29 | ||
|
|
18930b01f6 | ||
|
|
b29fd6d380 | ||
|
|
9a15a09028 | ||
|
|
774c65a869 | ||
|
|
a822219086 | ||
|
|
2ec1dc1831 | ||
|
|
50d0fc3c85 | ||
|
|
90cddade53 | ||
|
|
2ee8d690c4 | ||
|
|
ca40c771d0 | ||
|
|
0c6137b2d3 | ||
|
|
4bccbdead4 | ||
|
|
8d02c5cd94 | ||
|
|
68e9c84a18 | ||
|
|
f7b1782294 | ||
|
|
2690c045ec | ||
|
|
656e772388 | ||
|
|
817f6cb658 | ||
|
|
179b5ab193 | ||
|
|
b4a2788626 | ||
|
|
3762878381 | ||
|
|
9cbc24fce5 | ||
|
|
4078bde3ba | ||
|
|
3b634134a0 | ||
|
|
461e16f8bc | ||
|
|
0bc88975c8 | ||
|
|
98182aab4a | ||
|
|
3a3be7e5a7 | ||
|
|
7e1cc4b684 | ||
|
|
0f2a3a606b | ||
|
|
314dce62cf | ||
|
|
bd72265e74 | ||
|
|
ab8441259e | ||
|
|
ccd1941378 | ||
|
|
4272537f69 | ||
|
|
23f4c5804c | ||
|
|
a16dfef840 | ||
|
|
e1f7139b9c | ||
|
|
f9e249ae20 | ||
|
|
81f4abdbcd | ||
|
|
9a82b474aa | ||
|
|
57ca3a04d5 | ||
|
|
257f852b96 | ||
|
|
8dcf7a6680 | ||
|
|
02e53fb6ff | ||
|
|
485f7634bd | ||
|
|
0fc256dbef | ||
|
|
3fb1356593 | ||
|
|
cd9d38c5ea | ||
|
|
0fe1d0686a | ||
|
|
4e8ebd999a | ||
|
|
578f38748d | ||
|
|
ae01b1d5df | ||
|
|
5cb0aee251 | ||
|
|
2eb318a929 | ||
|
|
ab3f27e674 | ||
|
|
e028d50b3f | ||
|
|
a30498ba42 | ||
|
|
7c05312d5c | ||
|
|
7e37892bbd | ||
|
|
4e07dfef1f | ||
|
|
0511ece2f5 | ||
|
|
1395d5686b | ||
|
|
3227c4ecea | ||
|
|
b9c4fc93d7 | ||
|
|
95e96a0f83 | ||
|
|
c92ad3b595 | ||
|
|
3285aebd4f | ||
|
|
9cc3085dd0 | ||
|
|
5b37ad57cc | ||
|
|
3dedcbf894 | ||
|
|
2ca2990f6b | ||
|
|
7fd9f102c0 | ||
|
|
cc3a31e363 | ||
|
|
5ed4638400 | ||
|
|
a64e7e8814 | ||
|
|
6723db8157 | ||
|
|
996db6912d | ||
|
|
c77d06446d | ||
|
|
68c0e8f847 | ||
|
|
4b4a46579a | ||
|
|
c95f4c0f5b | ||
|
|
078b2785e4 | ||
|
|
1d726a87b9 | ||
|
|
90b6723288 | ||
|
|
a9d7031e7c | ||
|
|
db220a9de6 | ||
|
|
9f5835871b | ||
|
|
b62415019b | ||
|
|
00d29e7e77 | ||
|
|
5b5a25a03a | ||
|
|
be3d723d73 | ||
|
|
7cad48a3ee | ||
|
|
b564214535 | ||
|
|
63a6d595c4 | ||
|
|
22cc393cd4 | ||
|
|
0400ffe377 | ||
|
|
b07cbcecbd | ||
|
|
626706c8c5 | ||
|
|
a7c0fffcec | ||
|
|
73ca205a5c | ||
|
|
4942b2947b | ||
|
|
fbe98df488 | ||
|
|
44c9f81921 | ||
|
|
681d71ac04 | ||
|
|
3902e373d8 | ||
|
|
ce8d8d929c | ||
|
|
3994d9116d | ||
|
|
c2caaeaf11 | ||
|
|
56ac50c568 | ||
|
|
25d77cb05a | ||
|
|
70174e8831 | ||
|
|
f6ea8b4d50 | ||
|
|
9083511de3 | ||
|
|
8cc07231df | ||
|
|
94a1330d61 | ||
|
|
13919b4f3c | ||
|
|
8fe9c76d08 | ||
|
|
d674305092 | ||
|
|
ac1d1a4053 | ||
|
|
66578b0c90 | ||
|
|
a84af462d4 | ||
|
|
ceaa2eb267 | ||
|
|
ec0e1dcb14 | ||
|
|
fb435c2c7e | ||
|
|
ba31c5c387 | ||
|
|
5ea3286b09 | ||
|
|
b0c0fbd70b | ||
|
|
28bb15d4ee | ||
|
|
1db62cca9e | ||
|
|
ad9a656d8d | ||
|
|
cae5958362 | ||
|
|
f0e22be32b | ||
|
|
6657e374b2 | ||
|
|
b965d44b5f | ||
|
|
1ccd2156c5 | ||
|
|
8e481cdf8e | ||
|
|
7aa43f37fb | ||
|
|
2a83bdccd5 | ||
|
|
97ed8622c7 | ||
|
|
7a2f7a569b | ||
|
|
aed5554a1b | ||
|
|
961a3504ba | ||
|
|
592cee9596 | ||
|
|
7869586e43 | ||
|
|
42a8dba642 | ||
|
|
98b5ff0d17 | ||
|
|
dd25ca30d4 | ||
|
|
d57d248152 | ||
|
|
314f476d11 | ||
|
|
0e6dc41db5 | ||
|
|
1b923fb504 | ||
|
|
7539e2109b | ||
|
|
4a5f70b315 | ||
|
|
bec32b14cb | ||
|
|
a041d50681 | ||
|
|
0553dc2f85 | ||
|
|
0701fa7b16 | ||
|
|
f80d82cfcc | ||
|
|
aaf813902a | ||
|
|
e3c74d5365 | ||
|
|
1f2250e7a4 | ||
|
|
6dbe112f79 | ||
|
|
ccef84a803 | ||
|
|
3a96d01e4a | ||
|
|
95644a844f | ||
|
|
bd0eebdb05 | ||
|
|
3319c0ab56 | ||
|
|
dc0add15af | ||
|
|
6f585e5da5 | ||
|
|
0c32f389bc | ||
|
|
8990d7199e | ||
|
|
e6f89074d4 | ||
|
|
633c9be95c | ||
|
|
14c58213c7 | ||
|
|
f2689ddf8f | ||
|
|
a5a8be97de | ||
|
|
1a88178fbf | ||
|
|
e013c16ba9 | ||
|
|
52c76b5d93 | ||
|
|
e68a584a27 | ||
|
|
bc9699e420 | ||
|
|
951fa8981f | ||
|
|
6a06a627f8 | ||
|
|
a7eeeda99f | ||
|
|
0f008c02d8 | ||
|
|
3086ea3036 | ||
|
|
2efe14d656 | ||
|
|
c03dadbe2c | ||
|
|
9efb68f957 | ||
|
|
2c9f6b0bd5 | ||
|
|
84ce5c3589 | ||
|
|
bfe83cdec2 | ||
|
|
51ebd69162 | ||
|
|
c11edf5272 | ||
|
|
a3f8336571 | ||
|
|
36baf435b5 | ||
|
|
1416e0e0ce | ||
|
|
c789a93bc8 | ||
|
|
121a06a9eb | ||
|
|
24d13fcc55 | ||
|
|
bf1a2320e2 | ||
|
|
fdf58c5ce2 | ||
|
|
5445a1bead | ||
|
|
566eb6ef3b | ||
|
|
19b2d2eeb6 | ||
|
|
c08a7f3fbd | ||
|
|
a0d46942b9 | ||
|
|
7cf64b6ab5 | ||
|
|
a34dbd45cf | ||
|
|
44506bf376 | ||
|
|
86af9952ce | ||
|
|
12046270a6 | ||
|
|
f7ef16ba06 | ||
|
|
65bcf2adb2 | ||
|
|
7790b42f8c | ||
|
|
6ed54bd31a | ||
|
|
d9e5fdde5b | ||
|
|
c3ec158f2d | ||
|
|
bf8cc236ee | ||
|
|
6c0e791236 | ||
|
|
960a918330 | ||
|
|
671b435b3b | ||
|
|
219a52e37b | ||
|
|
a4f0f0dd0c | ||
|
|
838753cc96 | ||
|
|
8f41d3db61 | ||
|
|
928e5e1c07 | ||
|
|
b99ec48407 | ||
|
|
7c128bc7a2 | ||
|
|
99b5569ffa | ||
|
|
1c2f7cb182 | ||
|
|
e72f8cf5b1 | ||
|
|
39783a6f46 | ||
|
|
88244ff71d | ||
|
|
1cb1cbba50 | ||
|
|
87f72f0c63 | ||
|
|
c776a657af | ||
|
|
568a0b0e08 | ||
|
|
196a56e3ec | ||
|
|
80106f1b67 | ||
|
|
3994faaeaa | ||
|
|
95dd0dc479 | ||
|
|
4fb6e1cde9 | ||
|
|
cab4333f70 | ||
|
|
d786e81f46 | ||
|
|
06c9b1b33c | ||
|
|
deb4e0d24a | ||
|
|
5fe73a6671 | ||
|
|
0675f2a423 | ||
|
|
41a6037a11 | ||
|
|
6644c77d23 | ||
|
|
a569799ffc | ||
|
|
3668437c96 | ||
|
|
afd30b0a9b | ||
|
|
4da07bb2c3 | ||
|
|
e7c8bbf5df | ||
|
|
934c37b578 | ||
|
|
0e4549013d | ||
|
|
39172e53bf | ||
|
|
0422c5fde6 | ||
|
|
192e5b9188 | ||
|
|
c3dc5cceee | ||
|
|
1a11a994ea | ||
|
|
a2fedfc615 | ||
|
|
77297744ce | ||
|
|
394eab4a3a | ||
|
|
2d3ca08d91 | ||
|
|
d950680bbe | ||
|
|
9f558d1cec | ||
|
|
787bb582da | ||
|
|
b5020bc590 | ||
|
|
64b2e11106 | ||
|
|
7215c44146 | ||
|
|
4435bcb1f8 | ||
|
|
fa86afb336 | ||
|
|
58a76911bb | ||
|
|
aa97f1025d | ||
|
|
62a3961739 | ||
|
|
4adc35aaf3 | ||
|
|
702b39dec5 | ||
|
|
3ca1245027 | ||
|
|
5674226b68 | ||
|
|
6928adf501 | ||
|
|
cfd17b2e7d | ||
|
|
e4975836f4 | ||
|
|
820d6b3543 | ||
|
|
05d65f0341 | ||
|
|
be2b16507e | ||
|
|
a5e51cfdbe | ||
|
|
93f63df172 | ||
|
|
4dec3c8c6b | ||
|
|
cca9c50c26 | ||
|
|
bcb6798838 | ||
|
|
9e9f4f1c53 | ||
|
|
18eb8e6fb7 | ||
|
|
8993cbe445 | ||
|
|
5b6b558c5a | ||
|
|
081e34a5ab | ||
|
|
8f46e23aa1 | ||
|
|
27d3126d54 | ||
|
|
b5dbc36975 | ||
|
|
6cee2a87cc | ||
|
|
7de681ef58 | ||
|
|
ba05d00ac4 | ||
|
|
943dc27e78 | ||
|
|
eea5921856 | ||
|
|
ca2e291306 | ||
|
|
7baa56e1b2 | ||
|
|
7ff5505e97 | ||
|
|
106148280d | ||
|
|
f9bc50e010 | ||
|
|
efd2c17eba | ||
|
|
f90d8db827 | ||
|
|
2d485ab6fe | ||
|
|
30d1f90b44 | ||
|
|
cd50388781 | ||
|
|
190ab7f6b8 | ||
|
|
0c42174917 | ||
|
|
d395183ee2 | ||
|
|
5330980c5f | ||
|
|
5475c64d89 | ||
|
|
41311841f4 | ||
|
|
98ed3b1c8f | ||
|
|
d84b801fec | ||
|
|
1238ccefcc | ||
|
|
55de135467 | ||
|
|
79992fc3c8 | ||
|
|
71b10e2d4a | ||
|
|
927edfc078 | ||
|
|
568464bc0e | ||
|
|
37db35dc10 | ||
|
|
56cd73eb35 | ||
|
|
a72706ace6 | ||
|
|
cc4a0d1704 | ||
|
|
67422e42c6 | ||
|
|
ac1f2e2049 | ||
|
|
d9da7cbd76 | ||
|
|
e8b00fb6f2 | ||
|
|
069805c6f7 | ||
|
|
caec5339e8 | ||
|
|
9560429ac3 | ||
|
|
ca1e6071e3 | ||
|
|
1aa9d6255e | ||
|
|
00c898b2e9 | ||
|
|
25f5bb2795 | ||
|
|
9df020f7e9 | ||
|
|
9b5f766333 | ||
|
|
11f629b00e | ||
|
|
a90a7b2fba | ||
|
|
c54fb1aa20 | ||
|
|
c4a2ac2c4b | ||
|
|
e8f2272918 | ||
|
|
be74029960 | ||
|
|
74c812b565 | ||
|
|
8959ec448d | ||
|
|
034b3e94a5 | ||
|
|
ce37de30a5 | ||
|
|
f7a4cdbf2b | ||
|
|
133463235a | ||
|
|
5d67438612 | ||
|
|
cccfda7de8 | ||
|
|
4fb022ce33 | ||
|
|
9d4c3fbbdf | ||
|
|
5931b80ef3 | ||
|
|
7b09a80dc7 | ||
|
|
866935dadf | ||
|
|
3a89923142 | ||
|
|
687176e22c | ||
|
|
166298e3f5 | ||
|
|
f2b9154fa9 | ||
|
|
59b6cafef7 | ||
|
|
f4726d0ebc | ||
|
|
1591557bc4 | ||
|
|
20f1cce6a5 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,3 +13,5 @@ site/_site/
|
||||
coverage
|
||||
.ruby-version
|
||||
.sass-cache
|
||||
tmp/stackprof-*
|
||||
.jekyll-metadata
|
||||
|
||||
21
.travis.yml
21
.travis.yml
@@ -1,15 +1,16 @@
|
||||
language: ruby
|
||||
cache: bundler
|
||||
install:
|
||||
- script/rebund download
|
||||
- travis_retry bundle install --path vendor/bundle
|
||||
sudo: false
|
||||
rvm:
|
||||
- 2.2
|
||||
- 2.1
|
||||
- 2.0
|
||||
- 1.9.3
|
||||
env:
|
||||
matrix:
|
||||
- TEST_SUITE=test
|
||||
- TEST_SUITE=cucumber
|
||||
before_script: bundle update
|
||||
script: script/cibuild
|
||||
after_script:
|
||||
- script/rebund upload
|
||||
notifications:
|
||||
irc:
|
||||
on_success: change
|
||||
@@ -17,11 +18,9 @@ notifications:
|
||||
channels:
|
||||
- irc.freenode.org#jekyll
|
||||
template:
|
||||
- '%{repository}#%{build_number} (%{branch}) %{message} %{build_url}'
|
||||
- "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}"
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: never
|
||||
env:
|
||||
global:
|
||||
- secure: bt5nglPTdsc0N5fB1dOJz2WbM81dGpDuVD8PnhEsxgUfoo6xavhU4+pNrUADlSUqQ1aJrdU+MKW4x+JZ2ZnJS8vOpNzRymuMZSbFaljK4pgFGiKFgBdMKxVikvoYcxKCjLAl7NJZ11W6hUw+JtJScClDZwrJJAQB6I7Isp/LsdM=
|
||||
- secure: Ym8nx7nbfGYGo47my92M+deJykaiMkdZdb615EO51liv/xy/0aQ919Jpfieugc9d3zVnm+zFGPbpv4YzRpsik6OlVBNa4lP+BnQ27ptf5YcLWD8Hksi7845WFLecXMoaTCoYer/TvYZsIWJb2nSDMH9qbfZhnd1YZKuvUpK0rEU=
|
||||
slack:
|
||||
secure: dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4YGEilNRzKPz18AsFptVXofpwyqcBxaCfmHP809NX5PHBaadydveLm+TNVao2XeLXSWu+HUNAYO1AanCUbJSEyJTju347xCBGzESU=
|
||||
|
||||
27
Gemfile
27
Gemfile
@@ -1,2 +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
|
||||
|
||||
212
History.markdown
212
History.markdown
@@ -2,14 +2,226 @@
|
||||
|
||||
### Major Enhancements
|
||||
|
||||
* Incremental regeneration (#3116)
|
||||
* Drop support for Ruby 1.9.3. (#3235)
|
||||
* Upgrade to Liquid 3.0.0 (#3002)
|
||||
* Support Ruby v2.2 (#3234)
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Sort static files just once, and call `site_payload` once for all collections (#3204)
|
||||
* Separate `jekyll docs` and optimize external gem handling (#3241)
|
||||
* Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240)
|
||||
* Use relative path for `path` Liquid variable in Documents for consistency (#2908)
|
||||
* Generalize `Utils#slugify` for any scripts (#3047)
|
||||
* Added basic microdata to post template in site template (#3189)
|
||||
* Store log messages in an array of messages. (#3244)
|
||||
* Allow collection documents to override `output` property in front matter (#3172)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Remove unneeded end tag for `link` in site template (#3236)
|
||||
* Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237)
|
||||
* Unescape `Document` output path (#2924)
|
||||
* Fix nav items alignment when on multiple rows (#3264)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Improve the grammar in the documentation (#3233)
|
||||
* Update the LICENSE text to match the MIT license exactly (#3253)
|
||||
* Update rake task `site:publish` to fix minor bugs. (#3254)
|
||||
* Switch to shields.io for the README badges. (#3255)
|
||||
* Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Fixing the default host on docs (#3229)
|
||||
* Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790)
|
||||
* Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186)
|
||||
* Add a Resources link to tutorial on building dynamic navbars (#3185)
|
||||
* Semantic structure improvements to the post and page layouts (#3251)
|
||||
|
||||
## 2.5.3 / 2014-12-22
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* When checking a Markdown extname, include position of the `.` (#3147)
|
||||
* Fix `jsonify` Liquid filter handling of boolean values (#3154)
|
||||
* Add comma to value of `viewport` meta tag (#3170)
|
||||
* Set the link type for the RSS feed to `application/rss+xml` (#3176)
|
||||
* Refactor `#as_liquid` (#3158)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Exclude built-in bundles from being added to coverage report (#3180)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Add `@alfredxing` to the `@jekyll/core` team. :tada: (#3218)
|
||||
* Document the `-q` option for the `build` and `serve` commands (#3149)
|
||||
* Fix some minor typos/flow fixes in documentation website content (#3165)
|
||||
* Add `keep_files` to configuration documentation (#3162)
|
||||
* Repeat warning about cleaning of the `destination` directory (#3161)
|
||||
* Add jekyll-500px-embed to list of third-party plugins (#3163)
|
||||
* Simplified platform detection in Gemfile example for Windows (#3177)
|
||||
* Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198)
|
||||
* Add Table of Contents to Troubleshooting page (#3196)
|
||||
* Add `inline_highlight` plugin to list of third-party plugins (#3212)
|
||||
* Add `jekyll-mermaid` plugin to list of third-party plugins (#3222)
|
||||
|
||||
## 2.5.2 / 2014-11-17
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* `post_url` should match `post.name` instead of slugs and dates (#3058)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix bundle require for `:jekyll_plugins` (#3119)
|
||||
* Remove duplicate regexp phrase: `^\A` (#3089)
|
||||
* Remove duplicate `Conversion error:` message in `Convertible` (#3088)
|
||||
* Print full conversion error message in `Renderer#convert` (#3090)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Change variable names in Google Analytics script (#3093)
|
||||
* Mention CSV files in the docs for data files (#3101)
|
||||
* Add trailing slash to `paginate_path` example. (#3091)
|
||||
* Get rid of noifniof (`excerpt_separator`) (#3094)
|
||||
* Sass improvements, around nesting mostly. (#3123)
|
||||
* Add webmentions.io plugin to the list of third-party plugins (#3127)
|
||||
* Add Sass mixins and use them. (#2904)
|
||||
* Slightly compress jekyll-sticker.jpg. (#3133)
|
||||
* Update gridism and separate out related but custom styles. (#3132)
|
||||
* Add remote-include plugin to list of third-party plugins (#3136)
|
||||
|
||||
## 2.5.1 / 2014-11-09
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix path sanitation bug related to Windows drive names (#3077)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Add development time dependencies on minitest and test-unit to gemspec for cygwin (#3064)
|
||||
* Use Travis's built-in caching. (#3075)
|
||||
|
||||
## 2.5.0 / 2014-11-06
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Require gems in `:jekyll_plugins` Gemfile group unless `JEKYLL_NO_BUNDLER_REQUIRE` is specified in the environment. (#2865)
|
||||
* Centralize path sanitation in the `Site` object (#2882)
|
||||
* Allow placeholders in permalinks (#3031)
|
||||
* Allow users to specify the log level via `JEKYLL_LOG_LEVEL`. (#3067)
|
||||
* Fancy Indexing with WEBrick (#3018)
|
||||
* Allow Enumerables to be used with `where` filter. (#2986)
|
||||
* Meta descriptions in the site template now use `page.excerpt` if it's available (#2964)
|
||||
* Change indentation in `head.html` of site template to 2 spaces from 4 (#2973)
|
||||
* Use a `$content-width` variable instead of a fixed value in the site template CSS (#2972)
|
||||
* Strip newlines in site template `<meta>` description. (#2982)
|
||||
* Add link to atom feed in `head` of site template files (#2996)
|
||||
* Performance optimizations (#2994)
|
||||
* Use `Hash#each_key` instead of `Hash#keys.each` to speed up iteration
|
||||
over hash keys. (#3017)
|
||||
* Further minor performance enhancements. (#3022)
|
||||
* Add 'b' and 's' aliases for build and serve, respectively (#3065)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix Rouge's RedCarpet plugin interface integration (#2951)
|
||||
* Remove `--watch` from the site template blog post since it defaults
|
||||
to watching in in 2.4.0 (#2922)
|
||||
* Fix code for media query mixin in site template (#2946)
|
||||
* Allow post URL's to have `.htm` extensions (#2925)
|
||||
* `Utils.slugify`: Don't create new objects when gsubbing (#2997)
|
||||
* The jsonify filter should deep-convert to Liquid when given an Array. (#3032)
|
||||
* Apply `jsonify` filter to Hashes deeply and effectively (#3063)
|
||||
* Use `127.0.0.1` as default host instead of `0.0.0.0` (#3053)
|
||||
* In the case that a Gemfile does not exist, ensure Jekyll doesn't fail on requiring the Gemfile group (#3066)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Fix a typo in the doc block for `Jekyll::URL.escape_path` (#3052)
|
||||
* Add integration test for `jekyll new --blank` in TestUnit (#2913)
|
||||
* Add unit test for `jekyll new --force` logic (#2929)
|
||||
* Update outdated comment for `Convertible#transform` (#2957)
|
||||
* Add Hakiri badge to README. (#2953)
|
||||
* Add some simple benchmarking tools. (#2993)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* `NOKOGIRI_USE_SYSTEM_LIBRARIES=true` **decreases** installation time. (#3040)
|
||||
* Add FormKeep to resources as Jekyll form backend (#3010)
|
||||
* Fixing a mistake in the name of the new Liquid tag (#2969)
|
||||
* Update Font Awesome to v4.2.0. (#2898)
|
||||
* Fix link to #2895 in 2.4.0 release post. (#2899)
|
||||
* Add Big Footnotes for Kramdown plugin to list of third-party plugins (#2916)
|
||||
* Remove warning regarding GHP use of singular types for front matter defaults (#2919)
|
||||
* Fix quote character typo in site documentation for templates (#2917)
|
||||
* Point Liquid links to Liquid’s Github wiki (#2887)
|
||||
* Add HTTP Basic Auth (.htaccess) plugin to list of third-party plugins (#2931)
|
||||
* (Minor) Grammar & `_config.yml` filename fixes (#2911)
|
||||
* Added `mathml.rb` to the list of third-party plugins. (#2937)
|
||||
* Add `--force_polling` to the list of configuration options (#2943)
|
||||
* Escape unicode characters in site CSS (#2906)
|
||||
* Add note about using the github-pages gem via pages.github.com/versions.json (#2939)
|
||||
* Update usage documentation to reflect 2.4 auto-enabling of `--watch`. (#2954)
|
||||
* Add `--skip-initial-build` to configuration docs (#2949)
|
||||
* Fix a minor typo in Templates docs page (#2959)
|
||||
* Add a ditaa-ditaa plugin under Other section on the Plugins page (#2967)
|
||||
* Add `build/serve -V` option to configuration documentation (#2948)
|
||||
* Add 'Jekyll Twitter Plugin' to list of third-party plugins (#2979)
|
||||
* Docs: Update normalize.css to v3.0.2. (#2981)
|
||||
* Fix typo in Continuous Integration documentation (#2984)
|
||||
* Clarify behavior of `:categories` in permalinks (#3011)
|
||||
|
||||
## 2.4.0 / 2014-09-09
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Support a new `relative_include` tag (#2870)
|
||||
* Auto-enable watch on 'serve' (#2858)
|
||||
* Render Liquid in CoffeeScript files (#2830)
|
||||
* Array Liquid filters: `push`, `pop`, `unshift`, `shift` (#2895)
|
||||
* Add `:title` to collection URL template fillers (#2864)
|
||||
* Add support for CSV files in the `_data` directory (#2761)
|
||||
* Add the `name` variable to collection permalinks (#2799)
|
||||
* Add `inspect` liquid filter. (#2867)
|
||||
* Add a `slugify` Liquid filter (#2880)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Use `Jekyll.sanitized_path` when adding static files to Collections (#2849)
|
||||
* Fix encoding of `main.scss` in site template (#2771)
|
||||
* Fix orientation bugs in default site template (#2862)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Update simplecov gem to 0.9 (#2748)
|
||||
* Remove `docs/` dir (#2768)
|
||||
* add class `<< self` idiom to `New` command (#2817)
|
||||
* Allow Travis to 'parallelize' our tests (#2859)
|
||||
* Fix test for Liquid rendering in Sass (#2856)
|
||||
* Fixing "vertycal" typo in site template's `_base.scss` (#2889)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Document the `name` variable for collection permalinks (#2829)
|
||||
* Adds info about installing jekyll in current dir (#2839)
|
||||
* Remove deprecated `jekyll-projectlist` plugin from list of third-party
|
||||
plugins (#2742)
|
||||
* Remove tag plugins that are built in to Jekyll (#2751)
|
||||
* Add `markdown-writer` package for Atom Editor to list of third-party
|
||||
plugins (#2763)
|
||||
* Fix typo in site documentation for collections (#2764)
|
||||
* Fix minor typo on plugins docs page (#2765)
|
||||
* Replace markdown with HTML in `sass_dir` note on assets page (#2791)
|
||||
* Fixed "bellow" typo in datafiles docs (#2879)
|
||||
* Fix code/markdown issue in documentation for variables (#2877)
|
||||
* Remove Good Include third-party plugin from plugins page (#2881)
|
||||
* Add some more docs on `include_relative` (#2884)
|
||||
|
||||
## 2.3.0 / 2014-08-10
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
6
LICENSE
6
LICENSE
@@ -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
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# [Jekyll](http://jekyllrb.com/)
|
||||
|
||||
[](https://rubygems.org/gems/jekyll)
|
||||
[](https://travis-ci.org/jekyll/jekyll)
|
||||
[](https://codeclimate.com/github/jekyll/jekyll)
|
||||
[](https://gemnasium.com/jekyll/jekyll)
|
||||
[](https://rubygems.org/gems/jekyll)
|
||||
[](https://travis-ci.org/jekyll/jekyll)
|
||||
[](https://codeclimate.com/github/jekyll/jekyll)
|
||||
[](https://gemnasium.com/jekyll/jekyll)
|
||||
[](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)!
|
||||
|
||||
|
||||
64
Rakefile
64
Rakefile
@@ -134,6 +134,7 @@ namespace :site do
|
||||
desc "Generate and view the site locally"
|
||||
task :preview do
|
||||
require "launchy"
|
||||
require "jekyll"
|
||||
|
||||
# Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
|
||||
# then open it in a browser. Someday we can do better than this, I hope.
|
||||
@@ -145,17 +146,31 @@ namespace :site do
|
||||
|
||||
# Generate the site in server mode.
|
||||
puts "Running Jekyll..."
|
||||
Dir.chdir("site") do
|
||||
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve --watch"
|
||||
end
|
||||
options = {
|
||||
"source" => File.expand_path("site"),
|
||||
"destination" => File.expand_path("site/_site"),
|
||||
"watch" => true,
|
||||
"serving" => true
|
||||
}
|
||||
Jekyll::Commands::Build.process(options)
|
||||
Jekyll::Commands::Serve.process(options)
|
||||
end
|
||||
|
||||
desc "Generate the site"
|
||||
task :generate => [:history, :version_file] do
|
||||
require "jekyll"
|
||||
Jekyll::Commands::Build.process({
|
||||
"source" => File.expand_path("site"),
|
||||
"destination" => File.expand_path("site/_site")
|
||||
})
|
||||
end
|
||||
|
||||
desc "Update normalize.css library to the latest version and minify"
|
||||
task :update_normalize_css do
|
||||
Dir.chdir("site/_includes/css") do
|
||||
Dir.chdir("site/_sass") do
|
||||
sh 'curl "http://necolas.github.io/normalize.css/latest/normalize.css" -o "normalize.scss"'
|
||||
sh 'sass "normalize.scss":"normalize.css" --style compressed'
|
||||
sh 'rm "normalize.scss"'
|
||||
sh 'sass "normalize.scss":"_normalize.scss" --style compressed'
|
||||
rm ['normalize.scss', Dir.glob('*.map')].flatten
|
||||
end
|
||||
end
|
||||
|
||||
@@ -164,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]
|
||||
|
||||
32
benchmark/cached-includes.rb
Normal file
32
benchmark/cached-includes.rb
Normal 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
|
||||
17
benchmark/flat-map
Normal file
17
benchmark/flat-map
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
enum = (0..50).to_a
|
||||
nested = enum.map { |i| [i] }
|
||||
|
||||
def do_thing(blah)
|
||||
blah * 1
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('.map.flatten with nested arrays') { nested.map { |i| do_thing(i) }.flatten(1) }
|
||||
x.report('.flat_map with nested arrays') { nested.flat_map { |i| do_thing(i) } }
|
||||
|
||||
x.report('.map.flatten with no nested arrays') { enum.map { |i| do_thing(i) }.flatten(1) }
|
||||
x.report('.flat_map with no nested arrays') { enum.flat_map { |i| do_thing(i) } }
|
||||
end
|
||||
|
||||
9
benchmark/hash-fetch
Normal file
9
benchmark/hash-fetch
Normal file
@@ -0,0 +1,9 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
h = {:bar => 'uco'}
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('fetch with no block') { h.fetch(:bar, (0..9).to_a) }
|
||||
x.report('fetch with a block') { h.fetch(:bar) { (0..9).to_a } }
|
||||
x.report('brackets with an ||') { h[:bar] || (0..9).to_a }
|
||||
end
|
||||
46
benchmark/jekyll-sanitize-path
Normal file
46
benchmark/jekyll-sanitize-path
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative '../lib/jekyll'
|
||||
require 'benchmark/ips'
|
||||
|
||||
base_directory = Dir.pwd
|
||||
|
||||
Benchmark.ips do |x|
|
||||
#
|
||||
# Does not include the base_directory
|
||||
#
|
||||
x.report('with no questionable path') do
|
||||
Jekyll.sanitized_path(base_directory, '')
|
||||
end
|
||||
x.report('with a single-part questionable path') do
|
||||
Jekyll.sanitized_path(base_directory, 'thingy')
|
||||
end
|
||||
x.report('with a multi-part questionable path') do
|
||||
Jekyll.sanitized_path(base_directory, 'thingy/in/my/soup')
|
||||
end
|
||||
x.report('with a single-part traversal path') do
|
||||
Jekyll.sanitized_path(base_directory, '../thingy')
|
||||
end
|
||||
x.report('with a multi-part traversal path') do
|
||||
Jekyll.sanitized_path(base_directory, '../thingy/in/my/../../soup')
|
||||
end
|
||||
|
||||
#
|
||||
# Including the base_directory
|
||||
#
|
||||
x.report('with the exact same paths') do
|
||||
Jekyll.sanitized_path(base_directory, base_directory)
|
||||
end
|
||||
x.report('with a single-part absolute path including the base_directory') do
|
||||
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy'))
|
||||
end
|
||||
x.report('with a multi-part absolute path including the base_directory') do
|
||||
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy/in/my/soup'))
|
||||
end
|
||||
x.report('with a single-part traversal path including the base_directory') do
|
||||
Jekyll.sanitized_path(base_directory, File.join(base_directory, 'thingy/..'))
|
||||
end
|
||||
x.report('with a multi-part traversal path including the base_directory') do
|
||||
Jekyll.sanitized_path(base_directory, File.join('thingy/in/my/../../soup'))
|
||||
end
|
||||
end
|
||||
14
benchmark/proc-call-vs-yield
Normal file
14
benchmark/proc-call-vs-yield
Normal file
@@ -0,0 +1,14 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
def fast
|
||||
yield
|
||||
end
|
||||
|
||||
def slow(&block)
|
||||
block.call
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('yield') { fast { (0..9).to_a } }
|
||||
x.report('block.call') { slow { (0..9).to_a } }
|
||||
end
|
||||
11
benchmark/sequential-assignment
Normal file
11
benchmark/sequential-assignment
Normal file
@@ -0,0 +1,11 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('parallel assignment') do
|
||||
a, b = 1, 2
|
||||
end
|
||||
x.report('multi-line assignment') do
|
||||
a = 1
|
||||
b = 2
|
||||
end
|
||||
end
|
||||
8
benchmark/string-concat
Normal file
8
benchmark/string-concat
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
url = "http://jekyllrb.com"
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('+=') { url += '/' }
|
||||
x.report('<<') { url << '/' }
|
||||
end
|
||||
13
benchmark/string-replacement
Normal file
13
benchmark/string-replacement
Normal file
@@ -0,0 +1,13 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
def str
|
||||
'http://baruco.org/2014/some-talk-with-some-amount-of-value'
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('#tr') { str.tr('some', 'a') }
|
||||
x.report('#gsub') { str.gsub('some', 'a') }
|
||||
x.report('#gsub!') { str.gsub!('some', 'a') }
|
||||
x.report('#sub') { str.sub('some', 'a') }
|
||||
x.report('#sub!') { str.sub!('some', 'a') }
|
||||
end
|
||||
6
benchmark/symbol-to-proc
Normal file
6
benchmark/symbol-to-proc
Normal file
@@ -0,0 +1,6 @@
|
||||
require 'benchmark/ips'
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('block') { (1..100).map { |i| i.to_s } }
|
||||
x.report('&:to_s') { (1..100).map(&:to_s) }
|
||||
end
|
||||
12
bin/jekyll
12
bin/jekyll
@@ -6,12 +6,11 @@ $:.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
|
||||
|
||||
Jekyll::Deprecator.process(ARGV)
|
||||
|
||||
@@ -30,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)
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
コントリビュート
|
||||
==========
|
||||
|
||||
あなたは Jekyll に投じるすばらしいアイディアを持っています。
|
||||
すばらしいことです!次の事柄を心に留めてください。
|
||||
|
||||
* **テストなしではコントリビュートはできません。**
|
||||
* もし、既存の機能への小さな修正やパッチを作成したなら、シンプルなテストを行います。
|
||||
現在のテストスイートの範囲にとどまり、そして
|
||||
[Shoulda](https://github.com/thoughtbot/shoulda/tree/master) や
|
||||
[RR](https://github.com/btakita/rr/tree/master) を使用してください。
|
||||
* もし、それが新しい機能の場合は、必ず新しい
|
||||
[Cucumber](https://github.com/cucumber/cucumber/) の機能を作成し、
|
||||
必要に応じて手順を再利用します。
|
||||
また、あなたがフォークした `site` に
|
||||
急ぎいくつかのドキュメントを用意し、一度マージを行い
|
||||
メイン `site` の jekyllrb.com に転送していただければ幸いです。
|
||||
* あなたのコントリビュートによって Jekyll の振る舞いが変わった場合、ドキュメントを更新すべきです。
|
||||
それは `site/docs` にあります。
|
||||
もし、 docs に情報の誤りがあった場合、遠慮なく追加してください。
|
||||
すばらしいドキュメントはすばらしいプロジェクトを作ります!
|
||||
* Ruby のコードを変更するときは、 [GitHub Ruby Styleguide](https://github.com/styleguide/ruby)
|
||||
に従ってください。
|
||||
* **小さなプルリクエスト** に最善を尽くしてください。
|
||||
簡単に提案された変更はレビューされ、マージされる可能性が高いです。
|
||||
* プルリクエストを送信するとき、プルリクエストのボディを賢明に使用してください。
|
||||
変更されたかどうかの記述、変更の背後にある動機、 [完了したかどうかのタスクリスト](http://git.io/gfm-tasks)
|
||||
もレビュー時間を早めます。
|
||||
|
||||
テストの依存関係
|
||||
-----------------
|
||||
|
||||
テストスイートの実行や gem のビルドのために、
|
||||
Jekyll の依存ツールをインストールする必要があります。
|
||||
Jekyll は Bundler を使用しており、 `bundle` コマンドを実行すると全ての設定が迅速に行われます!
|
||||
|
||||
$ bundle
|
||||
|
||||
はじめる前に、テストを実行し、必ずテストが通ることを
|
||||
確認してください(あなたの環境が適切に設定されているかを確認するために):
|
||||
|
||||
$ bundle exec rake test
|
||||
$ bundle exec rake features
|
||||
|
||||
ワークフロー
|
||||
--------
|
||||
|
||||
これは、あなたの作業がプロジェクトにマージされるもっとも直接的な方法です:
|
||||
|
||||
* プロジェクトをフォークします。
|
||||
* あなたのフォークプロジェクトをクローンします ( `git clone git@github.com:<username>/jekyll.git` )。
|
||||
* トピックブランチを作成し、あなたの変更を含んでください ( `git checkout -b my_awesome_feature` )。
|
||||
* ハックし、テストを追加します。必ずしもこの順番でなくてかまいません
|
||||
* `rake` を実行し、テストが必ず全て通ることを確認してください
|
||||
* 必要に応じて、エラーがないようにコミットを論理的な塊にリベースしてください
|
||||
* ブランチをプッシュしてください ( `git push origin my_awesome_feature` ).
|
||||
* jekyll/jekyll プロジェクトの master ブランチに対してプルリクエストを作成し、
|
||||
あなたの変更内容と、なぜそれをマージすべきかを記述してください
|
||||
|
||||
ドキュメントの更新
|
||||
----------------------
|
||||
|
||||
私たちは Jekyll のドキュメントについて最善を尽くしたいです。
|
||||
私たちはドキュメントをオープンソース化しました、そして
|
||||
あなたが Jekyll に欠けているものを見つけた場合、私たちはプルリクエストを歓迎しています。
|
||||
|
||||
あなたは、 GitHub.com 上の Jekyll リポジトリの [site]({{ site.repository }}/tree/master/site) で
|
||||
jekyllrb.comのドキュメントを見つけることができます。
|
||||
|
||||
全てのドキュメントのプルリクエストは `master` に向けられる必要があります。
|
||||
他のブランチに向けたプルリクエストは受け入れられません。
|
||||
|
||||
GitHub の [Jekyll wiki](https://github.com/jekyll/jekyll/wiki) は、
|
||||
自由に更新することができるように、プルリクエストなしで
|
||||
全ての GitHub ユーザがアクセス権を持つことができます。
|
||||
|
||||
落とし穴
|
||||
-------
|
||||
|
||||
* もし、 gem のバージョンがかちあった場合、コミットを分けてください。
|
||||
この方法だと、メンテナが gem をリリースするときに制御できます。
|
||||
* jekyll/jekyll の最新コミットに基づいて(複数の)パッチを維持してください。
|
||||
それは適用するためのあなたの仕事で、メンテナがしなければならないことを少なくするのは
|
||||
とてもよいことです。
|
||||
* あなたの GitHub issue で [fix], [feature] などのタグをつけないでください。
|
||||
メンテナは積極的に issue を読み、彼らが問題に出くわしたらラベルをつけるでしょう。
|
||||
|
||||
最後に…
|
||||
----------
|
||||
|
||||
ありがとう! Jekyll のハックは楽しいものでなければなりません。
|
||||
もし、あなたがこのハードを理解するための何かを発見した場合、知らせてください。
|
||||
我々のプロセスやドキュメントを改善することができます!
|
||||
@@ -1,68 +0,0 @@
|
||||
# [Jekyll](http://jekyllrb.com/)
|
||||
|
||||
[](http://badge.fury.io/rb/jekyll)
|
||||
|
||||
[](https://travis-ci.org/jekyll/jekyll)
|
||||
[](https://codeclimate.com/github/jekyll/jekyll)
|
||||
[](https://gemnasium.com/jekyll/jekyll)
|
||||
|
||||
Tom Preston-Werner, Nick Quaranto や多くの[素晴らしいコントリビュータ](https://github.com/jekyll/jekyll/graphs/contributors)によって作成されています!
|
||||
|
||||
Jekyll は個人プロジェクトや組織のサイトに最適な、シンプルで、ブログを意識した静的サイトジェネレータです。
|
||||
複雑さを排除したファイルベースのCMSのようなものと考えてください。
|
||||
Jekyll はコンテンツを受け取り、 Markdown や Liquid テンプレート をレンダリングし、
|
||||
Apache や Nginx やその他の Web サーバに提供する準備ができた静的な Web サイトを完全に出力してくれます。
|
||||
Jekyll は [GitHub Pages](http://pages.github.com) の背後にあるエンジンなので、
|
||||
あなたの GitHub リポジトリからサイトをホストするために使用する事ができます。
|
||||
|
||||
## 原理
|
||||
|
||||
Jekyll あなたがするように伝えたことをします ― それ以上でもそれ以下でもありません。
|
||||
それは、大胆な仮定によってユーザの裏をかこうとせず、
|
||||
また、不必要な複雑さや設定をユーザに負担しません。
|
||||
簡単に言えば、 Jekyll はあなたの道を開け、
|
||||
真に重要なもの: コンテンツに集中することができます。
|
||||
|
||||
## 開始方法
|
||||
|
||||
* gem を[インストール](http://jekyllrb.com/docs/installation/)します
|
||||
* [使用方法](http://jekyllrb.com/docs/usage/) と [設定方法](http://jekyllrb.com/docs/configuration/) を読みます
|
||||
* 既存の [Jekyll で作られたサイト](https://wiki.github.com/jekyll/jekyll/sites) をチラッと見ます
|
||||
* Fork し、あなたの変更を [コントリビュート](http://jekyllrb.com/docs/contributing/) します
|
||||
* 質問があったら? irc.freenode.net の `#jekyll` チャンネルをチェックしてください
|
||||
|
||||
## より深く
|
||||
|
||||
* 以前のシステムからの[移行](http://jekyllrb.com/docs/migrations/)
|
||||
* [YAML Front Matter](http://jekyllrb.com/docs/frontmatter/) がどのように働くかを学ぶ
|
||||
* [変数](http://jekyllrb.com/docs/variables/)を使ってサイトに情報を表示する
|
||||
* posts が生成される時の[パーマリンク](http://jekyllrb.com/docs/permalinks/)をカスタマイズ
|
||||
* 人生を容易にするために、組み込みの [Liquid 拡張](http://jekyllrb.com/docs/templates/)を使用する
|
||||
* あなたのサイト固有のコンテンツを生成するために、カスタム[プラグイン](http://jekyllrb.com/docs/plugins/)を使用する
|
||||
|
||||
## 実行時の依存関係
|
||||
|
||||
* Commander: コマンドラインインターフェース構築 (Ruby)
|
||||
* Colorator: コマンドライン出力に色付け (Ruby)
|
||||
* Classifier: posts の関連を生成 (Ruby)
|
||||
* Directory Watcher: サイトの自動再生成 (Ruby)
|
||||
* Kramdown: デフォルトの Markdown エンジン (Ruby)
|
||||
* Liquid: テンプレートシステム (Ruby)
|
||||
* Pygments.rb: シンタックスハイライト (Ruby/Python)
|
||||
* RedCarpet: Markdown エンジン (Ruby)
|
||||
* Safe YAML: セキュリティのために構築された YAML パーサ (Ruby)
|
||||
|
||||
## 開発時の依存関係
|
||||
|
||||
* Launchy: クロスプラットフォーム ファイルランチャ (Ruby)
|
||||
* Maruku: Markdown スーパーセット インタプリタ (Ruby)
|
||||
* RDiscount: Discount Markdown プロセッサ (Ruby)
|
||||
* RedCloth: Textile サポート (Ruby)
|
||||
* RedGreen: よりよいテスト出力 (Ruby)
|
||||
* RR: モック (Ruby)
|
||||
* Shoulda: テストフレームワーク (Ruby)
|
||||
* SimpleCov: カバレッジフレームワーク (Ruby)
|
||||
|
||||
## ライセンス
|
||||
|
||||
[ライセンス](https://github.com/jekyll/jekyll/blob/master/LICENSE)を見てください。
|
||||
@@ -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"
|
||||
|
||||
@@ -45,6 +45,20 @@ Feature: Data
|
||||
And I should see "Jack" in "_site/index.html"
|
||||
And I should see "Leon" in "_site/index.html"
|
||||
|
||||
Scenario: autoload *.csv files in _data directory
|
||||
Given I have a _data directory
|
||||
And I have a "_data/members.csv" file with content:
|
||||
"""
|
||||
name,age
|
||||
Jack,28
|
||||
Leon,34
|
||||
"""
|
||||
And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
|
||||
When I run jekyll build
|
||||
Then the "_site/index.html" file should exist
|
||||
And I should see "Jack" in "_site/index.html"
|
||||
And I should see "Leon" in "_site/index.html"
|
||||
|
||||
Scenario: autoload *.yml files in _data directory with space in file name
|
||||
Given I have a _data directory
|
||||
And I have a "_data/team members.yml" file with content:
|
||||
|
||||
60
features/incremental_rebuild.feature
Normal file
60
features/incremental_rebuild.feature
Normal 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"
|
||||
@@ -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:
|
||||
"""
|
||||
|
||||
@@ -83,3 +83,13 @@ Feature: Fancy permalinks
|
||||
Then the _site directory should exist
|
||||
And the _site/custom/posts directory should exist
|
||||
And I should see "bla bla" in "_site/custom/posts/some.html"
|
||||
|
||||
Scenario: Use per-post ending in .htm
|
||||
Given I have a _posts directory
|
||||
And I have the following post:
|
||||
| title | date | permalink | content |
|
||||
| Some post | 2013-04-14 | /custom/posts/some.htm | bla bla |
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And the _site/custom/posts directory should exist
|
||||
And I should see "bla bla" in "_site/custom/posts/some.htm"
|
||||
|
||||
34
features/plugins.feature
Normal file
34
features/plugins.feature
Normal file
@@ -0,0 +1,34 @@
|
||||
Feature: Configuring and using plugins
|
||||
As a hacker
|
||||
I want to specify my own plugins that can modify Jekyll's behaviour
|
||||
|
||||
Scenario: Add a gem-based plugin
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with "gems" set to "[jekyll_test_plugin]"
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And I should see "this is a test" in "_site/test.txt"
|
||||
|
||||
Scenario: Add an empty whitelist to restrict all gems
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| gems | [jekyll_test_plugin] |
|
||||
| whitelist | [] |
|
||||
When I run jekyll build --safe
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And the "_site/test.txt" file should not exist
|
||||
|
||||
Scenario: Add a whitelist to restrict some gems but allow others
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| gems | [jekyll_test_plugin, jekyll_test_plugin_malicious] |
|
||||
| whitelist | [jekyll_test_plugin] |
|
||||
When I run jekyll build --safe
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And the "_site/test.txt" file should exist
|
||||
And I should see "this is a test" in "_site/test.txt"
|
||||
@@ -21,14 +21,15 @@ Feature: Rendering
|
||||
And I should not see "Ahoy, indeed!" in "_site/index.css"
|
||||
And I should not see "Ahoy, indeed!" in "_site/index.js"
|
||||
|
||||
Scenario: Don't render liquid in Sass
|
||||
Scenario: Render liquid in Sass
|
||||
Given I have an "index.scss" page that contains ".foo-bar { color:{{site.color}}; }"
|
||||
When I run jekyll build
|
||||
Then the _site directory should not exist
|
||||
And I should see "Invalid CSS after" in the build output
|
||||
|
||||
Scenario: Don't render liquid in CoffeeScript
|
||||
Given I have an "index.coffee" page that contains "hey='for {{site.animal}}'"
|
||||
And I have a configuration file with "color" set to "red"
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "hey = 'for {{site.animal}}';" in "_site/index.js"
|
||||
And I should see ".foo-bar {\n color: red; }" in "_site/index.css"
|
||||
|
||||
Scenario: Render liquid in CoffeeScript
|
||||
Given I have an "index.coffee" page with animal "cicada" that contains "hey='for {{page.animal}}'"
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "hey = 'for cicada';" in "_site/index.js"
|
||||
|
||||
@@ -243,37 +243,6 @@ Feature: Site configuration
|
||||
And I should see "Post Layout: <p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
|
||||
And I should see "Post Layout: <p>content for entry2.</p>" in "_site/2020/01/31/entry2.html"
|
||||
|
||||
Scenario: Add a gem-based plugin
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with "gems" set to "[jekyll_test_plugin]"
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And I should see "this is a test" in "_site/test.txt"
|
||||
|
||||
Scenario: Add an empty whitelist to restrict all gems
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| gems | [jekyll_test_plugin] |
|
||||
| whitelist | [] |
|
||||
When I run jekyll build --safe
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And the "_site/test.txt" file should not exist
|
||||
|
||||
Scenario: Add a whitelist to restrict some gems but allow others
|
||||
Given I have an "index.html" file that contains "Whatever"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| gems | [jekyll_test_plugin, jekyll_test_plugin_malicious] |
|
||||
| whitelist | [jekyll_test_plugin] |
|
||||
When I run jekyll build --safe
|
||||
Then the _site directory should exist
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And the "_site/test.txt" file should exist
|
||||
And I should see "this is a test" in "_site/test.txt"
|
||||
|
||||
Scenario: arbitrary file reads via layouts
|
||||
Given I have an "index.html" page with layout "page" that contains "FOO"
|
||||
And I have a "_config.yml" file that contains "layouts: '../../../../../../../../../../../../../../usr/include'"
|
||||
|
||||
@@ -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
|
||||
@@ -146,6 +151,13 @@ When /^I run jekyll(.*)$/ do |args|
|
||||
end
|
||||
end
|
||||
|
||||
When /^I run bundle(.*)$/ do |args|
|
||||
status = run_bundle(args)
|
||||
if args.include?("--verbose") || ENV['DEBUG']
|
||||
puts jekyll_run_output
|
||||
end
|
||||
end
|
||||
|
||||
When /^I change "(.*)" to contain "(.*)"$/ do |file, text|
|
||||
File.open(file, 'a') do |f|
|
||||
f.write(text)
|
||||
@@ -181,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|
|
||||
|
||||
@@ -1,27 +1,48 @@
|
||||
require 'fileutils'
|
||||
require 'posix-spawn'
|
||||
require 'rr'
|
||||
require 'test/unit'
|
||||
require 'time'
|
||||
|
||||
JEKYLL_SOURCE_DIR = File.dirname(File.dirname(File.dirname(__FILE__)))
|
||||
TEST_DIR = File.expand_path(File.join('..', '..', 'tmp', 'jekyll'), File.dirname(__FILE__))
|
||||
JEKYLL_PATH = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll')
|
||||
JEKYLL_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll'))
|
||||
JEKYLL_COMMAND_OUTPUT_FILE = File.join(File.dirname(TEST_DIR), 'jekyll_output.txt')
|
||||
|
||||
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
|
||||
|
||||
def jekyll_run_output
|
||||
File.read(jekyll_output_file)
|
||||
File.read(jekyll_output_file) if File.file?(jekyll_output_file)
|
||||
end
|
||||
|
||||
def run_bundle(args)
|
||||
child = run_in_shell('bundle', *args.strip.split(' '))
|
||||
end
|
||||
|
||||
def run_jekyll(args)
|
||||
system "#{JEKYLL_PATH} #{args} --trace > #{jekyll_output_file} 2>&1"
|
||||
child = run_in_shell(JEKYLL_PATH, *args.strip.split(' '), "--trace")
|
||||
child.status.exitstatus == 0
|
||||
end
|
||||
|
||||
def run_in_shell(*args)
|
||||
POSIX::Spawn::Child.new *args, :out => [JEKYLL_COMMAND_OUTPUT_FILE, "w"]
|
||||
end
|
||||
|
||||
def slug(title)
|
||||
|
||||
@@ -34,6 +34,7 @@ module Features
|
||||
end
|
||||
|
||||
def after_features(features)
|
||||
@io.puts
|
||||
print_summary(features)
|
||||
end
|
||||
|
||||
@@ -73,18 +74,6 @@ module Features
|
||||
print_feature_element_name(keyword, name, file_colon_line, source_indent)
|
||||
end
|
||||
|
||||
def before_examples_array(examples_array)
|
||||
end
|
||||
|
||||
def examples_name(keyword, name)
|
||||
end
|
||||
|
||||
def before_outline_table(outline_table)
|
||||
end
|
||||
|
||||
def after_outline_table(outline_table)
|
||||
end
|
||||
|
||||
def scenario_name(keyword, name, file_colon_line, source_indent)
|
||||
print_feature_element_name(keyword, name, file_colon_line, source_indent)
|
||||
end
|
||||
@@ -121,38 +110,13 @@ module Features
|
||||
@io.print CHARS[status]
|
||||
end
|
||||
|
||||
def doc_string(string)
|
||||
return if @options[:no_multiline] || @hide_this_step
|
||||
s = %{"""\n#{string}\n"""}.indent(@indent)
|
||||
s = s.split("\n").map{|l| l =~ /^\s+$/ ? '' : l}.join("\n")
|
||||
@io.puts(format_string(s, @current_step.status))
|
||||
@io.flush
|
||||
end
|
||||
|
||||
def exception(exception, status)
|
||||
return if @hide_this_step
|
||||
@io.puts
|
||||
print_exception(exception, status, @indent)
|
||||
@io.flush
|
||||
end
|
||||
|
||||
def before_multiline_arg(multiline_arg)
|
||||
end
|
||||
|
||||
def after_multiline_arg(multiline_arg)
|
||||
end
|
||||
|
||||
def before_table_row(table_row)
|
||||
end
|
||||
|
||||
def after_table_row(table_row)
|
||||
end
|
||||
|
||||
def after_table_cell(cell)
|
||||
end
|
||||
|
||||
def table_cell_value(value, status)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def print_feature_element_name(keyword, name, file_colon_line, source_indent)
|
||||
|
||||
@@ -5,62 +5,44 @@ require 'jekyll/version'
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.specification_version = 2 if s.respond_to? :specification_version=
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
||||
s.rubygems_version = '2.2.2'
|
||||
s.required_ruby_version = '>= 1.9.3'
|
||||
s.required_ruby_version = '>= 2.0.0'
|
||||
|
||||
s.name = 'jekyll'
|
||||
s.version = Jekyll::VERSION
|
||||
s.license = 'MIT'
|
||||
s.name = 'jekyll'
|
||||
s.version = Jekyll::VERSION
|
||||
s.license = 'MIT'
|
||||
|
||||
s.summary = "A simple, blog aware, static site generator."
|
||||
s.description = "Jekyll is a simple, blog aware, static site generator."
|
||||
s.summary = 'A simple, blog aware, static site generator.'
|
||||
s.description = 'Jekyll is a simple, blog aware, static site generator.'
|
||||
|
||||
s.authors = ["Tom Preston-Werner"]
|
||||
s.email = 'tom@mojombo.com'
|
||||
s.homepage = 'https://github.com/jekyll/jekyll'
|
||||
s.authors = ['Tom Preston-Werner']
|
||||
s.email = 'tom@mojombo.com'
|
||||
s.homepage = 'https://github.com/jekyll/jekyll'
|
||||
|
||||
all_files = `git ls-files -z`.split("\x0")
|
||||
s.files = all_files.grep(%r{^(bin|lib)/})
|
||||
s.executables = all_files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
s.require_paths = ["lib"]
|
||||
s.require_paths = ['lib']
|
||||
|
||||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.rdoc_options = ['--charset=UTF-8']
|
||||
s.extra_rdoc_files = %w[README.markdown LICENSE]
|
||||
|
||||
s.add_runtime_dependency('liquid', "~> 2.6.1")
|
||||
s.add_runtime_dependency('kramdown', "~> 1.3")
|
||||
s.add_runtime_dependency('mercenary', "~> 0.3.3")
|
||||
s.add_runtime_dependency('safe_yaml', "~> 1.0")
|
||||
s.add_runtime_dependency('colorator', "~> 0.1")
|
||||
s.add_runtime_dependency('liquid', '~> 3.0')
|
||||
s.add_runtime_dependency('kramdown', '~> 1.3')
|
||||
s.add_runtime_dependency('mercenary', '~> 0.3.3')
|
||||
s.add_runtime_dependency('safe_yaml', '~> 1.0')
|
||||
s.add_runtime_dependency('colorator', '~> 0.1')
|
||||
|
||||
# Before 3.0 drops, phase the following gems out as dev dependencies
|
||||
# and gracefully handle their absence.
|
||||
s.add_runtime_dependency('pygments.rb', "~> 0.6.0")
|
||||
s.add_runtime_dependency('redcarpet', "~> 3.1")
|
||||
s.add_runtime_dependency('pygments.rb', '~> 0.6.0')
|
||||
s.add_runtime_dependency('redcarpet', '~> 3.1')
|
||||
s.add_runtime_dependency('toml', '~> 0.1.0')
|
||||
s.add_runtime_dependency('jekyll-paginate', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-gist', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
|
||||
s.add_runtime_dependency('classifier-reborn', "~> 2.0")
|
||||
|
||||
s.add_development_dependency('rake', "~> 10.1")
|
||||
s.add_development_dependency('rdoc', "~> 3.11")
|
||||
s.add_development_dependency('redgreen', "~> 1.2")
|
||||
s.add_development_dependency('shoulda', "~> 3.5")
|
||||
s.add_development_dependency('rr', "~> 1.1")
|
||||
s.add_development_dependency('cucumber', "1.3.11")
|
||||
s.add_development_dependency('RedCloth', "~> 4.2")
|
||||
s.add_development_dependency('maruku', "~> 0.7.0")
|
||||
s.add_development_dependency('rdiscount', "~> 1.6")
|
||||
s.add_development_dependency('launchy', "~> 2.3")
|
||||
s.add_development_dependency('simplecov', "~> 0.7")
|
||||
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.3')
|
||||
s.add_runtime_dependency('classifier-reborn', '~> 2.0')
|
||||
end
|
||||
|
||||
150
lib/jekyll.rb
150
lib/jekyll.rb
@@ -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'
|
||||
@@ -68,66 +72,94 @@ module Jekyll
|
||||
require 'jekyll/command'
|
||||
require 'jekyll/liquid_extensions'
|
||||
|
||||
# Public: Tells you which Jekyll environment you are building in so you can skip tasks
|
||||
# if you need to. This is useful when doing expensive compression tasks on css and
|
||||
# images and allows you to skip that when working in development.
|
||||
class << self
|
||||
# Public: Tells you which Jekyll environment you are building in so you can skip tasks
|
||||
# if you need to. This is useful when doing expensive compression tasks on css and
|
||||
# images and allows you to skip that when working in development.
|
||||
|
||||
def self.env
|
||||
ENV["JEKYLL_ENV"] || "development"
|
||||
end
|
||||
|
||||
# Public: Generate a Jekyll configuration Hash by merging the default
|
||||
# options with anything in _config.yml, and adding the given options on top.
|
||||
#
|
||||
# override - A Hash of config directives that override any options in both
|
||||
# the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
|
||||
# list of option names and their defaults.
|
||||
#
|
||||
# Returns the final configuration Hash.
|
||||
def self.configuration(override)
|
||||
config = Configuration[Configuration::DEFAULTS]
|
||||
override = Configuration[override].stringify_keys
|
||||
config = config.read_config_files(config.config_files(override))
|
||||
|
||||
# Merge DEFAULTS < _config.yml < override
|
||||
config = Utils.deep_merge_hashes(config, override).stringify_keys
|
||||
set_timezone(config['timezone']) if config['timezone']
|
||||
|
||||
config
|
||||
end
|
||||
|
||||
# Static: Set the TZ environment variable to use the timezone specified
|
||||
#
|
||||
# timezone - the IANA Time Zone
|
||||
#
|
||||
# Returns nothing
|
||||
def self.set_timezone(timezone)
|
||||
ENV['TZ'] = timezone
|
||||
end
|
||||
|
||||
def self.logger
|
||||
@logger ||= LogAdapter.new(Stevenson.new)
|
||||
end
|
||||
|
||||
def self.logger=(writer)
|
||||
@logger = LogAdapter.new(writer)
|
||||
end
|
||||
|
||||
# Public: File system root
|
||||
#
|
||||
# Returns the root of the filesystem as a Pathname
|
||||
def self.fs_root
|
||||
@fs_root ||= "/"
|
||||
end
|
||||
|
||||
def self.sanitized_path(base_directory, questionable_path)
|
||||
clean_path = File.expand_path(questionable_path, fs_root)
|
||||
clean_path.gsub!(/\A\w\:\//, '/')
|
||||
unless clean_path.start_with?(base_directory)
|
||||
File.join(base_directory, clean_path)
|
||||
else
|
||||
clean_path
|
||||
def env
|
||||
ENV["JEKYLL_ENV"] || "development"
|
||||
end
|
||||
|
||||
# Public: Generate a Jekyll configuration Hash by merging the default
|
||||
# options with anything in _config.yml, and adding the given options on top.
|
||||
#
|
||||
# override - A Hash of config directives that override any options in both
|
||||
# the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
|
||||
# list of option names and their defaults.
|
||||
#
|
||||
# Returns the final configuration Hash.
|
||||
def configuration(override = Hash.new)
|
||||
config = Configuration[Configuration::DEFAULTS]
|
||||
override = Configuration[override].stringify_keys
|
||||
unless override.delete('skip_config_files')
|
||||
config = config.read_config_files(config.config_files(override))
|
||||
end
|
||||
|
||||
# Merge DEFAULTS < _config.yml < override
|
||||
config = Utils.deep_merge_hashes(config, override).stringify_keys
|
||||
set_timezone(config['timezone']) if config['timezone']
|
||||
|
||||
config
|
||||
end
|
||||
|
||||
# Public: Set the TZ environment variable to use the timezone specified
|
||||
#
|
||||
# timezone - the IANA Time Zone
|
||||
#
|
||||
# Returns nothing
|
||||
def set_timezone(timezone)
|
||||
ENV['TZ'] = timezone
|
||||
end
|
||||
|
||||
# Public: Fetch the logger instance for this Jekyll process.
|
||||
#
|
||||
# Returns the LogAdapter instance.
|
||||
def logger
|
||||
@logger ||= LogAdapter.new(Stevenson.new, (ENV["JEKYLL_LOG_LEVEL"] || :info).to_sym)
|
||||
end
|
||||
|
||||
# Public: Set the log writer.
|
||||
# New log writer must respond to the same methods
|
||||
# as Ruby's interal Logger.
|
||||
#
|
||||
# writer - the new Logger-compatible log transport
|
||||
#
|
||||
# Returns the new logger.
|
||||
def logger=(writer)
|
||||
@logger = LogAdapter.new(writer)
|
||||
end
|
||||
|
||||
# Public: An array of sites
|
||||
#
|
||||
# Returns the Jekyll sites created.
|
||||
def sites
|
||||
@sites ||= []
|
||||
end
|
||||
|
||||
# Public: Ensures the questionable path is prefixed with the base directory
|
||||
# and prepends the questionable path with the base directory if false.
|
||||
#
|
||||
# base_directory - the directory with which to prefix the questionable path
|
||||
# questionable_path - the path we're unsure about, and want prefixed
|
||||
#
|
||||
# Returns the sanitized path.
|
||||
def sanitized_path(base_directory, questionable_path)
|
||||
return base_directory if base_directory.eql?(questionable_path)
|
||||
|
||||
clean_path = File.expand_path(questionable_path, "/")
|
||||
clean_path = clean_path.sub(/\A\w\:\//, '/')
|
||||
|
||||
unless clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
|
||||
File.join(base_directory, clean_path)
|
||||
else
|
||||
clean_path
|
||||
end
|
||||
end
|
||||
|
||||
# Conditional optimizations
|
||||
Jekyll::External.require_if_present('liquid-c')
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -138,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
|
||||
|
||||
@@ -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,12 +25,19 @@ 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
|
||||
def existing_files
|
||||
files = Set.new
|
||||
Dir.glob(File.join(site.dest, "**", "*"), File::FNM_DOTMATCH) do |file|
|
||||
Dir.glob(site.in_dest_dir("**", "*"), File::FNM_DOTMATCH) do |file|
|
||||
files << file unless file =~ /\/\.{1,2}$/ || file =~ keep_file_regex || keep_dirs.include?(file)
|
||||
end
|
||||
files
|
||||
@@ -76,7 +84,7 @@ module Jekyll
|
||||
#
|
||||
# Returns a Set with the directory paths
|
||||
def keep_dirs
|
||||
site.keep_files.map{|file| parent_dirs(File.join(site.dest, file))}.flatten.to_set
|
||||
site.keep_files.map { |file| parent_dirs(site.in_dest_dir(file)) }.flatten.to_set
|
||||
end
|
||||
|
||||
# Private: Creates a regular expression from the config's keep_files array
|
||||
|
||||
@@ -35,13 +35,14 @@ module Jekyll
|
||||
# Returns the sorted array of docs.
|
||||
def read
|
||||
filtered_entries.each do |file_path|
|
||||
full_path = Jekyll.sanitized_path(directory, file_path)
|
||||
full_path = collection_dir(file_path)
|
||||
next if File.directory?(full_path)
|
||||
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 = File.join(relative_directory, File.dirname(file_path)).chomp("/.")
|
||||
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)
|
||||
end
|
||||
end
|
||||
@@ -54,9 +55,10 @@ module Jekyll
|
||||
# relative to the collection's directory
|
||||
def entries
|
||||
return Array.new unless exists?
|
||||
Dir.glob(File.join(directory, "**", "*.*")).map do |entry|
|
||||
entry[File.join(directory, "")] = ''; entry
|
||||
end
|
||||
@entries ||=
|
||||
Dir.glob(collection_dir("**", "*.*")).map do |entry|
|
||||
entry["#{collection_dir}/"] = ''; entry
|
||||
end
|
||||
end
|
||||
|
||||
# Filtered version of the entries in this collection.
|
||||
@@ -65,9 +67,13 @@ module Jekyll
|
||||
# Returns a list of filtered entry paths.
|
||||
def filtered_entries
|
||||
return Array.new unless exists?
|
||||
Dir.chdir(directory) do
|
||||
entry_filter.filter(entries).reject { |f| File.directory?(f) }
|
||||
end
|
||||
@filtered_entries ||=
|
||||
Dir.chdir(directory) do
|
||||
entry_filter.filter(entries).reject do |f|
|
||||
path = collection_dir(f)
|
||||
File.directory?(path) || (File.symlink?(f) && site.safe)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# The directory for this Collection, relative to the site source.
|
||||
@@ -75,15 +81,28 @@ module Jekyll
|
||||
# Returns a String containing the directory name where the collection
|
||||
# is stored on the filesystem.
|
||||
def relative_directory
|
||||
"_#{label}"
|
||||
@relative_directory ||= "_#{label}"
|
||||
end
|
||||
|
||||
# The full path to the directory containing the
|
||||
# The full path to the directory containing the collection.
|
||||
#
|
||||
# Returns a String containing th directory name where the collection
|
||||
# is stored on the filesystem.
|
||||
def directory
|
||||
Jekyll.sanitized_path(site.source, relative_directory)
|
||||
@directory ||= site.in_source_dir(relative_directory)
|
||||
end
|
||||
|
||||
# The full path to the directory containing the collection, with
|
||||
# optional subpaths.
|
||||
#
|
||||
# *files - (optional) any other path pieces relative to the
|
||||
# directory to append to the path
|
||||
#
|
||||
# Returns a String containing th directory name where the collection
|
||||
# is stored on the filesystem.
|
||||
def collection_dir(*files)
|
||||
return directory if files.empty?
|
||||
site.in_source_dir(relative_directory, *files)
|
||||
end
|
||||
|
||||
# Checks whether the directory "exists" for this collection.
|
||||
@@ -164,6 +183,5 @@ module Jekyll
|
||||
{}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,13 +51,14 @@ module Jekyll
|
||||
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||
c.option 'future', '--future', 'Publishes posts with a future date'
|
||||
c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish'
|
||||
c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild'
|
||||
c.option 'watch', '-w', '--[no-]watch', 'Watch for changes and rebuild'
|
||||
c.option 'force_polling', '--force_polling', 'Force watch to use polling'
|
||||
c.option 'lsi', '--lsi', 'Use LSI for improved related posts'
|
||||
c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder'
|
||||
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
|
||||
|
||||
@@ -9,6 +9,7 @@ module Jekyll
|
||||
prog.command(:build) do |c|
|
||||
c.syntax 'build [options]'
|
||||
c.description 'Build your site'
|
||||
c.alias :b
|
||||
|
||||
add_build_options(c)
|
||||
|
||||
@@ -49,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."
|
||||
@@ -63,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
|
||||
|
||||
|
||||
42
lib/jekyll/commands/clean.rb
Normal file
42
lib/jekyll/commands/clean.rb
Normal 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
|
||||
@@ -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
|
||||
@@ -3,78 +3,80 @@ require 'erb'
|
||||
module Jekyll
|
||||
module Commands
|
||||
class New < Command
|
||||
def self.init_with_program(prog)
|
||||
prog.command(:new) do |c|
|
||||
c.syntax 'new PATH'
|
||||
c.description 'Creates a new Jekyll site scaffold in PATH'
|
||||
class << self
|
||||
def init_with_program(prog)
|
||||
prog.command(:new) do |c|
|
||||
c.syntax 'new PATH'
|
||||
c.description 'Creates a new Jekyll site scaffold in PATH'
|
||||
|
||||
c.option 'force', '--force', 'Force creation even if PATH already exists'
|
||||
c.option 'blank', '--blank', 'Creates scaffolding but with empty files'
|
||||
|
||||
c.action do |args, options|
|
||||
Jekyll::Commands::New.process(args, options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.process(args, options = {})
|
||||
raise ArgumentError.new('You must specify a path.') if args.empty?
|
||||
|
||||
new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
|
||||
FileUtils.mkdir_p new_blog_path
|
||||
if preserve_source_location?(new_blog_path, options)
|
||||
Jekyll.logger.abort_with "Conflict:", "#{new_blog_path} exists and is not empty."
|
||||
end
|
||||
|
||||
if options["blank"]
|
||||
create_blank_site new_blog_path
|
||||
else
|
||||
create_sample_files new_blog_path
|
||||
|
||||
File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f|
|
||||
f.write(scaffold_post_content)
|
||||
c.option 'force', '--force', 'Force creation even if PATH already exists'
|
||||
c.option 'blank', '--blank', 'Creates scaffolding but with empty files'
|
||||
|
||||
c.action do |args, options|
|
||||
Jekyll::Commands::New.process(args, options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Jekyll.logger.info "New jekyll site installed in #{new_blog_path}."
|
||||
end
|
||||
def process(args, options = {})
|
||||
raise ArgumentError.new('You must specify a path.') if args.empty?
|
||||
|
||||
def self.create_blank_site(path)
|
||||
Dir.chdir(path) do
|
||||
FileUtils.mkdir(%w(_layouts _posts _drafts))
|
||||
FileUtils.touch("index.html")
|
||||
new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
|
||||
FileUtils.mkdir_p new_blog_path
|
||||
if preserve_source_location?(new_blog_path, options)
|
||||
Jekyll.logger.abort_with "Conflict:", "#{new_blog_path} exists and is not empty."
|
||||
end
|
||||
|
||||
if options["blank"]
|
||||
create_blank_site new_blog_path
|
||||
else
|
||||
create_sample_files new_blog_path
|
||||
|
||||
File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f|
|
||||
f.write(scaffold_post_content)
|
||||
end
|
||||
end
|
||||
|
||||
Jekyll.logger.info "New jekyll site installed in #{new_blog_path}."
|
||||
end
|
||||
end
|
||||
|
||||
def self.scaffold_post_content
|
||||
ERB.new(File.read(File.expand_path(scaffold_path, site_template))).result
|
||||
end
|
||||
def create_blank_site(path)
|
||||
Dir.chdir(path) do
|
||||
FileUtils.mkdir(%w(_layouts _posts _drafts))
|
||||
FileUtils.touch("index.html")
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Gets the filename of the sample post to be created
|
||||
#
|
||||
# Returns the filename of the sample post, as a String
|
||||
def self.initialized_post_name
|
||||
"_posts/#{Time.now.strftime('%Y-%m-%d')}-welcome-to-jekyll.markdown"
|
||||
end
|
||||
def scaffold_post_content
|
||||
ERB.new(File.read(File.expand_path(scaffold_path, site_template))).result
|
||||
end
|
||||
|
||||
private
|
||||
# Internal: Gets the filename of the sample post to be created
|
||||
#
|
||||
# Returns the filename of the sample post, as a String
|
||||
def initialized_post_name
|
||||
"_posts/#{Time.now.strftime('%Y-%m-%d')}-welcome-to-jekyll.markdown"
|
||||
end
|
||||
|
||||
def self.preserve_source_location?(path, options)
|
||||
!options["force"] && !Dir["#{path}/**/*"].empty?
|
||||
end
|
||||
private
|
||||
|
||||
def self.create_sample_files(path)
|
||||
FileUtils.cp_r site_template + '/.', path
|
||||
FileUtils.rm File.expand_path(scaffold_path, path)
|
||||
end
|
||||
def preserve_source_location?(path, options)
|
||||
!options["force"] && !Dir["#{path}/**/*"].empty?
|
||||
end
|
||||
|
||||
def self.site_template
|
||||
File.expand_path("../../site_template", File.dirname(__FILE__))
|
||||
end
|
||||
def create_sample_files(path)
|
||||
FileUtils.cp_r site_template + '/.', path
|
||||
FileUtils.rm File.expand_path(scaffold_path, path)
|
||||
end
|
||||
|
||||
def self.scaffold_path
|
||||
"_posts/0000-00-00-welcome-to-jekyll.markdown.erb"
|
||||
end
|
||||
def site_template
|
||||
File.expand_path("../../site_template", File.dirname(__FILE__))
|
||||
end
|
||||
|
||||
def scaffold_path
|
||||
"_posts/0000-00-00-welcome-to-jekyll.markdown.erb"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,6 +10,7 @@ module Jekyll
|
||||
c.syntax 'serve [options]'
|
||||
c.description 'Serve your site locally'
|
||||
c.alias :server
|
||||
c.alias :s
|
||||
|
||||
add_build_options(c)
|
||||
|
||||
@@ -20,7 +21,8 @@ module Jekyll
|
||||
c.option 'skip_initial_build', '--skip-initial-build', 'Skips the initial site build which occurs before the server is started.'
|
||||
|
||||
c.action do |args, options|
|
||||
options["serving"] ||= true
|
||||
options["serving"] = true
|
||||
options["watch"] = true unless options.key?("watch")
|
||||
Jekyll::Commands::Build.process(options)
|
||||
Jekyll::Commands::Serve.process(options)
|
||||
end
|
||||
@@ -74,16 +76,20 @@ module Jekyll
|
||||
|
||||
def webrick_options(config)
|
||||
opts = {
|
||||
:DocumentRoot => config['destination'],
|
||||
:Port => config['port'],
|
||||
:BindAddress => config['host'],
|
||||
:MimeTypes => mime_types,
|
||||
:DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml),
|
||||
:DocumentRoot => config['destination'],
|
||||
:DoNotReverseLookup => true,
|
||||
:StartCallback => start_callback(config['detach']),
|
||||
:DirectoryIndex => %w(index.html index.htm index.cgi index.rhtml index.xml)
|
||||
:MimeTypes => mime_types,
|
||||
:Port => config['port'],
|
||||
:StartCallback => start_callback(config['detach'])
|
||||
}
|
||||
|
||||
if !config['verbose']
|
||||
if config['verbose']
|
||||
opts.merge!({
|
||||
:Logger => WEBrick::Log.new($stdout, WEBrick::Log::DEBUG)
|
||||
})
|
||||
else
|
||||
opts.merge!({
|
||||
:AccessLog => [],
|
||||
:Logger => WEBrick::Log.new([], WEBrick::Log::WARN)
|
||||
@@ -117,9 +123,10 @@ module Jekyll
|
||||
|
||||
# recreate NondisclosureName under utf-8 circumstance
|
||||
def file_handler_options
|
||||
fh_option = WEBrick::Config::FileHandler
|
||||
fh_option[:NondisclosureName] = ['.ht*','~*']
|
||||
fh_option
|
||||
WEBrick::Config::FileHandler.merge({
|
||||
:FancyIndexing => true,
|
||||
:NondisclosureName => ['.ht*','~*']
|
||||
})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -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,
|
||||
@@ -42,7 +43,7 @@ module Jekyll
|
||||
# Serving
|
||||
'detach' => false, # default to not detaching the server
|
||||
'port' => '4000',
|
||||
'host' => '0.0.0.0',
|
||||
'host' => '127.0.0.1',
|
||||
'baseurl' => '',
|
||||
|
||||
# Backwards-compatibility options
|
||||
@@ -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',
|
||||
@@ -211,7 +212,7 @@ module Jekyll
|
||||
if config.key?('auto') || config.key?('watch')
|
||||
Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
|
||||
" be set from your configuration file(s). Use the"+
|
||||
" --watch/-w command-line option instead."
|
||||
" --[no-]watch/-w command-line option instead."
|
||||
config.delete('auto')
|
||||
config.delete('watch')
|
||||
end
|
||||
@@ -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 " +
|
||||
|
||||
@@ -46,9 +46,15 @@ module Jekyll
|
||||
].map(&:to_sym)
|
||||
end
|
||||
|
||||
def extname_matches_regexp
|
||||
@extname_matches_regexp ||= Regexp.new(
|
||||
'^\.(' + @config['markdown_ext'].gsub(',','|') +')$',
|
||||
Regexp::IGNORECASE
|
||||
)
|
||||
end
|
||||
|
||||
def matches(ext)
|
||||
rgx = '^\.(' + @config['markdown_ext'].gsub(',','|') +')$'
|
||||
ext =~ Regexp.new(rgx, Regexp::IGNORECASE)
|
||||
ext =~ extname_matches_regexp
|
||||
end
|
||||
|
||||
def output_ext(ext)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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' }),
|
||||
@@ -48,14 +48,14 @@ module Jekyll
|
||||
end
|
||||
|
||||
protected
|
||||
def rouge_formatter(opts = {})
|
||||
Rouge::Formatters::HTML.new(opts.merge(wrap: false))
|
||||
def rouge_formatter(lexer)
|
||||
Rouge::Formatters::HTML.new(:wrap => false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
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
|
||||
])
|
||||
|
||||
@@ -16,9 +16,15 @@ module Jekyll
|
||||
raise Errors::FatalException.new("Missing dependency: RedCloth")
|
||||
end
|
||||
|
||||
def extname_matches_regexp
|
||||
@extname_matches_regexp ||= Regexp.new(
|
||||
'(' + @config['textile_ext'].gsub(',','|') +')$',
|
||||
Regexp::IGNORECASE
|
||||
)
|
||||
end
|
||||
|
||||
def matches(ext)
|
||||
rgx = '(' + @config['textile_ext'].gsub(',','|') +')'
|
||||
ext =~ Regexp.new(rgx, Regexp::IGNORECASE)
|
||||
ext =~ extname_matches_regexp
|
||||
end
|
||||
|
||||
def output_ext(ext)
|
||||
|
||||
@@ -43,7 +43,7 @@ module Jekyll
|
||||
# Returns nothing.
|
||||
def read_yaml(base, name, opts = {})
|
||||
begin
|
||||
self.content = File.read(Jekyll.sanitized_path(base, name),
|
||||
self.content = File.read(site.in_source_dir(base, name),
|
||||
merged_file_read_opts(opts))
|
||||
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
@@ -60,13 +60,14 @@ module Jekyll
|
||||
|
||||
# Transform the contents based on the content type.
|
||||
#
|
||||
# Returns nothing.
|
||||
# Returns the transformed contents.
|
||||
def transform
|
||||
converters.reduce(content) do |output, converter|
|
||||
begin
|
||||
converter.convert output
|
||||
rescue => e
|
||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{path}'."
|
||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error while converting '#{path}':"
|
||||
Jekyll.logger.error("", e.to_s)
|
||||
raise e
|
||||
end
|
||||
end
|
||||
@@ -162,16 +163,23 @@ module Jekyll
|
||||
|
||||
# Determine whether the file should be rendered with Liquid.
|
||||
#
|
||||
# Returns false if the document is either an asset file or a yaml file,
|
||||
# true otherwise.
|
||||
# Always returns true.
|
||||
def render_with_liquid?
|
||||
!coffeescript_file?
|
||||
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 either an asset file or a yaml file,
|
||||
# true otherwise.
|
||||
# Returns false if the document is an asset file.
|
||||
def place_in_layout?
|
||||
!asset_file?
|
||||
end
|
||||
@@ -208,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,7 @@ module Jekyll
|
||||
class Document
|
||||
include Comparable
|
||||
|
||||
attr_reader :path, :site
|
||||
attr_reader :path, :site, :extname
|
||||
attr_accessor :content, :collection, :output
|
||||
|
||||
# Create a new Document.
|
||||
@@ -16,6 +16,7 @@ module Jekyll
|
||||
def initialize(path, relations)
|
||||
@site = relations[:site]
|
||||
@path = path
|
||||
@extname = File.extname(path)
|
||||
@collection = relations[:collection]
|
||||
@has_yaml_header = nil
|
||||
end
|
||||
@@ -33,23 +34,21 @@ module Jekyll
|
||||
# Returns a String path which represents the relative path
|
||||
# from the site source to this document
|
||||
def relative_path
|
||||
Pathname.new(path).relative_path_from(Pathname.new(site.source)).to_s
|
||||
@relative_path ||= Pathname.new(path).relative_path_from(Pathname.new(site.source)).to_s
|
||||
end
|
||||
|
||||
# The base filename of the document, without the file extname.
|
||||
#
|
||||
# Returns the basename without the file extname.
|
||||
def basename_without_ext
|
||||
@basename_without_ext ||= File.basename(path, '.*')
|
||||
end
|
||||
|
||||
# The base filename of the document.
|
||||
#
|
||||
# suffix - (optional) the suffix to be removed from the end of the filename
|
||||
#
|
||||
# Returns the base filename of the document.
|
||||
def basename(suffix = "")
|
||||
File.basename(path, suffix)
|
||||
end
|
||||
|
||||
# The extension name of the document.
|
||||
#
|
||||
# Returns the extension name of the document.
|
||||
def extname
|
||||
File.extname(path)
|
||||
def basename
|
||||
@basename ||= File.basename(path)
|
||||
end
|
||||
|
||||
# Produces a "cleaned" relative path.
|
||||
@@ -64,7 +63,8 @@ module Jekyll
|
||||
#
|
||||
# Returns the cleaned relative path of the document.
|
||||
def cleaned_relative_path
|
||||
relative_path[0 .. -extname.length - 1].sub(collection.relative_directory, "")
|
||||
@cleaned_relative_path ||=
|
||||
relative_path[0 .. -extname.length - 1].sub(collection.relative_directory, "")
|
||||
end
|
||||
|
||||
# Determine whether the document is a YAML 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,
|
||||
@@ -128,7 +135,9 @@ module Jekyll
|
||||
{
|
||||
collection: collection.label,
|
||||
path: cleaned_relative_path,
|
||||
output_ext: Jekyll::Renderer.new(site, self).output_ext
|
||||
output_ext: Jekyll::Renderer.new(site, self).output_ext,
|
||||
name: Utils.slugify(basename_without_ext),
|
||||
title: Utils.slugify(data['title']) || Utils.slugify(basename_without_ext)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -157,7 +166,8 @@ module Jekyll
|
||||
#
|
||||
# Returns the full path to the output file of this document.
|
||||
def destination(base_directory)
|
||||
path = Jekyll.sanitized_path(base_directory, url)
|
||||
dest = site.in_dest_dir(base_directory)
|
||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||
path = File.join(path, "index.html") if url =~ /\/$/
|
||||
path
|
||||
end
|
||||
@@ -230,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
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
# Get the full path to the directory containing the draft files
|
||||
def containing_dir(source, dir)
|
||||
File.join(source, dir, '_drafts')
|
||||
def containing_dir(dir)
|
||||
site.in_source_dir(dir, '_drafts')
|
||||
end
|
||||
|
||||
# The path to the draft source file, relative to the site source
|
||||
|
||||
@@ -47,7 +47,7 @@ module Jekyll
|
||||
|
||||
def excluded?(entry)
|
||||
excluded = glob_include?(site.exclude, relative_to_source(entry))
|
||||
Jekyll.logger.debug "excluded?(#{relative_to_source(entry)}) ==> #{excluded}"
|
||||
Jekyll.logger.debug "EntryFilter:", "excluded?(#{relative_to_source(entry)}) ==> #{excluded}"
|
||||
excluded
|
||||
end
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ module Jekyll
|
||||
# Returns excerpt String
|
||||
def extract_excerpt(post_content)
|
||||
separator = site.config['excerpt_separator']
|
||||
head, _, tail = post_content.partition(separator)
|
||||
head, _, tail = post_content.to_s.partition(separator)
|
||||
|
||||
"" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n")
|
||||
end
|
||||
|
||||
59
lib/jekyll/external.rb
Normal file
59
lib/jekyll/external.rb
Normal 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
|
||||
@@ -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,10 +43,21 @@ 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
|
||||
|
||||
# Slugify a filename or title.
|
||||
#
|
||||
# input - The filename or title to slugify.
|
||||
#
|
||||
# Returns the given filename or title as a lowercase String, with every
|
||||
# sequence of spaces and non-alphanumeric characters replaced with a
|
||||
# hyphen.
|
||||
def slugify(input)
|
||||
Utils.slugify(input)
|
||||
end
|
||||
|
||||
# Format a date in short format e.g. "27 Jan 2011".
|
||||
#
|
||||
# date - the Time to format.
|
||||
@@ -203,12 +214,13 @@ module Jekyll
|
||||
# Filter an array of objects
|
||||
#
|
||||
# input - the object array
|
||||
# key - key within each object to filter by
|
||||
# property - property within each object to filter by
|
||||
# value - desired value
|
||||
#
|
||||
# Returns the filtered array of objects
|
||||
def where(input, property, value)
|
||||
return input unless input.is_a?(Array)
|
||||
return input unless input.is_a?(Enumerable)
|
||||
input = input.values if input.is_a?(Hash)
|
||||
input.select { |object| item_property(object, property) == value }
|
||||
end
|
||||
|
||||
@@ -248,6 +260,43 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
def pop(array, input = 1)
|
||||
return array unless array.is_a?(Array)
|
||||
new_ary = array.dup
|
||||
new_ary.pop(input.to_i || 1)
|
||||
new_ary
|
||||
end
|
||||
|
||||
def push(array, input)
|
||||
return array unless array.is_a?(Array)
|
||||
new_ary = array.dup
|
||||
new_ary.push(input)
|
||||
new_ary
|
||||
end
|
||||
|
||||
def shift(array, input = 1)
|
||||
return array unless array.is_a?(Array)
|
||||
new_ary = array.dup
|
||||
new_ary.shift(input.to_i || 1)
|
||||
new_ary
|
||||
end
|
||||
|
||||
def unshift(array, input)
|
||||
return array unless array.is_a?(Array)
|
||||
new_ary = array.dup
|
||||
new_ary.unshift(input)
|
||||
new_ary
|
||||
end
|
||||
|
||||
# Convert an object into its String representation for debugging
|
||||
#
|
||||
# input - The Object to be converted
|
||||
#
|
||||
# Returns a String representation of the object.
|
||||
def inspect(input)
|
||||
CGI.escapeHTML(input.inspect)
|
||||
end
|
||||
|
||||
private
|
||||
def time(input)
|
||||
case input
|
||||
@@ -260,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)
|
||||
@@ -278,7 +327,25 @@ module Jekyll
|
||||
end
|
||||
|
||||
def as_liquid(item)
|
||||
item.respond_to?(:to_liquid) ? item.to_liquid : item
|
||||
case item
|
||||
when Hash
|
||||
pairs = item.map { |k, v| as_liquid([k, v]) }
|
||||
Hash[pairs]
|
||||
when Array
|
||||
item.map{ |i| as_liquid(i) }
|
||||
else
|
||||
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
|
||||
end
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ module Jekyll
|
||||
end
|
||||
|
||||
def layout_directory_inside_source
|
||||
Jekyll.sanitized_path(site.source, site.config['layouts'])
|
||||
site.in_source_dir(site.config['layouts'])
|
||||
end
|
||||
|
||||
def layout_directory_in_cwd
|
||||
dir = Jekyll.sanitized_path(Dir.pwd, site.config['layouts'])
|
||||
if File.directory?(dir)
|
||||
if File.directory?(dir) && !site.safe
|
||||
dir
|
||||
else
|
||||
nil
|
||||
|
||||
@@ -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
121
lib/jekyll/metadata.rb
Normal 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
|
||||
@@ -126,7 +126,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the path to the source file
|
||||
def path
|
||||
data.fetch('path', relative_path.sub(/\A\//, ''))
|
||||
data.fetch('path') { relative_path.sub(/\A\//, '') }
|
||||
end
|
||||
|
||||
# The path to the page source file, relative to the site source
|
||||
@@ -140,7 +140,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the destination file path String.
|
||||
def destination(dest)
|
||||
path = Jekyll.sanitized_path(dest, URL.unescape_path(url))
|
||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||
path = File.join(path, "index.html") if url =~ /\/$/
|
||||
path
|
||||
end
|
||||
|
||||
@@ -25,11 +25,27 @@ module Jekyll
|
||||
def require_gems
|
||||
site.gems.each do |gem|
|
||||
if plugin_allowed?(gem)
|
||||
Jekyll.logger.debug("PluginManager:", "Requiring #{gem}")
|
||||
require gem
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.require_from_bundler
|
||||
if !ENV["JEKYLL_NO_BUNDLER_REQUIRE"] && File.file?("Gemfile")
|
||||
require "bundler"
|
||||
Bundler.setup # puts all groups on the load path
|
||||
required_gems = Bundler.require(:jekyll_plugins) # requires the gems in this group only
|
||||
Jekyll.logger.debug("PluginManager:", "Required #{required_gems.map(&:name).join(', ')}")
|
||||
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = "true"
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
rescue LoadError, Bundler::GemfileNotFound
|
||||
false
|
||||
end
|
||||
|
||||
# Check whether a gem plugin is allowed to be used during this build.
|
||||
#
|
||||
# gem_name - the name of the gem
|
||||
@@ -66,7 +82,7 @@ module Jekyll
|
||||
# Returns an Array of plugin search paths
|
||||
def plugins_path
|
||||
if (site.config['plugins'] == Jekyll::Configuration::DEFAULTS['plugins'])
|
||||
[Jekyll.sanitized_path(site.source, site.config['plugins'])]
|
||||
[site.in_source_dir(site.config['plugins'])]
|
||||
else
|
||||
Array(site.config['plugins']).map { |d| File.expand_path(d) }
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ module Jekyll
|
||||
def initialize(site, source, dir, name)
|
||||
@site = site
|
||||
@dir = dir
|
||||
@base = containing_dir(source, dir)
|
||||
@base = containing_dir(dir)
|
||||
@name = name
|
||||
|
||||
self.categories = dir.downcase.split('/').reject { |x| x.empty? }
|
||||
@@ -88,8 +88,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
# Get the full path to the directory containing the post files
|
||||
def containing_dir(source, dir)
|
||||
return File.join(source, dir, '_posts')
|
||||
def containing_dir(dir)
|
||||
site.in_source_dir(dir, '_posts')
|
||||
end
|
||||
|
||||
# Read the YAML frontmatter.
|
||||
@@ -108,14 +108,14 @@ module Jekyll
|
||||
#
|
||||
# Returns excerpt string.
|
||||
def excerpt
|
||||
data.fetch('excerpt', extracted_excerpt.to_s)
|
||||
data.fetch('excerpt') { extracted_excerpt.to_s }
|
||||
end
|
||||
|
||||
# Public: the Post title, from the YAML Front-Matter or from the slug
|
||||
#
|
||||
# Returns the post title
|
||||
def title
|
||||
data.fetch("title", titleized_slug)
|
||||
data.fetch('title') { titleized_slug }
|
||||
end
|
||||
|
||||
# Turns the post slug into a suitable title
|
||||
@@ -130,7 +130,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the path to the file relative to the site source
|
||||
def path
|
||||
data.fetch('path', relative_path.sub(/\A\//, ''))
|
||||
data.fetch('path') { relative_path.sub(/\A\//, '') }
|
||||
end
|
||||
|
||||
# The path to the post source file, relative to the site source
|
||||
@@ -268,8 +268,8 @@ module Jekyll
|
||||
# Returns destination file path String.
|
||||
def destination(dest)
|
||||
# The url needs to be unescaped in order to preserve the correct filename
|
||||
path = Jekyll.sanitized_path(dest, URL.unescape_path(url))
|
||||
path = File.join(path, "index.html") if path[/\.html$/].nil?
|
||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||
path = File.join(path, "index.html") if path[/\.html?$/].nil?
|
||||
path
|
||||
end
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def most_recent_posts
|
||||
recent_posts = site.posts.reverse - [post]
|
||||
recent_posts.first(10)
|
||||
@most_recent_posts ||= (site.posts.reverse - [post]).first(10)
|
||||
end
|
||||
|
||||
def display(output)
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
module Jekyll
|
||||
class Renderer
|
||||
|
||||
attr_reader :document, :site
|
||||
attr_reader :document, :site, :site_payload
|
||||
|
||||
def initialize(site, document)
|
||||
@site = site
|
||||
@document = document
|
||||
def initialize(site, document, site_payload = nil)
|
||||
@site = site
|
||||
@document = document
|
||||
@site_payload = site_payload
|
||||
end
|
||||
|
||||
# Determine which converters to use based on this document's
|
||||
@@ -32,7 +33,7 @@ module Jekyll
|
||||
def run
|
||||
payload = Utils.deep_merge_hashes({
|
||||
"page" => document.to_liquid
|
||||
}, site.site_payload)
|
||||
}, site_payload || site.site_payload)
|
||||
|
||||
info = {
|
||||
filters: [Jekyll::Filters],
|
||||
@@ -73,7 +74,8 @@ module Jekyll
|
||||
begin
|
||||
converter.convert output
|
||||
rescue => e
|
||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{document.relative_path}'."
|
||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error while converting '#{document.relative_path}':"
|
||||
Jekyll.logger.error("", e.to_s)
|
||||
raise e
|
||||
end
|
||||
end
|
||||
@@ -137,6 +139,12 @@ module Jekyll
|
||||
File.join(site.config['layouts'], layout.name)
|
||||
)
|
||||
|
||||
# Add layout to dependency tree
|
||||
site.metadata.add_dependency(
|
||||
site.in_source_dir(document.path),
|
||||
site.in_source_dir(layout.path)
|
||||
) if document.write?
|
||||
|
||||
if layout = site.layouts[layout.data["layout"]]
|
||||
if used.include?(layout)
|
||||
layout = nil # avoid recursive chain
|
||||
|
||||
@@ -1,29 +1,35 @@
|
||||
# encoding: UTF-8
|
||||
require 'csv'
|
||||
|
||||
module Jekyll
|
||||
class Site
|
||||
attr_accessor :config, :layouts, :posts, :pages, :static_files,
|
||||
:exclude, :include, :source, :dest, :lsi, :highlighter,
|
||||
:permalink_style, :time, :future, :unpublished, :safe, :plugins, :limit_posts,
|
||||
:show_drafts, :keep_files, :baseurl, :data, :file_read_opts, :gems,
|
||||
:plugin_manager
|
||||
attr_reader :source, :dest, :config
|
||||
attr_accessor :layouts, :posts, :pages, :static_files,
|
||||
:exclude, :include, :lsi, :highlighter, :permalink_style,
|
||||
:time, :future, :unpublished, :safe, :plugins, :limit_posts,
|
||||
:show_drafts, :keep_files, :baseurl, :data, :file_read_opts,
|
||||
:gems, :plugin_manager
|
||||
|
||||
attr_accessor :converters, :generators
|
||||
attr_reader :metadata
|
||||
|
||||
# Public: Initialize a new Site.
|
||||
#
|
||||
# config - A Hash containing site configuration details.
|
||||
def initialize(config)
|
||||
self.config = config.clone
|
||||
@config = config.clone
|
||||
|
||||
%w[safe lsi highlighter baseurl exclude include future unpublished
|
||||
show_drafts limit_posts keep_files gems].each do |opt|
|
||||
self.send("#{opt}=", config[opt])
|
||||
end
|
||||
|
||||
self.source = File.expand_path(config['source'])
|
||||
self.dest = File.expand_path(config['destination'])
|
||||
self.permalink_style = config['permalink'].to_sym
|
||||
# Source and destination may not be changed after the site has been created.
|
||||
@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
|
||||
@@ -31,6 +37,10 @@ module Jekyll
|
||||
self.file_read_opts = {}
|
||||
self.file_read_opts[:encoding] = config['encoding'] if config['encoding']
|
||||
|
||||
self.permalink_style = config['permalink'].to_sym
|
||||
|
||||
Jekyll.sites << self
|
||||
|
||||
reset
|
||||
setup
|
||||
end
|
||||
@@ -87,6 +97,30 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Prefix a given path with the source directory.
|
||||
#
|
||||
# paths - (optional) path elements to a file or directory within the
|
||||
# source directory
|
||||
#
|
||||
# Returns a path which is prefixed with the source directory.
|
||||
def in_source_dir(*paths)
|
||||
paths.reduce(source) do |base, path|
|
||||
Jekyll.sanitized_path(base, path)
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Prefix a given path with the destination directory.
|
||||
#
|
||||
# paths - (optional) path elements to a file or directory within the
|
||||
# destination directory
|
||||
#
|
||||
# Returns a path which is prefixed with the destination directory.
|
||||
def in_dest_dir(*paths)
|
||||
paths.reduce(dest) do |base, path|
|
||||
Jekyll.sanitized_path(base, path)
|
||||
end
|
||||
end
|
||||
|
||||
# The list of collections and their corresponding Jekyll::Collection instances.
|
||||
# If config['collections'] is set, a new instance is created for each item in the collection.
|
||||
# If config['collections'] is not set, a new hash is returned.
|
||||
@@ -131,7 +165,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_directories(dir = '')
|
||||
base = File.join(source, dir)
|
||||
base = in_source_dir(dir)
|
||||
entries = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) }
|
||||
|
||||
read_posts(dir)
|
||||
@@ -140,7 +174,7 @@ module Jekyll
|
||||
limit_posts! if limit_posts > 0 # limit the posts if :limit_posts option is set
|
||||
|
||||
entries.each do |f|
|
||||
f_abs = File.join(base, f)
|
||||
f_abs = in_source_dir(base, f)
|
||||
if File.directory?(f_abs)
|
||||
f_rel = File.join(dir, f)
|
||||
read_directories(f_rel) unless dest.sub(/\/$/, '') == f_abs
|
||||
@@ -153,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
|
||||
@@ -197,7 +232,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def read_data(dir)
|
||||
base = Jekyll.sanitized_path(source, dir)
|
||||
base = in_source_dir(dir)
|
||||
read_data_to(base, self.data)
|
||||
end
|
||||
|
||||
@@ -212,18 +247,23 @@ module Jekyll
|
||||
return unless File.directory?(dir) && (!safe || !File.symlink?(dir))
|
||||
|
||||
entries = Dir.chdir(dir) do
|
||||
Dir['*.{yaml,yml,json}'] + Dir['*'].select { |fn| File.directory?(fn) }
|
||||
Dir['*.{yaml,yml,json,csv}'] + Dir['*'].select { |fn| File.directory?(fn) }
|
||||
end
|
||||
|
||||
entries.each do |entry|
|
||||
path = Jekyll.sanitized_path(dir, entry)
|
||||
path = in_source_dir(dir, entry)
|
||||
next if File.symlink?(path) && safe
|
||||
|
||||
key = sanitize_filename(File.basename(entry, '.*'))
|
||||
if File.directory?(path)
|
||||
read_data_to(path, data[key] = {})
|
||||
else
|
||||
data[key] = SafeYAML.load_file(path)
|
||||
case File.extname(path).downcase
|
||||
when '.csv'
|
||||
data[key] = CSV.read(path, :headers => true).map(&:to_hash)
|
||||
else
|
||||
data[key] = SafeYAML.load_file(path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -252,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
|
||||
@@ -277,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.
|
||||
@@ -342,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'),
|
||||
@@ -370,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
|
||||
@@ -401,10 +440,10 @@ module Jekyll
|
||||
#
|
||||
# Returns the list of entries to process
|
||||
def get_entries(dir, subfolder)
|
||||
base = File.join(source, dir, subfolder)
|
||||
base = in_source_dir(dir, subfolder)
|
||||
return [] unless File.exist?(base)
|
||||
entries = Dir.chdir(base) { filter_entries(Dir['**/*'], base) }
|
||||
entries.delete_if { |e| File.directory?(File.join(base, e)) }
|
||||
entries.delete_if { |e| File.directory?(in_source_dir(base, e)) }
|
||||
end
|
||||
|
||||
# Aggregate post information
|
||||
@@ -418,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/"+
|
||||
@@ -448,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?
|
||||
@@ -468,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
|
||||
|
||||
@@ -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
|
||||
@@ -37,7 +35,7 @@ module Jekyll
|
||||
#
|
||||
# Returns destination file path.
|
||||
def destination(dest)
|
||||
File.join(*[dest, destination_rel_dir, @name].compact)
|
||||
@site.in_dest_dir(*[dest, destination_rel_dir, @name].compact)
|
||||
end
|
||||
|
||||
def destination_rel_dir
|
||||
@@ -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.
|
||||
|
||||
@@ -46,14 +46,15 @@ eos
|
||||
|
||||
is_safe = !!context.registers[:site].safe
|
||||
|
||||
output = case context.registers[:site].highlighter
|
||||
when 'pygments'
|
||||
render_pygments(code, is_safe)
|
||||
when 'rouge'
|
||||
render_rouge(code)
|
||||
else
|
||||
render_codehighlighter(code)
|
||||
end
|
||||
output =
|
||||
case context.registers[:site].highlighter
|
||||
when 'pygments'
|
||||
render_pygments(code, is_safe)
|
||||
when 'rouge'
|
||||
render_rouge(code)
|
||||
else
|
||||
render_codehighlighter(code)
|
||||
end
|
||||
|
||||
rendered_output = add_code_tag(output)
|
||||
prefix + rendered_output + suffix
|
||||
|
||||
@@ -13,15 +13,20 @@ module Jekyll
|
||||
|
||||
class IncludeTag < Liquid::Tag
|
||||
|
||||
SYNTAX_EXAMPLE = "{% include file.ext param='value' param2='value' %}"
|
||||
attr_reader :includes_dir
|
||||
|
||||
VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/
|
||||
VARIABLE_SYNTAX = /(?<variable>[^{]*\{\{\s*(?<name>[\w\-\.]+)\s*(\|.*)?\}\}[^\s}]*)(?<params>.*)/
|
||||
|
||||
INCLUDES_DIR = '_includes'
|
||||
class << self
|
||||
def source_cache
|
||||
@@source_cache ||= {}
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(tag_name, markup, tokens)
|
||||
super
|
||||
@includes_dir = tag_includes_dir
|
||||
matched = markup.strip.match(VARIABLE_SYNTAX)
|
||||
if matched
|
||||
@file = matched['variable'].strip
|
||||
@@ -30,6 +35,11 @@ module Jekyll
|
||||
@file, @params = markup.strip.split(' ', 2);
|
||||
end
|
||||
validate_params if @params
|
||||
@tag_name = tag_name
|
||||
end
|
||||
|
||||
def syntax_example
|
||||
"{% #{@tag_name} file.ext param='value' param2='value' %}"
|
||||
end
|
||||
|
||||
def parse_params(context)
|
||||
@@ -61,7 +71,7 @@ Invalid syntax for include tag. File contains invalid characters or sequences:
|
||||
|
||||
Valid syntax:
|
||||
|
||||
#{SYNTAX_EXAMPLE}
|
||||
#{syntax_example}
|
||||
|
||||
eos
|
||||
end
|
||||
@@ -77,7 +87,7 @@ Invalid syntax for include tag:
|
||||
|
||||
Valid syntax:
|
||||
|
||||
#{SYNTAX_EXAMPLE}
|
||||
#{syntax_example}
|
||||
|
||||
eos
|
||||
end
|
||||
@@ -96,14 +106,27 @@ eos
|
||||
end
|
||||
end
|
||||
|
||||
def tag_includes_dir
|
||||
'_includes'
|
||||
end
|
||||
|
||||
def render(context)
|
||||
dir = File.join(File.realpath(context.registers[:site].source), INCLUDES_DIR)
|
||||
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))
|
||||
@@ -113,10 +136,14 @@ eos
|
||||
partial.render!(context)
|
||||
end
|
||||
rescue => e
|
||||
raise IncludeTagError.new e.message, File.join(INCLUDES_DIR, @file)
|
||||
raise IncludeTagError.new e.message, File.join(@includes_dir, @file)
|
||||
end
|
||||
end
|
||||
|
||||
def resolved_includes_dir(context)
|
||||
File.join(File.realpath(context.registers[:site].source), @includes_dir)
|
||||
end
|
||||
|
||||
def validate_path(path, dir, safe)
|
||||
if safe && !realpath_prefixed_with?(path, dir)
|
||||
raise IOError.new "The included file '#{path}' should exist and should not be a symlink"
|
||||
@@ -126,7 +153,7 @@ eos
|
||||
end
|
||||
|
||||
def path_relative_to_source(dir, path)
|
||||
File.join(INCLUDES_DIR, path.sub(Regexp.new("^#{dir}"), ""))
|
||||
File.join(@includes_dir, path.sub(Regexp.new("^#{dir}"), ""))
|
||||
end
|
||||
|
||||
def realpath_prefixed_with?(path, dir)
|
||||
@@ -135,10 +162,25 @@ 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
|
||||
|
||||
class IncludeRelativeTag < IncludeTag
|
||||
def tag_includes_dir
|
||||
'.'
|
||||
end
|
||||
|
||||
def page_path(context)
|
||||
context.registers[:page].nil? ? includes_dir : File.dirname(context.registers[:page]["path"])
|
||||
end
|
||||
|
||||
def resolved_includes_dir(context)
|
||||
context.registers[:site].in_source_dir(page_path(context))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('include', Jekyll::Tags::IncludeTag)
|
||||
Liquid::Template.register_tag('include_relative', Jekyll::Tags::IncludeRelativeTag)
|
||||
|
||||
@@ -3,16 +3,22 @@ module Jekyll
|
||||
class PostComparer
|
||||
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)$/
|
||||
|
||||
attr_accessor :date, :slug
|
||||
attr_reader :path, :date, :slug, :name
|
||||
|
||||
def initialize(name)
|
||||
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
|
||||
@name = name
|
||||
all, @path, @date, @slug = *name.sub(/^\//, "").match(MATCHER)
|
||||
raise ArgumentError.new("'#{name}' does not contain valid date and/or title.") unless all
|
||||
@slug = path ? path + slug : slug
|
||||
@date = Utils.parse_date(date, "'#{name}' does not contain valid date.")
|
||||
|
||||
@name_regex = /^#{path}#{date}-#{slug}\.[^.]+/
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
other.name.match(@name_regex)
|
||||
end
|
||||
|
||||
def deprecated_equality(other)
|
||||
date = Utils.parse_date(name, "'#{name}' does not contain valid date and/or title.")
|
||||
slug == post_slug(other) &&
|
||||
date.year == other.date.year &&
|
||||
date.month == other.date.month &&
|
||||
@@ -59,6 +65,19 @@ eos
|
||||
end
|
||||
end
|
||||
|
||||
# New matching method did not match, fall back to old method
|
||||
# with deprecation warning if this matches
|
||||
|
||||
site.posts.each do |p|
|
||||
if @post.deprecated_equality p
|
||||
Jekyll::Deprecator.deprecation_message "A call to '{{ post_url #{name} }}' did not match " +
|
||||
"a post using the new matching method of checking name " +
|
||||
"(path-date-slug) equality. Please make sure that you " +
|
||||
"change this tag to match the post's name exactly."
|
||||
return p.url
|
||||
end
|
||||
end
|
||||
|
||||
raise ArgumentError.new <<-eos
|
||||
Could not find post "#{@orig_post}" in tag 'post_url'.
|
||||
|
||||
|
||||
@@ -37,33 +37,46 @@ module Jekyll
|
||||
#
|
||||
# Returns the String URL
|
||||
def to_s
|
||||
sanitize_url(@permalink || generate_url)
|
||||
sanitize_url(generated_permalink || generated_url)
|
||||
end
|
||||
|
||||
# Generates a URL from the permalink
|
||||
#
|
||||
# Returns the _unsanitized String URL
|
||||
def generated_permalink
|
||||
(@generated_permlink ||= generate_url(@permalink)) if @permalink
|
||||
end
|
||||
|
||||
# Generates a URL from the template
|
||||
#
|
||||
# Returns the _unsanitized String URL
|
||||
def generated_url
|
||||
@generated_url ||= generate_url(@template)
|
||||
end
|
||||
|
||||
# Internal: Generate the URL by replacing all placeholders with their
|
||||
# respective values
|
||||
# respective values in the given template
|
||||
#
|
||||
# Returns the _unsanitizied_ String URL
|
||||
def generate_url
|
||||
@placeholders.inject(@template) do |result, token|
|
||||
def generate_url(template)
|
||||
@placeholders.inject(template) do |result, token|
|
||||
break result if result.index(':').nil?
|
||||
result.gsub(/:#{token.first}/, self.class.escape_path(token.last))
|
||||
end
|
||||
end
|
||||
|
||||
# Returns a sanitized String URL
|
||||
def sanitize_url(in_url)
|
||||
|
||||
# Remove all double slashes
|
||||
url = in_url.gsub(/\/\//, "/")
|
||||
|
||||
# Remove every URL segment that consists solely of dots
|
||||
url = url.split('/').reject{ |part| part =~ /^\.+$/ }.join('/')
|
||||
url = in_url \
|
||||
# Remove all double slashes
|
||||
.gsub(/\/\//, '/') \
|
||||
# Remove every URL segment that consists solely of dots
|
||||
.split('/').reject{ |part| part =~ /^\.+$/ }.join('/') \
|
||||
# Always add a leading slash
|
||||
.gsub(/\A([^\/])/, '/\1')
|
||||
|
||||
# Append a trailing slash to the URL if the unsanitized URL had one
|
||||
url += "/" if in_url =~ /\/$/
|
||||
|
||||
# Always add a leading slash
|
||||
url.gsub!(/\A([^\/])/, '/\1')
|
||||
url << "/" if in_url[-1].eql?('/')
|
||||
|
||||
url
|
||||
end
|
||||
@@ -79,7 +92,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the escaped path.
|
||||
def self.escape_path(path)
|
||||
# Because URI.escape doesn't escape '?', '[' and ']' by defaut,
|
||||
# Because URI.escape doesn't escape '?', '[' and ']' by default,
|
||||
# specify unsafe string (except unreserved, sub-delims, ":", "@" and "/").
|
||||
#
|
||||
# URI path segment is defined in RFC 3986 as follows:
|
||||
|
||||
@@ -14,7 +14,7 @@ module Jekyll
|
||||
def deep_merge_hashes(master_hash, other_hash)
|
||||
target = master_hash.dup
|
||||
|
||||
other_hash.keys.each do |key|
|
||||
other_hash.each_key do |key|
|
||||
if other_hash[key].is_a? Hash and target[key].is_a? Hash
|
||||
target[key] = Utils.deep_merge_hashes(target[key], other_hash[key])
|
||||
next
|
||||
@@ -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
|
||||
@@ -102,5 +102,24 @@ module Jekyll
|
||||
!!(File.open(file, 'rb') { |f| f.read(5) } =~ /\A---\r?\n/)
|
||||
end
|
||||
|
||||
# Slugify a filename or title.
|
||||
#
|
||||
# name - the filename or title to slugify
|
||||
#
|
||||
# Returns the given filename or title in lowercase, with every
|
||||
# sequence of spaces and non-alphanumeric characters replaced with a
|
||||
# hyphen.
|
||||
def slugify(string)
|
||||
unless string.nil?
|
||||
string \
|
||||
# Replace each non-alphanumeric character sequence with a hyphen
|
||||
.gsub(/[^[:alnum:]]+/i, '-') \
|
||||
# Remove leading/trailing hyphen
|
||||
.gsub(/^\-|\-$/i, '') \
|
||||
# Downcase it
|
||||
.downcase
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Jekyll
|
||||
VERSION = '2.3.0'
|
||||
VERSION = '2.5.3'
|
||||
end
|
||||
|
||||
3
lib/site_template/.gitignore
vendored
3
lib/site_template/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
_site
|
||||
_site
|
||||
.sass-cache
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<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="{{ site.description }}">
|
||||
<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="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/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
|
||||
</head>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -4,7 +4,7 @@ title: "Welcome to Jekyll!"
|
||||
date: <%= Time.now.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
categories: jekyll update
|
||||
---
|
||||
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve --watch`, which launches a web server and auto-regenerates your site when a file is updated.
|
||||
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
||||
|
||||
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
|
||||
|
||||
|
||||
@@ -20,12 +20,13 @@ body {
|
||||
font-weight: 300;
|
||||
color: $text-color;
|
||||
background-color: $background-color;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set `margin-bottom` to maintain vertycal rhythm
|
||||
* Set `margin-bottom` to maintain vertical rhythm
|
||||
*/
|
||||
h1, h2, h3, h4, h5, h6,
|
||||
p, blockquote, pre,
|
||||
@@ -153,8 +154,8 @@ pre {
|
||||
* Wrapper
|
||||
*/
|
||||
.wrapper {
|
||||
max-width: -webkit-calc(800px - (#{$spacing-unit} * 2));
|
||||
max-width: calc(800px - (#{$spacing-unit} * 2));
|
||||
max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
|
||||
max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding-right: $spacing-unit;
|
||||
@@ -162,8 +163,8 @@ pre {
|
||||
@extend %clearfix;
|
||||
|
||||
@include media-query($on-laptop) {
|
||||
max-width: -webkit-calc(800px - (#{$spacing-unit}));
|
||||
max-width: calc(800px - (#{$spacing-unit}));
|
||||
max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
|
||||
max-width: calc(#{$content-width} - (#{$spacing-unit}));
|
||||
padding-right: $spacing-unit / 2;
|
||||
padding-left: $spacing-unit / 2;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,49 +1,52 @@
|
||||
---
|
||||
# Only the main Sass file needs front matter (the dashes are enough)
|
||||
---
|
||||
@charset "utf-8";
|
||||
|
||||
|
||||
|
||||
// Our variables
|
||||
$base-font-family: Helvetica, Arial, sans-serif;
|
||||
$base-font-size: 16px;
|
||||
$small-font-size: $base-font-size * 0.875;
|
||||
$base-line-height: 1.5;
|
||||
|
||||
$spacing-unit: 30px;
|
||||
|
||||
$text-color: #111;
|
||||
$background-color: #fdfdfd;
|
||||
$brand-color: #2a7ae2;
|
||||
|
||||
$grey-color: #828282;
|
||||
$grey-color-light: lighten($grey-color, 40%);
|
||||
$grey-color-dark: darken($grey-color, 25%);
|
||||
|
||||
$on-palm: 600px;
|
||||
$on-laptop: 800px;
|
||||
|
||||
|
||||
|
||||
// Using media queries with like this:
|
||||
// @include media-query($palm) {
|
||||
// .wrapper {
|
||||
// padding-right: $spacing-unit / 2;
|
||||
// padding-left: $spacing-unit / 2;
|
||||
// }
|
||||
// }
|
||||
@mixin media-query($device) {
|
||||
@media screen and (max-width: $device) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Import partials from `sass_dir` (defaults to `_sass`)
|
||||
@import
|
||||
"base",
|
||||
"layout",
|
||||
"syntax-highlighting"
|
||||
;
|
||||
---
|
||||
# Only the main Sass file needs front matter (the dashes are enough)
|
||||
---
|
||||
@charset "utf-8";
|
||||
|
||||
|
||||
|
||||
// Our variables
|
||||
$base-font-family: Helvetica, Arial, sans-serif;
|
||||
$base-font-size: 16px;
|
||||
$small-font-size: $base-font-size * 0.875;
|
||||
$base-line-height: 1.5;
|
||||
|
||||
$spacing-unit: 30px;
|
||||
|
||||
$text-color: #111;
|
||||
$background-color: #fdfdfd;
|
||||
$brand-color: #2a7ae2;
|
||||
|
||||
$grey-color: #828282;
|
||||
$grey-color-light: lighten($grey-color, 40%);
|
||||
$grey-color-dark: darken($grey-color, 25%);
|
||||
|
||||
// Width of the content area
|
||||
$content-width: 800px;
|
||||
|
||||
$on-palm: 600px;
|
||||
$on-laptop: 800px;
|
||||
|
||||
|
||||
|
||||
// Using media queries with like this:
|
||||
// @include media-query($on-palm) {
|
||||
// .wrapper {
|
||||
// padding-right: $spacing-unit / 2;
|
||||
// padding-left: $spacing-unit / 2;
|
||||
// }
|
||||
// }
|
||||
@mixin media-query($device) {
|
||||
@media screen and (max-width: $device) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Import partials from `sass_dir` (defaults to `_sass`)
|
||||
@import
|
||||
"base",
|
||||
"layout",
|
||||
"syntax-highlighting"
|
||||
;
|
||||
|
||||
@@ -7,7 +7,7 @@ layout: null
|
||||
<title>{{ site.title | xml_escape }}</title>
|
||||
<description>{{ site.description | xml_escape }}</description>
|
||||
<link>{{ site.url }}{{ site.baseurl }}/</link>
|
||||
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml" />
|
||||
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml"/>
|
||||
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
|
||||
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
|
||||
<generator>Jekyll v{{ jekyll.version }}</generator>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
script/branding
|
||||
bundle install
|
||||
bundle install -j8
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
#! /bin/bash
|
||||
|
||||
script/branding
|
||||
|
||||
set -e
|
||||
|
||||
parallelize_tests() {
|
||||
ls -1 script/{test,cucumber,proof} | xargs -P 3 -L 1 /bin/bash
|
||||
}
|
||||
|
||||
serialize_tests() {
|
||||
script/proof
|
||||
if test -z "$TEST_SUITE"; then
|
||||
script/test
|
||||
script/cucumber
|
||||
}
|
||||
|
||||
script/branding
|
||||
time parallelize_tests
|
||||
else
|
||||
script/$TEST_SUITE
|
||||
fi
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
git diff --name-only ..master | grep '^site/' || {
|
||||
echo "No site files changed. We'll skip proofing."
|
||||
if [[ "$1" != "-f" ]]; then
|
||||
git diff --name-only ..master | grep '^site/' || {
|
||||
echo "No site files changed. We'll skip proofing. Run with -f to force."
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Some site files have been changed! Proofing..."
|
||||
|
||||
|
||||
16
script/stackprof
Executable file
16
script/stackprof
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
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%H%M).dump
|
||||
|
||||
test -f "$PROF_OUTPUT_FILE" || {
|
||||
bundle exec ruby -r./lib/jekyll -rstackprof \
|
||||
-e "StackProf.run(mode: :cpu, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }"
|
||||
}
|
||||
|
||||
bundle exec stackprof $PROF_OUTPUT_FILE $@
|
||||
10
script/test
10
script/test
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Jekyll's awesome website.
|
||||
15
site/README.md
Normal file
15
site/README.md
Normal 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:
|
||||
@@ -2,7 +2,7 @@ markdown: kramdown
|
||||
highlighter: pygments
|
||||
relative_permalinks: false
|
||||
permalink: /news/:year/:month/:day/:title/
|
||||
excerpt_separator: noifniof3nioaniof3nioafafinoafnoif
|
||||
excerpt_separator: ""
|
||||
|
||||
gauges_id: 503c5af6613f5d0f19000027
|
||||
google_analytics_id: UA-50755011-1
|
||||
|
||||
@@ -25,6 +25,15 @@ have a file named `css/styles.scss` in your site's source folder, Jekyll
|
||||
will process it and put it in your site's destination folder under
|
||||
`css/styles.css`.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Jekyll processes all Liquid filters and tags in asset files</h5>
|
||||
<p>If you are using <a href="http://mustache.github.io">Mustache</a>
|
||||
or another JavaScript templating language that conflicts with
|
||||
the <a href="/docs/templates/">Liquid template syntax</a>, you
|
||||
will need to place <code>{% raw %}</code> and
|
||||
<code>{% endraw %}</code> tags around your code.</p>
|
||||
</div>
|
||||
|
||||
## Sass/SCSS
|
||||
|
||||
Jekyll allows you to customize your Sass conversion in certain ways.
|
||||
@@ -52,7 +61,7 @@ The Sass converter will default the `sass_dir` configuration option to
|
||||
<h5>The <code>sass_dir</code> is only used by Sass</h5>
|
||||
<p>
|
||||
|
||||
Note that the `sass_dir` becomes the load path for Sass imports,
|
||||
Note that the <code>sass_dir</code> becomes the load path for Sass imports,
|
||||
nothing more. This means that Jekyll does not know about these files
|
||||
directly, so any files here should not contain the YAML Front Matter as
|
||||
described above nor will they be transformed as described above. This
|
||||
|
||||
@@ -39,7 +39,7 @@ collections:
|
||||
Create a corresponding folder (e.g. `<source>/_my_collection`) and add documents.
|
||||
YAML Front Matter is read in as data if it exists, if not, then everything is just stuck in the Document's `content` attribute.
|
||||
|
||||
Note: the folder must be named identical to the collection you defined in you config.yml file, with the addition of the preceding `_` character.
|
||||
Note: the folder must be named identically to the collection you defined in your `_config.yml` file, with the addition of the preceding `_` character.
|
||||
|
||||
### Step 3: Optionally render your collection's documents into independent files
|
||||
|
||||
@@ -81,7 +81,7 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`, it will be wr
|
||||
<p><code>collection</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Label of the containing collection</p>
|
||||
<p>Label of the containing collection.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -89,7 +89,23 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`, it will be wr
|
||||
<p><code>path</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Path to the document relative to the collection's directory</p>
|
||||
<p>Path to the document relative to the collection's directory.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>name</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's base filename, with every sequence of spaces and non-alphanumeric characters replaced by a hyphen.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>title</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's lowercase title (as defined in its <a href="/docs/frontmatter/">front matter</a>), with every sequence of spaces and non-alphanumeric characters replaced by a hyphen. If the document does not define a title in its <a href="/docs/frontmatter/">front matter</a>, this is equivalent to <code>name</code>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -97,7 +113,7 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`, it will be wr
|
||||
<p><code>output_ext</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Extension of the output file</p>
|
||||
<p>Extension of the output file.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -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><destination></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><destination></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">
|
||||
@@ -205,6 +230,34 @@ class="flag">flags</code> (specified on the command-line) that control them.
|
||||
<p><code class="flag">--limit_posts NUM</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Force polling</strong></p>
|
||||
<p class="description">Force watch to use polling.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--force_polling</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Verbose output</strong></p>
|
||||
<p class="description">Print verbose output.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<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>
|
||||
@@ -264,6 +317,15 @@ before your site is served.
|
||||
<p><code class="flag">-B, --detach</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Skips the initial site build.</strong></p>
|
||||
<p class="description">Skips the initial site build which occurs before the server is started.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--skip-initial-build</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -304,7 +366,7 @@ defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
type: "posts"
|
||||
type: "posts" # previously `post` in Jekyll 2.2.
|
||||
values:
|
||||
layout: "default"
|
||||
{% endhighlight %}
|
||||
@@ -435,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
|
||||
@@ -465,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
|
||||
|
||||
@@ -22,7 +22,7 @@ Enabling Travis builds for your GitHub repository is pretty simple:
|
||||
2. Find the repository for which you're interested in enabling builds.
|
||||
3. Click the slider on the right so it says "ON" and is a dark grey.
|
||||
4. Optionally configure the build by clicking on the wrench icon. Further
|
||||
configuration happens in you `.travis.yml` file. More details on that
|
||||
configuration happens in your `.travis.yml` file. More details on that
|
||||
below.
|
||||
|
||||
## 2. The Test Script
|
||||
@@ -153,7 +153,7 @@ env:
|
||||
Using `html-proofer`? You'll want this environment variable. Nokogiri, used
|
||||
to parse HTML files in your compiled site, comes bundled with libraries
|
||||
which it must compile each time it is installed. Luckily, you can
|
||||
dramatically increase the install time of Nokogiri by setting the
|
||||
dramatically decrease the install time of Nokogiri by setting the
|
||||
environment variable `NOKOGIRI_USE_SYSTEM_LIBRARIES` to `true`.
|
||||
|
||||
## 4. Gotchas
|
||||
|
||||
@@ -10,8 +10,9 @@ In addition to the [built-in variables](../variables/) available from Jekyll,
|
||||
you can specify your own custom data that can be accessed via the [Liquid
|
||||
templating system](https://wiki.github.com/shopify/liquid/liquid-for-designers).
|
||||
|
||||
Jekyll supports loading data from [YAML](http://yaml.org/) and [JSON](http://www.json.org/) files located in the
|
||||
`_data` directory.
|
||||
Jekyll supports loading data from [YAML](http://yaml.org/), [JSON](http://www.json.org/),
|
||||
and [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) files located in the `_data` directory.
|
||||
Note that CSV files *must* contain a header row.
|
||||
|
||||
This powerful feature allows you to avoid repetition in your templates and to
|
||||
set site specific options without changing `_config.yml`.
|
||||
@@ -22,8 +23,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
|
||||
|
||||
As explained on the [directory structure](../structure/) page, the `_data`
|
||||
folder is where you can store additional data for Jekyll to use when generating
|
||||
your site. These files must be YAML files (using either the `.yml`, `.yaml` or `.json`
|
||||
extension) and they will be accessible via `site.data`.
|
||||
your site. These files must be YAML files (using either the `.yml`, `.yaml`, `.json`
|
||||
or `csv` extension) and they will be accessible via `site.data`.
|
||||
|
||||
## Example: List of members
|
||||
|
||||
@@ -43,6 +44,15 @@ In `_data/members.yml`:
|
||||
github: liufengyun
|
||||
{% endhighlight %}
|
||||
|
||||
Or `_data/members.csv`:
|
||||
|
||||
{% highlight text %}
|
||||
name,github
|
||||
Tom Preston-Werner,mojombo
|
||||
Parker Moore,parkr
|
||||
Liu Fengyun,liufengyun
|
||||
{% endhighlight %}
|
||||
|
||||
This data can be accessed via `site.data.members` (notice that the filename
|
||||
determines the variable name).
|
||||
|
||||
@@ -64,7 +74,7 @@ You can now render the list of members in a template:
|
||||
|
||||
## Example: Organizations
|
||||
|
||||
Data files can also be placed in sub-folders of the `_data` folder. Each folder level will be added to a variable's namespace. The example bellow shows how GitHub organizations could be defined separately in a file under the `orgs` folder:
|
||||
Data files can also be placed in sub-folders of the `_data` folder. Each folder level will be added to a variable's namespace. The example below shows how GitHub organizations could be defined separately in a file under the `orgs` folder:
|
||||
|
||||
In `_data/orgs/jekyll.yml`:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
layout: docs
|
||||
title: Deployment methods
|
||||
prev_section: github-pages
|
||||
next_section: troubleshooting
|
||||
next_section: continuous-integration
|
||||
permalink: /docs/deployment-methods/
|
||||
---
|
||||
|
||||
|
||||
@@ -19,6 +19,33 @@ There are two basic types available: user/organization pages and project pages.
|
||||
The way to deploy these two types of sites are nearly identical, except for a
|
||||
few minor details.
|
||||
|
||||
<div class="note protip">
|
||||
<h5>Use the <code>github-pages</code> gem</h5>
|
||||
<p>
|
||||
Our friends at GitHub have provided the
|
||||
<a href="https://github.com/github/pages-gem">github-pages</a>
|
||||
gem which is used to manage Jekyll and its dependencies on
|
||||
GitHub Pages. Using it in your projects means that when you deploy
|
||||
your site to GitHub Pages, you will not be caught by unexpected
|
||||
differences between various versions of the gems. To use the
|
||||
currently-deployed version of the gem in your project, add the
|
||||
following to your <code>Gemfile</code>:
|
||||
|
||||
{% highlight ruby %}
|
||||
source 'https://rubygems.org'
|
||||
|
||||
require 'json'
|
||||
require 'open-uri'
|
||||
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
|
||||
|
||||
gem 'github-pages', versions['github-pages']
|
||||
{% endhighlight %}
|
||||
|
||||
This will ensure that when you run <code>bundle install</code>, you
|
||||
have the correct version of the <code>github-pages</code> gem.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### User and Organization Pages
|
||||
|
||||
User and organization pages live in a special GitHub repository dedicated to
|
||||
|
||||
@@ -5,6 +5,213 @@ permalink: "/docs/history/"
|
||||
prev_section: contributing
|
||||
---
|
||||
|
||||
## 2.5.3 / 2014-12-22
|
||||
{: #v2-5-3}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v2-5-3}
|
||||
|
||||
- When checking a Markdown extname, include position of the `.` ([#3147]({{ site.repository }}/issues/3147))
|
||||
- Fix `jsonify` Liquid filter handling of boolean values ([#3154]({{ site.repository }}/issues/3154))
|
||||
- Add comma to value of `viewport` meta tag ([#3170]({{ site.repository }}/issues/3170))
|
||||
- Set the link type for the RSS feed to `application/rss+xml` ([#3176]({{ site.repository }}/issues/3176))
|
||||
- Refactor `#as_liquid` ([#3158]({{ site.repository }}/issues/3158))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v2-5-3}
|
||||
|
||||
- Exclude built-in bundles from being added to coverage report ([#3180]({{ site.repository }}/issues/3180))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v2-5-3}
|
||||
|
||||
- Add `[@alfredxing](https://github.com/alfredxing)` to the `[@jekyll](https://github.com/jekyll)/core` team. :tada: ([#3218]({{ site.repository }}/issues/3218))
|
||||
- Document the `-q` option for the `build` and `serve` commands ([#3149]({{ site.repository }}/issues/3149))
|
||||
- Fix some minor typos/flow fixes in documentation website content ([#3165]({{ site.repository }}/issues/3165))
|
||||
- Add `keep_files` to configuration documentation ([#3162]({{ site.repository }}/issues/3162))
|
||||
- Repeat warning about cleaning of the `destination` directory ([#3161]({{ site.repository }}/issues/3161))
|
||||
- Add jekyll-500px-embed to list of third-party plugins ([#3163]({{ site.repository }}/issues/3163))
|
||||
- Simplified platform detection in Gemfile example for Windows ([#3177]({{ site.repository }}/issues/3177))
|
||||
- Add the `jekyll-jalali` plugin added to the list of third-party plugins. ([#3198]({{ site.repository }}/issues/3198))
|
||||
- Add Table of Contents to Troubleshooting page ([#3196]({{ site.repository }}/issues/3196))
|
||||
- Add `inline_highlight` plugin to list of third-party plugins ([#3212]({{ site.repository }}/issues/3212))
|
||||
- Add `jekyll-mermaid` plugin to list of third-party plugins ([#3222]({{ site.repository }}/issues/3222))
|
||||
|
||||
|
||||
## 2.5.2 / 2014-11-17
|
||||
{: #v2-5-2}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v2-5-2}
|
||||
|
||||
- `post_url` should match `post.name` instead of slugs and dates ([#3058]({{ site.repository }}/issues/3058))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v2-5-2}
|
||||
|
||||
- Fix bundle require for `:jekyll_plugins` ([#3119]({{ site.repository }}/issues/3119))
|
||||
- Remove duplicate regexp phrase: `^\A` ([#3089]({{ site.repository }}/issues/3089))
|
||||
- Remove duplicate `Conversion error:` message in `Convertible` ([#3088]({{ site.repository }}/issues/3088))
|
||||
- Print full conversion error message in `Renderer#convert` ([#3090]({{ site.repository }}/issues/3090))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v2-5-2}
|
||||
|
||||
- Change variable names in Google Analytics script ([#3093]({{ site.repository }}/issues/3093))
|
||||
- Mention CSV files in the docs for data files ([#3101]({{ site.repository }}/issues/3101))
|
||||
- Add trailing slash to `paginate_path` example. ([#3091]({{ site.repository }}/issues/3091))
|
||||
- Get rid of noifniof (`excerpt_separator`) ([#3094]({{ site.repository }}/issues/3094))
|
||||
- Sass improvements, around nesting mostly. ([#3123]({{ site.repository }}/issues/3123))
|
||||
- Add webmentions.io plugin to the list of third-party plugins ([#3127]({{ site.repository }}/issues/3127))
|
||||
- Add Sass mixins and use them. ([#2904]({{ site.repository }}/issues/2904))
|
||||
- Slightly compress jekyll-sticker.jpg. ([#3133]({{ site.repository }}/issues/3133))
|
||||
- Update gridism and separate out related but custom styles. ([#3132]({{ site.repository }}/issues/3132))
|
||||
- Add remote-include plugin to list of third-party plugins ([#3136]({{ site.repository }}/issues/3136))
|
||||
|
||||
|
||||
## 2.5.1 / 2014-11-09
|
||||
{: #v2-5-1}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v2-5-1}
|
||||
|
||||
- Fix path sanitation bug related to Windows drive names ([#3077]({{ site.repository }}/issues/3077))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v2-5-1}
|
||||
|
||||
- Add development time dependencies on minitest and test-unit to gemspec for cygwin ([#3064]({{ site.repository }}/issues/3064))
|
||||
- Use Travis's built-in caching. ([#3075]({{ site.repository }}/issues/3075))
|
||||
|
||||
|
||||
## 2.5.0 / 2014-11-06
|
||||
{: #v2-5-0}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v2-5-0}
|
||||
|
||||
- Require gems in `:jekyll_plugins` Gemfile group unless `JEKYLL_NO_BUNDLER_REQUIRE` is specified in the environment. ([#2865]({{ site.repository }}/issues/2865))
|
||||
- Centralize path sanitation in the `Site` object ([#2882]({{ site.repository }}/issues/2882))
|
||||
- Allow placeholders in permalinks ([#3031]({{ site.repository }}/issues/3031))
|
||||
- Allow users to specify the log level via `JEKYLL_LOG_LEVEL`. ([#3067]({{ site.repository }}/issues/3067))
|
||||
- Fancy Indexing with WEBrick ([#3018]({{ site.repository }}/issues/3018))
|
||||
- Allow Enumerables to be used with `where` filter. ([#2986]({{ site.repository }}/issues/2986))
|
||||
- Meta descriptions in the site template now use `page.excerpt` if it's available ([#2964]({{ site.repository }}/issues/2964))
|
||||
- Change indentation in `head.html` of site template to 2 spaces from 4 ([#2973]({{ site.repository }}/issues/2973))
|
||||
- Use a `$content-width` variable instead of a fixed value in the site template CSS ([#2972]({{ site.repository }}/issues/2972))
|
||||
- Strip newlines in site template `<meta>` description. ([#2982]({{ site.repository }}/issues/2982))
|
||||
- Add link to atom feed in `head` of site template files ([#2996]({{ site.repository }}/issues/2996))
|
||||
- Performance optimizations ([#2994]({{ site.repository }}/issues/2994))
|
||||
- Use `Hash#each_key` instead of `Hash#keys.each` to speed up iteration
|
||||
over hash keys. ([#3017]({{ site.repository }}/issues/3017))
|
||||
- Further minor performance enhancements. ([#3022]({{ site.repository }}/issues/3022))
|
||||
- Add 'b' and 's' aliases for build and serve, respectively ([#3065]({{ site.repository }}/issues/3065))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v2-5-0}
|
||||
|
||||
- Fix Rouge's RedCarpet plugin interface integration ([#2951]({{ site.repository }}/issues/2951))
|
||||
- Remove `--watch` from the site template blog post since it defaults
|
||||
to watching in in 2.4.0 ([#2922]({{ site.repository }}/issues/2922))
|
||||
- Fix code for media query mixin in site template ([#2946]({{ site.repository }}/issues/2946))
|
||||
- Allow post URL's to have `.htm` extensions ([#2925]({{ site.repository }}/issues/2925))
|
||||
- `Utils.slugify`: Don't create new objects when gsubbing ([#2997]({{ site.repository }}/issues/2997))
|
||||
- The jsonify filter should deep-convert to Liquid when given an Array. ([#3032]({{ site.repository }}/issues/3032))
|
||||
- Apply `jsonify` filter to Hashes deeply and effectively ([#3063]({{ site.repository }}/issues/3063))
|
||||
- Use `127.0.0.1` as default host instead of `0.0.0.0` ([#3053]({{ site.repository }}/issues/3053))
|
||||
- In the case that a Gemfile does not exist, ensure Jekyll doesn't fail on requiring the Gemfile group ([#3066]({{ site.repository }}/issues/3066))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v2-5-0}
|
||||
|
||||
- Fix a typo in the doc block for `Jekyll::URL.escape_path` ([#3052]({{ site.repository }}/issues/3052))
|
||||
- Add integration test for `jekyll new --blank` in TestUnit ([#2913]({{ site.repository }}/issues/2913))
|
||||
- Add unit test for `jekyll new --force` logic ([#2929]({{ site.repository }}/issues/2929))
|
||||
- Update outdated comment for `Convertible#transform` ([#2957]({{ site.repository }}/issues/2957))
|
||||
- Add Hakiri badge to README. ([#2953]({{ site.repository }}/issues/2953))
|
||||
- Add some simple benchmarking tools. ([#2993]({{ site.repository }}/issues/2993))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v2-5-0}
|
||||
|
||||
- `NOKOGIRI_USE_SYSTEM_LIBRARIES=true` **decreases** installation time. ([#3040]({{ site.repository }}/issues/3040))
|
||||
- Add FormKeep to resources as Jekyll form backend ([#3010]({{ site.repository }}/issues/3010))
|
||||
- Fixing a mistake in the name of the new Liquid tag ([#2969]({{ site.repository }}/issues/2969))
|
||||
- Update Font Awesome to v4.2.0. ([#2898]({{ site.repository }}/issues/2898))
|
||||
- Fix link to [#2895]({{ site.repository }}/issues/2895) in 2.4.0 release post. ([#2899]({{ site.repository }}/issues/2899))
|
||||
- Add Big Footnotes for Kramdown plugin to list of third-party plugins ([#2916]({{ site.repository }}/issues/2916))
|
||||
- Remove warning regarding GHP use of singular types for front matter defaults ([#2919]({{ site.repository }}/issues/2919))
|
||||
- Fix quote character typo in site documentation for templates ([#2917]({{ site.repository }}/issues/2917))
|
||||
- Point Liquid links to Liquid’s Github wiki ([#2887]({{ site.repository }}/issues/2887))
|
||||
- Add HTTP Basic Auth (.htaccess) plugin to list of third-party plugins ([#2931]({{ site.repository }}/issues/2931))
|
||||
- (Minor) Grammar & `_config.yml` filename fixes ([#2911]({{ site.repository }}/issues/2911))
|
||||
- Added `mathml.rb` to the list of third-party plugins. ([#2937]({{ site.repository }}/issues/2937))
|
||||
- Add `--force_polling` to the list of configuration options ([#2943]({{ site.repository }}/issues/2943))
|
||||
- Escape unicode characters in site CSS ([#2906]({{ site.repository }}/issues/2906))
|
||||
- Add note about using the github-pages gem via pages.github.com/versions.json ([#2939]({{ site.repository }}/issues/2939))
|
||||
- Update usage documentation to reflect 2.4 auto-enabling of `--watch`. ([#2954]({{ site.repository }}/issues/2954))
|
||||
- Add `--skip-initial-build` to configuration docs ([#2949]({{ site.repository }}/issues/2949))
|
||||
- Fix a minor typo in Templates docs page ([#2959]({{ site.repository }}/issues/2959))
|
||||
- Add a ditaa-ditaa plugin under Other section on the Plugins page ([#2967]({{ site.repository }}/issues/2967))
|
||||
- Add `build/serve -V` option to configuration documentation ([#2948]({{ site.repository }}/issues/2948))
|
||||
- Add 'Jekyll Twitter Plugin' to list of third-party plugins ([#2979]({{ site.repository }}/issues/2979))
|
||||
- Docs: Update normalize.css to v3.0.2. ([#2981]({{ site.repository }}/issues/2981))
|
||||
- Fix typo in Continuous Integration documentation ([#2984]({{ site.repository }}/issues/2984))
|
||||
- Clarify behavior of `:categories` in permalinks ([#3011]({{ site.repository }}/issues/3011))
|
||||
|
||||
|
||||
## 2.4.0 / 2014-09-09
|
||||
{: #v2-4-0}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v2-4-0}
|
||||
|
||||
- Support a new `relative_include` tag ([#2870]({{ site.repository }}/issues/2870))
|
||||
- Auto-enable watch on 'serve' ([#2858]({{ site.repository }}/issues/2858))
|
||||
- Render Liquid in CoffeeScript files ([#2830]({{ site.repository }}/issues/2830))
|
||||
- Array Liquid filters: `push`, `pop`, `unshift`, `shift` ([#2895]({{ site.repository }}/issues/2895))
|
||||
- Add `:title` to collection URL template fillers ([#2864]({{ site.repository }}/issues/2864))
|
||||
- Add support for CSV files in the `_data` directory ([#2761]({{ site.repository }}/issues/2761))
|
||||
- Add the `name` variable to collection permalinks ([#2799]({{ site.repository }}/issues/2799))
|
||||
- Add `inspect` liquid filter. ([#2867]({{ site.repository }}/issues/2867))
|
||||
- Add a `slugify` Liquid filter ([#2880]({{ site.repository }}/issues/2880))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v2-4-0}
|
||||
|
||||
- Use `Jekyll.sanitized_path` when adding static files to Collections ([#2849]({{ site.repository }}/issues/2849))
|
||||
- Fix encoding of `main.scss` in site template ([#2771]({{ site.repository }}/issues/2771))
|
||||
- Fix orientation bugs in default site template ([#2862]({{ site.repository }}/issues/2862))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v2-4-0}
|
||||
|
||||
- Update simplecov gem to 0.9 ([#2748]({{ site.repository }}/issues/2748))
|
||||
- Remove `docs/` dir ([#2768]({{ site.repository }}/issues/2768))
|
||||
- add class `<< self` idiom to `New` command ([#2817]({{ site.repository }}/issues/2817))
|
||||
- Allow Travis to 'parallelize' our tests ([#2859]({{ site.repository }}/issues/2859))
|
||||
- Fix test for Liquid rendering in Sass ([#2856]({{ site.repository }}/issues/2856))
|
||||
- Fixing "vertycal" typo in site template's `_base.scss` ([#2889]({{ site.repository }}/issues/2889))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v2-4-0}
|
||||
|
||||
- Document the `name` variable for collection permalinks ([#2829]({{ site.repository }}/issues/2829))
|
||||
- Adds info about installing jekyll in current dir ([#2839]({{ site.repository }}/issues/2839))
|
||||
- Remove deprecated `jekyll-projectlist` plugin from list of third-party
|
||||
plugins ([#2742]({{ site.repository }}/issues/2742))
|
||||
- Remove tag plugins that are built in to Jekyll ([#2751]({{ site.repository }}/issues/2751))
|
||||
- Add `markdown-writer` package for Atom Editor to list of third-party
|
||||
plugins ([#2763]({{ site.repository }}/issues/2763))
|
||||
- Fix typo in site documentation for collections ([#2764]({{ site.repository }}/issues/2764))
|
||||
- Fix minor typo on plugins docs page ([#2765]({{ site.repository }}/issues/2765))
|
||||
- Replace markdown with HTML in `sass_dir` note on assets page ([#2791]({{ site.repository }}/issues/2791))
|
||||
- Fixed "bellow" typo in datafiles docs ([#2879]({{ site.repository }}/issues/2879))
|
||||
- Fix code/markdown issue in documentation for variables ([#2877]({{ site.repository }}/issues/2877))
|
||||
- Remove Good Include third-party plugin from plugins page ([#2881]({{ site.repository }}/issues/2881))
|
||||
- Add some more docs on `include_relative` ([#2884]({{ site.repository }}/issues/2884))
|
||||
|
||||
|
||||
## 2.3.0 / 2014-08-10
|
||||
{: #v2-3-0}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Jekyll is a simple, blog-aware, static site generator. It takes a template
|
||||
directory containing raw text files in various formats, runs it through
|
||||
[Markdown](http://daringfireball.net/projects/markdown/) (or
|
||||
[Textile](http://redcloth.org/textile)) and
|
||||
[Liquid](http://wiki.shopify.com/Liquid)
|
||||
[Liquid](https://github.com/Shopify/liquid/wiki)
|
||||
converters, and spits out a complete, ready-to-publish static website suitable
|
||||
for serving with your favorite web server. Jekyll also happens to be the engine
|
||||
behind [GitHub Pages](http://pages.github.com), which means you can use Jekyll
|
||||
|
||||
@@ -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 page’s folder. This way
|
||||
|
||||
@@ -32,14 +32,14 @@ paginate: 5
|
||||
The number should be the maximum number of Posts you’d like to be displayed per-
|
||||
page in the generated site.
|
||||
|
||||
You may also specify where the destination of the pagination pages:
|
||||
You may also specify the destination of the pagination pages:
|
||||
|
||||
{% highlight yaml %}
|
||||
paginate_path: "blog/page:num"
|
||||
paginate_path: "blog/page:num/"
|
||||
{% endhighlight %}
|
||||
|
||||
This will read in `blog/index.html`, send it each pagination page in Liquid as `paginator`
|
||||
and write the output to `blog/page:num`, where `:num` is the pagination page number,
|
||||
and write the output to `blog/page:num/`, where `:num` is the pagination page number,
|
||||
starting with `2`. If a site has 12 posts and specifies `paginate: 5`, Jekyll will write
|
||||
`blog/index.html` with the first 5 posts, `blog/page2/index.html` with the next 5 posts
|
||||
and `blog/page3/index.html` with the last 2 posts into the destination directory.
|
||||
@@ -155,13 +155,13 @@ title: My Blog
|
||||
<!-- Pagination links -->
|
||||
<div class="pagination">
|
||||
{% if paginator.previous_page %}
|
||||
<a href="/page{{ paginator.previous_page }}" class="previous">Previous</a>
|
||||
<a href="{{ paginator.previous_page_path }}" class="previous">Previous</a>
|
||||
{% else %}
|
||||
<span class="previous">Previous</span>
|
||||
{% endif %}
|
||||
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
|
||||
{% if paginator.next_page %}
|
||||
<a href="/page{{ paginator.next_page }}" class="next">Next</a>
|
||||
<a href="{{ paginator.next_page_path }}" class="next">Next</a>
|
||||
{% else %}
|
||||
<span class="next ">Next</span>
|
||||
{% endif %}
|
||||
|
||||
@@ -89,9 +89,10 @@ permalink is defined as `/:categories/:year/:month/:day/:title.html`.
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The specified categories for this Post. Jekyll automatically parses
|
||||
out double slashes in the URLs, so if no categories are present, it
|
||||
will ignore this.
|
||||
The specified categories for this Post. If a post has multiple
|
||||
categories, Jekyll will create a hierarchy (e.g. <code>/category1/category2</code>).
|
||||
Also Jekyll automatically parses out double slashes in the URLs,
|
||||
so if no categories are present, it will ignore this.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user