mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
1565 Commits
v3.1.0
...
pull/markd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0c591a3f2 | ||
|
|
167af4552b | ||
|
|
3cc4bef2e6 | ||
|
|
4785f6f71f | ||
|
|
12a86c1298 | ||
|
|
0ce9d726f5 | ||
|
|
d6844d284c | ||
|
|
4d597643ec | ||
|
|
343d5f7be5 | ||
|
|
11a0b6578e | ||
|
|
3431c9f7b8 | ||
|
|
eca7f46749 | ||
|
|
821a845166 | ||
|
|
d979b4bf9b | ||
|
|
124c63fd59 | ||
|
|
89bbb249af | ||
|
|
344d07cb55 | ||
|
|
0484986c16 | ||
|
|
c7d0dda5a7 | ||
|
|
ea72f98609 | ||
|
|
0f5c34d16d | ||
|
|
0d8e21f779 | ||
|
|
2be5d56059 | ||
|
|
e6829b5949 | ||
|
|
8a4edc550b | ||
|
|
cc1972848d | ||
|
|
51d9be83a1 | ||
|
|
c4a23b4ced | ||
|
|
b9275920dd | ||
|
|
53d20bc77e | ||
|
|
7aa9c3f12c | ||
|
|
00e3c979c9 | ||
|
|
0a1c837755 | ||
|
|
7c901baac1 | ||
|
|
1f9c2b1380 | ||
|
|
146d5930a4 | ||
|
|
6ec86f4207 | ||
|
|
d1f67bf85a | ||
|
|
c9d24b7d18 | ||
|
|
62ec32c883 | ||
|
|
aa97be3ab5 | ||
|
|
389bbe1621 | ||
|
|
0d12a02893 | ||
|
|
d4b7b44328 | ||
|
|
6cec4aebc6 | ||
|
|
f2fcd17627 | ||
|
|
c569edcf0a | ||
|
|
53d472b7e2 | ||
|
|
f93e40209c | ||
|
|
5e93ca6353 | ||
|
|
8bac0559d1 | ||
|
|
b4393e2d36 | ||
|
|
dc554c2cd5 | ||
|
|
21cd382409 | ||
|
|
b37d18234a | ||
|
|
6f05ebb520 | ||
|
|
ed042de6c4 | ||
|
|
7c8c825f27 | ||
|
|
63e4e750ec | ||
|
|
6d1bc6c6ea | ||
|
|
c90d44d2be | ||
|
|
7133bddfb2 | ||
|
|
41d0ba66ea | ||
|
|
8ec7421c03 | ||
|
|
c61752a336 | ||
|
|
fcef78c4b6 | ||
|
|
6f2d1591fc | ||
|
|
f67dfb71fe | ||
|
|
3de78877c0 | ||
|
|
38f9e93a10 | ||
|
|
22a7714bba | ||
|
|
55257d2a14 | ||
|
|
275f5a6209 | ||
|
|
7ea610f8c0 | ||
|
|
d879840cc5 | ||
|
|
a945a65818 | ||
|
|
e27a65d9e3 | ||
|
|
01c33907a3 | ||
|
|
a138b02b10 | ||
|
|
761ddcae24 | ||
|
|
274d350d61 | ||
|
|
80ae013541 | ||
|
|
a0a351aa7a | ||
|
|
cff8f2994c | ||
|
|
aa901cdaba | ||
|
|
ef3f9d0e7a | ||
|
|
d716d9b7be | ||
|
|
5a31aacfbe | ||
|
|
7118999958 | ||
|
|
553fae8f17 | ||
|
|
459bc17019 | ||
|
|
f0574e047e | ||
|
|
b38ac5d938 | ||
|
|
feddd7daec | ||
|
|
1c7aa4729e | ||
|
|
54927d6522 | ||
|
|
91ef3a7cc9 | ||
|
|
69172bcc4a | ||
|
|
3d3f310a5e | ||
|
|
51695b2165 | ||
|
|
5b4269eca5 | ||
|
|
8e91263031 | ||
|
|
fd5f2eb399 | ||
|
|
682c0fc98f | ||
|
|
6847b604c8 | ||
|
|
b6d4ba56b7 | ||
|
|
9c197d9555 | ||
|
|
79b0f27bf6 | ||
|
|
0f70bb1320 | ||
|
|
d57b04782d | ||
|
|
2f5b7dc1dc | ||
|
|
8138e67ffb | ||
|
|
719c0938a5 | ||
|
|
93c7cdf0d0 | ||
|
|
06651c960a | ||
|
|
a920cf040b | ||
|
|
6c5a371b92 | ||
|
|
157c8e888e | ||
|
|
a69919ecbe | ||
|
|
6dbb5e2df1 | ||
|
|
c4ccfae3af | ||
|
|
481901b413 | ||
|
|
8321b14b29 | ||
|
|
81b16b24fc | ||
|
|
6b6ce3cf18 | ||
|
|
6366f56c21 | ||
|
|
5df8ef5717 | ||
|
|
d79ca534e4 | ||
|
|
5c55d95446 | ||
|
|
2b30c06140 | ||
|
|
fc6f7802a2 | ||
|
|
aebf711c61 | ||
|
|
bacb300876 | ||
|
|
3966a37d71 | ||
|
|
93c5f71faf | ||
|
|
59fa8549f9 | ||
|
|
db53213d16 | ||
|
|
9564782054 | ||
|
|
aaa062b047 | ||
|
|
8e027fced9 | ||
|
|
f277baa975 | ||
|
|
8197e17495 | ||
|
|
69937373bd | ||
|
|
0dc15dba88 | ||
|
|
fa96843555 | ||
|
|
6571ea0c1a | ||
|
|
992be253a6 | ||
|
|
081d7c016a | ||
|
|
2a02c798ac | ||
|
|
eab6752f52 | ||
|
|
aa86651650 | ||
|
|
ae27db62eb | ||
|
|
87c745573f | ||
|
|
25d4291d62 | ||
|
|
588b3a6649 | ||
|
|
99fc60e28c | ||
|
|
846ab94f43 | ||
|
|
3a7cbadd82 | ||
|
|
f3859384c0 | ||
|
|
ee84a95a38 | ||
|
|
9ae0a7023b | ||
|
|
1ac87eaae2 | ||
|
|
cfe61771e0 | ||
|
|
262be85c49 | ||
|
|
504411e476 | ||
|
|
650a3c7932 | ||
|
|
ad0f329d1c | ||
|
|
152fa877f6 | ||
|
|
3a45bf7d26 | ||
|
|
279f1516d2 | ||
|
|
29d8fee4ce | ||
|
|
950a37395f | ||
|
|
d8d42f6abc | ||
|
|
92dbe313e9 | ||
|
|
2eedf7d79c | ||
|
|
75d59911ae | ||
|
|
b78827cecb | ||
|
|
7309ecf8e1 | ||
|
|
3bfdc00d14 | ||
|
|
f2bfc832a0 | ||
|
|
054b23f69a | ||
|
|
0b94cf3fa1 | ||
|
|
1a11536a2c | ||
|
|
74baeb889a | ||
|
|
7a9427ccec | ||
|
|
5a1c5311f3 | ||
|
|
9aea71137e | ||
|
|
5a932c90b5 | ||
|
|
6d7f305e7c | ||
|
|
cf26bf5db0 | ||
|
|
87b9cfe2b5 | ||
|
|
13aec48137 | ||
|
|
b8f17b9034 | ||
|
|
562ffe7a3f | ||
|
|
c877d6f75c | ||
|
|
0233d93352 | ||
|
|
59b61c3f9f | ||
|
|
57fd5f887d | ||
|
|
4888b84b44 | ||
|
|
345f043cc4 | ||
|
|
566b42b8b3 | ||
|
|
55de780520 | ||
|
|
42725b1325 | ||
|
|
d86a293d78 | ||
|
|
a2e911c1b5 | ||
|
|
3e0363be4a | ||
|
|
aa2cfc81b7 | ||
|
|
a70abbeab5 | ||
|
|
8813173ba7 | ||
|
|
6ebdcdb198 | ||
|
|
9fd7e2c063 | ||
|
|
eefcbf5dde | ||
|
|
19f7a0b8fc | ||
|
|
c1e6f1fb94 | ||
|
|
9164973a6c | ||
|
|
f53a3b6272 | ||
|
|
dddafccb36 | ||
|
|
8c979ec565 | ||
|
|
3d38e8510c | ||
|
|
3840a38081 | ||
|
|
d632cdda68 | ||
|
|
57ab7c5f98 | ||
|
|
f0293def80 | ||
|
|
42b85bb82f | ||
|
|
b47db14f86 | ||
|
|
a666e6faee | ||
|
|
f69671c46c | ||
|
|
08436d75b8 | ||
|
|
da0776d70e | ||
|
|
57b86ee77e | ||
|
|
9b09d8a8e8 | ||
|
|
63595f388d | ||
|
|
45aac995d8 | ||
|
|
2f167aeea7 | ||
|
|
4af0f0262e | ||
|
|
4f80dde8c4 | ||
|
|
5093849b58 | ||
|
|
d905a0475a | ||
|
|
6a34966f20 | ||
|
|
a78426f20d | ||
|
|
9ddc12bad8 | ||
|
|
ac6bbc1906 | ||
|
|
8014c54ee0 | ||
|
|
73e79f0049 | ||
|
|
8496e2e8b6 | ||
|
|
d0f57b61d4 | ||
|
|
741102bd40 | ||
|
|
b781b9967d | ||
|
|
17883b77c6 | ||
|
|
6b121d2d85 | ||
|
|
5b21f8fda9 | ||
|
|
2b15b0b325 | ||
|
|
4420c3b2af | ||
|
|
40cc44c2ea | ||
|
|
b5ee87b4ca | ||
|
|
7c8dd4a55e | ||
|
|
f3d0a97604 | ||
|
|
095d5344cd | ||
|
|
b2ece36d27 | ||
|
|
160782ec50 | ||
|
|
f3093e2f6f | ||
|
|
34404af031 | ||
|
|
20f9c26088 | ||
|
|
0ad9fa3ba3 | ||
|
|
809ceea107 | ||
|
|
bd4e7465ef | ||
|
|
fd65e6ce32 | ||
|
|
a9da814f17 | ||
|
|
349569592e | ||
|
|
d0d41792f9 | ||
|
|
d49bf808b6 | ||
|
|
02602bebd7 | ||
|
|
4f8d8557e4 | ||
|
|
488496a3a6 | ||
|
|
1979426812 | ||
|
|
35846b8406 | ||
|
|
0e2aa46bcb | ||
|
|
b0425d8308 | ||
|
|
1930e13cad | ||
|
|
891a66bddb | ||
|
|
23d7929948 | ||
|
|
0d8796fbe6 | ||
|
|
7f578b5dd8 | ||
|
|
1cd880f9d0 | ||
|
|
f56f252b28 | ||
|
|
59b8f2da55 | ||
|
|
7892c5e1f3 | ||
|
|
2183d9d6b4 | ||
|
|
158e02623a | ||
|
|
9c33754f4f | ||
|
|
299e89df01 | ||
|
|
8903038571 | ||
|
|
250ca228c9 | ||
|
|
e0580c8909 | ||
|
|
ff55309dd7 | ||
|
|
13330caa19 | ||
|
|
e4233b055e | ||
|
|
a74a6be4c4 | ||
|
|
a5470a32f1 | ||
|
|
df1cafd507 | ||
|
|
7c6fde1ac2 | ||
|
|
bcedf2079f | ||
|
|
cf33a9c427 | ||
|
|
8aa54ad801 | ||
|
|
0a75156f85 | ||
|
|
13ce18d6a6 | ||
|
|
276404c3f8 | ||
|
|
d759cfbeb9 | ||
|
|
b908c3de1d | ||
|
|
6b289314e1 | ||
|
|
27139f40e2 | ||
|
|
478ea05c2e | ||
|
|
ade752b1c3 | ||
|
|
4319a752b1 | ||
|
|
3180b1490d | ||
|
|
c5e1c66b73 | ||
|
|
a24636d1dc | ||
|
|
326332a5d5 | ||
|
|
87c00b2756 | ||
|
|
594a6bf193 | ||
|
|
db61028b58 | ||
|
|
3dcad7284b | ||
|
|
830f157f51 | ||
|
|
596f5d1af3 | ||
|
|
9061f0b1f3 | ||
|
|
9716b57e10 | ||
|
|
1e97ae014f | ||
|
|
d0ae757714 | ||
|
|
06b3d72aa3 | ||
|
|
1b36e9fe85 | ||
|
|
748b2f1279 | ||
|
|
dadf43798e | ||
|
|
b82b93c7c0 | ||
|
|
a9f92278d3 | ||
|
|
f1f8319566 | ||
|
|
912079a796 | ||
|
|
e080c7f1ce | ||
|
|
9f8876a332 | ||
|
|
72629091d1 | ||
|
|
30399528e4 | ||
|
|
a49a5dcf4e | ||
|
|
dca8047f77 | ||
|
|
5a243fb64c | ||
|
|
3e65dd36a9 | ||
|
|
e6f3fd347c | ||
|
|
b3ce1392db | ||
|
|
1c68c23f85 | ||
|
|
8e361dfe7d | ||
|
|
4d44940b9c | ||
|
|
fbebdb7ce7 | ||
|
|
088e931901 | ||
|
|
c526c9dd62 | ||
|
|
519ccdf4d9 | ||
|
|
4bff65be90 | ||
|
|
554749ae0a | ||
|
|
b937757dce | ||
|
|
70ba8c578a | ||
|
|
de6476812f | ||
|
|
7841db8acf | ||
|
|
ab4abb1933 | ||
|
|
539154a158 | ||
|
|
06126af5cc | ||
|
|
d9a4f6a59a | ||
|
|
6167c09569 | ||
|
|
bc7aaf5274 | ||
|
|
d0f55d7207 | ||
|
|
c9bf8d0726 | ||
|
|
61eda2ee40 | ||
|
|
aa8d7772d5 | ||
|
|
6ab8b5ffe1 | ||
|
|
e0ce4a00f8 | ||
|
|
05445b81c7 | ||
|
|
50854d2f76 | ||
|
|
82d6657ae8 | ||
|
|
bc7eb70385 | ||
|
|
a63a6d8487 | ||
|
|
9e4f469469 | ||
|
|
ca77dae267 | ||
|
|
58cd8f3f4e | ||
|
|
ddff013696 | ||
|
|
f084de7bc9 | ||
|
|
01c59004e9 | ||
|
|
cb99cf603a | ||
|
|
d3ae8403ea | ||
|
|
997c61470b | ||
|
|
2bd592077d | ||
|
|
da0b456288 | ||
|
|
eef3687486 | ||
|
|
b5dcd4b295 | ||
|
|
57c6408b7f | ||
|
|
d504eb5ce9 | ||
|
|
15dc18343c | ||
|
|
d4a68eb642 | ||
|
|
a7bc7ff9c7 | ||
|
|
3943de066c | ||
|
|
d5e96757a5 | ||
|
|
801d12b916 | ||
|
|
050aacfc85 | ||
|
|
3f1b12972b | ||
|
|
20e1da8d0b | ||
|
|
9ccd0d767a | ||
|
|
bf8c15f949 | ||
|
|
6d2b344c0e | ||
|
|
88b57ce649 | ||
|
|
663117403d | ||
|
|
c4483a3a29 | ||
|
|
896a502129 | ||
|
|
8408449551 | ||
|
|
6e0119d5e1 | ||
|
|
b113c01198 | ||
|
|
c6417e8c82 | ||
|
|
c6f2459b4e | ||
|
|
73b7bd8172 | ||
|
|
28365aef96 | ||
|
|
52f5dc154c | ||
|
|
dc8c6e0e43 | ||
|
|
8540487997 | ||
|
|
95e9774100 | ||
|
|
e735e45156 | ||
|
|
ae72c64441 | ||
|
|
4d0d528fd5 | ||
|
|
26b827a536 | ||
|
|
1374a6c84c | ||
|
|
c5bd075bc7 | ||
|
|
4dab0c7da6 | ||
|
|
65d1dc48f3 | ||
|
|
207b6f19f0 | ||
|
|
9d45644e6c | ||
|
|
d158d73ce1 | ||
|
|
2236ee4284 | ||
|
|
d4e18fc979 | ||
|
|
3b2bbcb70f | ||
|
|
8e25b8bffb | ||
|
|
909800839c | ||
|
|
27cfa00a43 | ||
|
|
ff80d2f2b5 | ||
|
|
9220c5a634 | ||
|
|
b22fa7ce4e | ||
|
|
8b69c6f0b5 | ||
|
|
94af8ca75a | ||
|
|
f29ebc4911 | ||
|
|
16ff4c12bb | ||
|
|
e01f1ece48 | ||
|
|
2351ef6bbe | ||
|
|
bd96ca4ab6 | ||
|
|
54281530fb | ||
|
|
4278f856ef | ||
|
|
ca03a41564 | ||
|
|
1bf47ec394 | ||
|
|
6292476482 | ||
|
|
26f1ea2487 | ||
|
|
dd82c72e14 | ||
|
|
b9017f8b81 | ||
|
|
09570623f2 | ||
|
|
07518d9540 | ||
|
|
d9b8360d96 | ||
|
|
f4c3c5afd6 | ||
|
|
59c8f02129 | ||
|
|
989fc9c3db | ||
|
|
1155371f4e | ||
|
|
83456e7cd2 | ||
|
|
142957ff49 | ||
|
|
954c0bfe07 | ||
|
|
ea185f11af | ||
|
|
b65aa4748b | ||
|
|
7e34be945a | ||
|
|
a31766d329 | ||
|
|
058f9e8533 | ||
|
|
deab138f23 | ||
|
|
edec81ef96 | ||
|
|
823a8630b6 | ||
|
|
55317817d1 | ||
|
|
dbf312eec0 | ||
|
|
c83246bfe2 | ||
|
|
2c224b0990 | ||
|
|
a3ecce7cc1 | ||
|
|
087b763478 | ||
|
|
4b476f70e6 | ||
|
|
30e34a72c0 | ||
|
|
9b0532a3c4 | ||
|
|
41a99b300d | ||
|
|
7dd9e954d9 | ||
|
|
4b698747dc | ||
|
|
5805ea78ec | ||
|
|
6b0b6418dc | ||
|
|
3580e4fe82 | ||
|
|
0f3ce73516 | ||
|
|
28548f985e | ||
|
|
57944c3da4 | ||
|
|
da72c0974c | ||
|
|
810e411bdf | ||
|
|
d0fbae2294 | ||
|
|
5e3f9cdd4f | ||
|
|
ed3f745b77 | ||
|
|
71a971ff46 | ||
|
|
0e0e9f2081 | ||
|
|
90cf9f210e | ||
|
|
9f02ec6cf8 | ||
|
|
8d4ab9366e | ||
|
|
9176924eab | ||
|
|
1be51f963b | ||
|
|
f8aea7b35c | ||
|
|
e5028d505b | ||
|
|
9da15b62b1 | ||
|
|
c1e1d2a099 | ||
|
|
f4a9a2622c | ||
|
|
04cfd9f725 | ||
|
|
ff224cdfb2 | ||
|
|
acbdc3a4a5 | ||
|
|
eb28b5c296 | ||
|
|
3c2765d104 | ||
|
|
84c4d1998a | ||
|
|
a3b179373c | ||
|
|
9ee211a076 | ||
|
|
96194c3ce2 | ||
|
|
d590d7a738 | ||
|
|
990d385736 | ||
|
|
51f5c2809f | ||
|
|
c22d9e69df | ||
|
|
b474ea8550 | ||
|
|
5fb48430ca | ||
|
|
2f9ebaf7f4 | ||
|
|
cca211af98 | ||
|
|
b6044aebd6 | ||
|
|
dbea0c5389 | ||
|
|
0bd29bd632 | ||
|
|
2b4680bb94 | ||
|
|
ff25e4e2cf | ||
|
|
0963f85871 | ||
|
|
f8a4f58fff | ||
|
|
dcdbc29497 | ||
|
|
7975d2e994 | ||
|
|
1cfcf38289 | ||
|
|
5ca080ac6f | ||
|
|
dbc0349909 | ||
|
|
311e3d2fef | ||
|
|
5e74610755 | ||
|
|
cfeb54d4be | ||
|
|
10cfaa2a75 | ||
|
|
ed98597d49 | ||
|
|
196275f5b4 | ||
|
|
eb88aa330c | ||
|
|
0db1ec339d | ||
|
|
3ae7d0c319 | ||
|
|
b9f232e5bf | ||
|
|
b88f0a21d6 | ||
|
|
3b6561a57c | ||
|
|
4dee1f6aa7 | ||
|
|
16ba22f7c3 | ||
|
|
20b3758edb | ||
|
|
f417cf8a0f | ||
|
|
83a72606b3 | ||
|
|
99663a9199 | ||
|
|
2b57795c7f | ||
|
|
73223f3a5a | ||
|
|
49e97ef9b0 | ||
|
|
0e8f204011 | ||
|
|
695b5396fd | ||
|
|
9ef9c2fb64 | ||
|
|
3435b5ddac | ||
|
|
b44457a80b | ||
|
|
e503c17dfa | ||
|
|
b1f9a0809c | ||
|
|
5e760a206a | ||
|
|
8a3ea59141 | ||
|
|
f55cf34739 | ||
|
|
75989fdb3e | ||
|
|
5c6c01793c | ||
|
|
218c7039a9 | ||
|
|
9336ad0fcf | ||
|
|
a3cd584311 | ||
|
|
cc994105ed | ||
|
|
070267af8a | ||
|
|
f42fac60b0 | ||
|
|
b1674ed5b1 | ||
|
|
5194d1a42c | ||
|
|
a29498eaae | ||
|
|
1f366730f8 | ||
|
|
506ba8af1e | ||
|
|
49573b6fcf | ||
|
|
0ebf7129cf | ||
|
|
3674a7760f | ||
|
|
d683baa257 | ||
|
|
26b2a6251c | ||
|
|
8d2227a03a | ||
|
|
4b5126dda7 | ||
|
|
146d0f301d | ||
|
|
5b51b8bdf3 | ||
|
|
841727eed7 | ||
|
|
232054a059 | ||
|
|
d4a7fbee28 | ||
|
|
ac6ba15bae | ||
|
|
cc82d44222 | ||
|
|
ba8573c420 | ||
|
|
1c0f21230d | ||
|
|
f6dc749332 | ||
|
|
09f3e46945 | ||
|
|
1a934125d9 | ||
|
|
e3214c23a3 | ||
|
|
c46f219d3c | ||
|
|
5a339cc735 | ||
|
|
8bc104969f | ||
|
|
d4c87e3655 | ||
|
|
ba08e17204 | ||
|
|
25bff0075c | ||
|
|
08b279cbdd | ||
|
|
a25e97b5fb | ||
|
|
3a8e28cba1 | ||
|
|
c698e83eb1 | ||
|
|
3aead1d4a9 | ||
|
|
72d49490d2 | ||
|
|
51a80b8225 | ||
|
|
bfaa80e41c | ||
|
|
ac552cd4e4 | ||
|
|
dcc8960806 | ||
|
|
2f8c0ffc5d | ||
|
|
5688266d54 | ||
|
|
c261730799 | ||
|
|
897f0c52fa | ||
|
|
0599f114d6 | ||
|
|
4b7109d273 | ||
|
|
5a1a7e1056 | ||
|
|
70aa8a4e37 | ||
|
|
325b4c88d5 | ||
|
|
a072e9d25f | ||
|
|
b772329c60 | ||
|
|
a7d25ed963 | ||
|
|
6f3c01ca87 | ||
|
|
2ef70fd348 | ||
|
|
89c6b0ec0d | ||
|
|
12c1ada0e5 | ||
|
|
3a76ddf7a2 | ||
|
|
18a8b4dcc7 | ||
|
|
549371fd4e | ||
|
|
8154eb40aa | ||
|
|
390c98045c | ||
|
|
cdee574782 | ||
|
|
6ddd64d4c4 | ||
|
|
1c71b5939f | ||
|
|
3ccc91430f | ||
|
|
2bbad7cb43 | ||
|
|
b156aa912a | ||
|
|
6f5ad2530e | ||
|
|
aeca7a195e | ||
|
|
6dd3cc21c4 | ||
|
|
205acb0916 | ||
|
|
5312e85478 | ||
|
|
d093c76d35 | ||
|
|
9278eb8fce | ||
|
|
856dbcb2de | ||
|
|
77751cbf15 | ||
|
|
357e3621e2 | ||
|
|
6358a8f92c | ||
|
|
0b169f7739 | ||
|
|
13d60c21e1 | ||
|
|
8a71f0f48e | ||
|
|
b539c32364 | ||
|
|
1779aa681a | ||
|
|
fdd282cb75 | ||
|
|
f6f0f483bf | ||
|
|
08b883b268 | ||
|
|
d13112dbdc | ||
|
|
14e857029a | ||
|
|
902f344a50 | ||
|
|
5c03e1da3f | ||
|
|
97fecafff5 | ||
|
|
b06cfb9c50 | ||
|
|
7ee99bcd38 | ||
|
|
d220c7a9a9 | ||
|
|
0c7693f7b9 | ||
|
|
4afb407304 | ||
|
|
0f74db4131 | ||
|
|
7a933893db | ||
|
|
fa6934300b | ||
|
|
a71e677207 | ||
|
|
c70ca8ac97 | ||
|
|
765a23468e | ||
|
|
e9fed13392 | ||
|
|
a07917a7b2 | ||
|
|
f27fa75935 | ||
|
|
7c381c931b | ||
|
|
8fd287edba | ||
|
|
20910976c4 | ||
|
|
b972daa54d | ||
|
|
c3313d868e | ||
|
|
0c6162fc0a | ||
|
|
a9666bf1c7 | ||
|
|
1dbcf97bef | ||
|
|
52d32a643e | ||
|
|
2c3e044688 | ||
|
|
499b83236c | ||
|
|
6239bca6e6 | ||
|
|
3a1ac37ed1 | ||
|
|
6cf6da04af | ||
|
|
5e343f620a | ||
|
|
ddf833505c | ||
|
|
4a2b96293b | ||
|
|
713fbb6652 | ||
|
|
d1f4d874be | ||
|
|
8d748ce45f | ||
|
|
fb1a459ddd | ||
|
|
492cfcd962 | ||
|
|
cb0545dd46 | ||
|
|
8d65ce675a | ||
|
|
e85e89bbff | ||
|
|
73f70e9071 | ||
|
|
e72bfdab21 | ||
|
|
ce1c148898 | ||
|
|
ad94182b49 | ||
|
|
902ff4c132 | ||
|
|
9f1f70267f | ||
|
|
c96fc1166c | ||
|
|
15477d2417 | ||
|
|
d3c9b8d077 | ||
|
|
6c279b173f | ||
|
|
3fe9e92c4f | ||
|
|
b5466196ea | ||
|
|
d8acc434ae | ||
|
|
959f19c086 | ||
|
|
c2441ffbb4 | ||
|
|
eba9a2716b | ||
|
|
176b347737 | ||
|
|
9e8f205009 | ||
|
|
8b1c3bbf33 | ||
|
|
4c4327a14b | ||
|
|
e6dc78b22f | ||
|
|
6fd734f6ea | ||
|
|
dfc7d61765 | ||
|
|
5f2bb5d0aa | ||
|
|
2f95517bfd | ||
|
|
59a04ab4cb | ||
|
|
732ca468fa | ||
|
|
43fe09a07b | ||
|
|
7197028cd5 | ||
|
|
915b80b6b3 | ||
|
|
c8606c5765 | ||
|
|
f41bd1bab7 | ||
|
|
1f01c88fa0 | ||
|
|
688c7b1925 | ||
|
|
184da0ca2f | ||
|
|
e0f2848da6 | ||
|
|
652f1bad0b | ||
|
|
a5db408d5c | ||
|
|
f5a8000baa | ||
|
|
8917fa8282 | ||
|
|
ea0b43f56d | ||
|
|
8308a06b02 | ||
|
|
b3583a4236 | ||
|
|
03c2811ae0 | ||
|
|
912e6b469a | ||
|
|
b15423b6a9 | ||
|
|
bf524d62aa | ||
|
|
59bd2587df | ||
|
|
1c6916f237 | ||
|
|
e2ae0bab8a | ||
|
|
93f176f8c5 | ||
|
|
712e77abd2 | ||
|
|
6e504a0d2e | ||
|
|
3531df7428 | ||
|
|
d725991237 | ||
|
|
fe143c4e8f | ||
|
|
f5a0db9dcc | ||
|
|
74d363f080 | ||
|
|
986eda335c | ||
|
|
52fcd6981f | ||
|
|
5e30823544 | ||
|
|
7cd20261ab | ||
|
|
6a07254cbf | ||
|
|
956495f450 | ||
|
|
4b1012537f | ||
|
|
6355a07d4b | ||
|
|
14b36aae38 | ||
|
|
b5cff52f02 | ||
|
|
d6e58623c6 | ||
|
|
3a8025cb08 | ||
|
|
0212c83814 | ||
|
|
1e22c3659a | ||
|
|
d68ddf9dac | ||
|
|
bbbbb2e704 | ||
|
|
c2ee828ad6 | ||
|
|
675c105e85 | ||
|
|
dc4b91b0c8 | ||
|
|
e7677bdf51 | ||
|
|
97e196cb19 | ||
|
|
c642b84e80 | ||
|
|
e367f13f72 | ||
|
|
899316f401 | ||
|
|
261bc8f467 | ||
|
|
2bc8dc53ff | ||
|
|
597e8ee5d5 | ||
|
|
06cff8f781 | ||
|
|
e97fd34479 | ||
|
|
7efb0d4856 | ||
|
|
372f350a75 | ||
|
|
5acac4a925 | ||
|
|
db6050768d | ||
|
|
03f7bc1a8c | ||
|
|
714c99b418 | ||
|
|
5dfaa66d48 | ||
|
|
b5cec7d335 | ||
|
|
22982ef79e | ||
|
|
d5d2fd8674 | ||
|
|
f8c038566c | ||
|
|
14c1ac388f | ||
|
|
ca2abea086 | ||
|
|
35b3c91b64 | ||
|
|
3a3405fe51 | ||
|
|
7a02f29e70 | ||
|
|
5e46a02d71 | ||
|
|
8c231ed50a | ||
|
|
8a5148f589 | ||
|
|
632f3fd8de | ||
|
|
8d0a4be5e0 | ||
|
|
0ac9c7fe70 | ||
|
|
40c6702a0d | ||
|
|
753ff9216c | ||
|
|
f73b2d0a01 | ||
|
|
30eebaf5e0 | ||
|
|
45a5a976f0 | ||
|
|
ab3cda6e58 | ||
|
|
ff591dd5dc | ||
|
|
cd63272080 | ||
|
|
427e30c0f8 | ||
|
|
87acab9a86 | ||
|
|
b5aafc3137 | ||
|
|
f271b8b4b5 | ||
|
|
001cbf2c07 | ||
|
|
ae71db4693 | ||
|
|
acc9f511c5 | ||
|
|
d855ec03ba | ||
|
|
0880dc097f | ||
|
|
38eb326b7f | ||
|
|
d58c986b2b | ||
|
|
0d0ed561fd | ||
|
|
382be191ae | ||
|
|
0696e6c169 | ||
|
|
615a9ee9ac | ||
|
|
e85690a61f | ||
|
|
795bcdef68 | ||
|
|
40ec84cf61 | ||
|
|
4c35d15a3b | ||
|
|
3e42e6d461 | ||
|
|
1cec820628 | ||
|
|
fbff506faa | ||
|
|
5a23b130ce | ||
|
|
8fbeb52314 | ||
|
|
98262b73d5 | ||
|
|
474fc0a9a8 | ||
|
|
7537b01e74 | ||
|
|
23646549c4 | ||
|
|
c00c761e1d | ||
|
|
5291bd0498 | ||
|
|
fd75f0f7b1 | ||
|
|
6ef2bcb29a | ||
|
|
746e360c63 | ||
|
|
b950e7dd90 | ||
|
|
34d172007b | ||
|
|
4fbbeddae2 | ||
|
|
cceb8c5876 | ||
|
|
a15958d5a7 | ||
|
|
6f1e1d80cd | ||
|
|
b353e181c1 | ||
|
|
aff1430608 | ||
|
|
e56e58e498 | ||
|
|
02bf4f1032 | ||
|
|
d9c9e0238a | ||
|
|
dc5fd15f71 | ||
|
|
1502d00063 | ||
|
|
0ca45a48e5 | ||
|
|
3c0d1a18bf | ||
|
|
a7cbb89dfc | ||
|
|
cf810a88fa | ||
|
|
2caf8e0621 | ||
|
|
5c036cf3c4 | ||
|
|
757233754e | ||
|
|
10543e7c46 | ||
|
|
de39107c76 | ||
|
|
65e78b3280 | ||
|
|
3a04093e51 | ||
|
|
733c56a65e | ||
|
|
1c937013fd | ||
|
|
3292850b98 | ||
|
|
2ca80920dc | ||
|
|
f8c708ffec | ||
|
|
17d8c96a63 | ||
|
|
ad7bd84098 | ||
|
|
1a05483a63 | ||
|
|
cc0c5ea19e | ||
|
|
db7cd6f612 | ||
|
|
8e939cd86e | ||
|
|
a99adcafaa | ||
|
|
7641971d7e | ||
|
|
48274244e3 | ||
|
|
d5c3785d29 | ||
|
|
de5970ae55 | ||
|
|
d84844c223 | ||
|
|
ad59b6e62a | ||
|
|
37b93f10dd | ||
|
|
59346eb228 | ||
|
|
8af77643c5 | ||
|
|
f52a0e7200 | ||
|
|
d01f7943de | ||
|
|
fab092fcec | ||
|
|
4e06f07ad4 | ||
|
|
6eaa8e90f8 | ||
|
|
04d4473119 | ||
|
|
dbcbf809ff | ||
|
|
f2263a11b7 | ||
|
|
c69ca4c11e | ||
|
|
48f16974ce | ||
|
|
7d3f8ac75d | ||
|
|
c0910f2bc5 | ||
|
|
3896f6d5d8 | ||
|
|
b019234007 | ||
|
|
2c567a6dc3 | ||
|
|
80a65d161f | ||
|
|
0d11511914 | ||
|
|
41a8b10780 | ||
|
|
a8d27e5788 | ||
|
|
e02049727b | ||
|
|
6eaf2634f2 | ||
|
|
dbda462c2f | ||
|
|
6db5272528 | ||
|
|
281a873c71 | ||
|
|
d743c80357 | ||
|
|
e85f2a0ee9 | ||
|
|
8f07affe2a | ||
|
|
a9f110b861 | ||
|
|
16c1146b4f | ||
|
|
1380836a4b | ||
|
|
013e2f159d | ||
|
|
498324bbff | ||
|
|
51c4152919 | ||
|
|
8ac5b03006 | ||
|
|
cd31761f9a | ||
|
|
ee2c41ad6a | ||
|
|
f3a29677f9 | ||
|
|
f7714add15 | ||
|
|
f2d08cf138 | ||
|
|
ca0b1f7ea6 | ||
|
|
12deccc513 | ||
|
|
20110571ef | ||
|
|
3885057e9e | ||
|
|
1d81d2087e | ||
|
|
5949b4a5bb | ||
|
|
eb14b88175 | ||
|
|
952947c65e | ||
|
|
cb80934277 | ||
|
|
eab2b438c9 | ||
|
|
66e5453c35 | ||
|
|
9e92061eb3 | ||
|
|
ce9a8cb0f2 | ||
|
|
df585aa5c6 | ||
|
|
b006810f17 | ||
|
|
98eef8af95 | ||
|
|
211c16003e | ||
|
|
bc16d13d79 | ||
|
|
6ef54393c2 | ||
|
|
de5d773a6a | ||
|
|
df7992c626 | ||
|
|
df01b6825e | ||
|
|
c76b458dd5 | ||
|
|
ad98883843 | ||
|
|
5a1a8c9c82 | ||
|
|
271a8aebfb | ||
|
|
0635bbba06 | ||
|
|
555b2fbe72 | ||
|
|
c8cae38da6 | ||
|
|
cfe6cf7ca1 | ||
|
|
454a1e415c | ||
|
|
5034cc377a | ||
|
|
aad587ca2f | ||
|
|
146d49dc8f | ||
|
|
2caff755c4 | ||
|
|
eb56ca8c41 | ||
|
|
fb860fc1b7 | ||
|
|
473d85b580 | ||
|
|
583fe84edc | ||
|
|
e3df910533 | ||
|
|
3611ae99d9 | ||
|
|
2a81fef996 | ||
|
|
b484738239 | ||
|
|
b64b6aa526 | ||
|
|
465e7dd8b0 | ||
|
|
96ac1185a1 | ||
|
|
6dc9665573 | ||
|
|
83f8df49ab | ||
|
|
6a2ffbac62 | ||
|
|
64219cc11a | ||
|
|
b40524fbc3 | ||
|
|
1e89aa7a13 | ||
|
|
a4369ea7e5 | ||
|
|
451881efcf | ||
|
|
894d1fe21e | ||
|
|
26d0a8db77 | ||
|
|
6f89fd5f3f | ||
|
|
f2bad8524f | ||
|
|
8c9492d5fa | ||
|
|
207e4df3de | ||
|
|
f615475378 | ||
|
|
5258f78a51 | ||
|
|
73ae01b4e5 | ||
|
|
13eaa4fd77 | ||
|
|
3b021c6046 | ||
|
|
419c670947 | ||
|
|
cddc40fef4 | ||
|
|
85e3ce37af | ||
|
|
fa3323ec92 | ||
|
|
ffe6e0d996 | ||
|
|
b28e14bcd6 | ||
|
|
917b470459 | ||
|
|
1ae4f513d8 | ||
|
|
209cd6b729 | ||
|
|
1504864d9e | ||
|
|
3751b47c50 | ||
|
|
92720363e1 | ||
|
|
4986cb78a3 | ||
|
|
7f3a9e1f40 | ||
|
|
cd861d7fc5 | ||
|
|
4dab3dd423 | ||
|
|
8f79551da3 | ||
|
|
d9ab71cb59 | ||
|
|
770b6ab073 | ||
|
|
b7bf19ff31 | ||
|
|
2d8a228b59 | ||
|
|
55734ee482 | ||
|
|
53d6b91fc8 | ||
|
|
6c081427c4 | ||
|
|
44cf61d241 | ||
|
|
b8e7669228 | ||
|
|
51c0c934d3 | ||
|
|
46f54e6b94 | ||
|
|
0ee1a75d16 | ||
|
|
c9d5c7d30a | ||
|
|
342d5a4250 | ||
|
|
19b566e6ea | ||
|
|
d74f8d6dd9 | ||
|
|
035352feff | ||
|
|
a04c45a2b6 | ||
|
|
6ed193277d | ||
|
|
960342eb38 | ||
|
|
008e694732 | ||
|
|
4d264b5b9c | ||
|
|
b45f575ffe | ||
|
|
f535497d90 | ||
|
|
70fb98f777 | ||
|
|
514fdc7610 | ||
|
|
605cd265c0 | ||
|
|
6d0bab5d59 | ||
|
|
1d788203df | ||
|
|
1ac9c21956 | ||
|
|
298d56aab2 | ||
|
|
d8dc0b6333 | ||
|
|
30f2bdff5b | ||
|
|
685abf109b | ||
|
|
e4057e0c81 | ||
|
|
57ccbe08ea | ||
|
|
bac65ea8c5 | ||
|
|
49a3f543f3 | ||
|
|
3b2d68d333 | ||
|
|
2b73696d03 | ||
|
|
d5dd423bfd | ||
|
|
42cc2445a5 | ||
|
|
f67f771a45 | ||
|
|
655ffd45be | ||
|
|
0d89b77dae | ||
|
|
341407ef2a | ||
|
|
1d55558956 | ||
|
|
46b2ab8e88 | ||
|
|
823a84fec9 | ||
|
|
1ec64f568d | ||
|
|
f6f0d39b81 | ||
|
|
94647af1f4 | ||
|
|
894b356619 | ||
|
|
f61ba8abf7 | ||
|
|
ccd5c9e106 | ||
|
|
4e09375531 | ||
|
|
9315cdb473 | ||
|
|
40e3a04704 | ||
|
|
87825e1e14 | ||
|
|
46dd5cf5a2 | ||
|
|
adc6a491b9 | ||
|
|
6f794ae320 | ||
|
|
27366f2e30 | ||
|
|
8257f0abd9 | ||
|
|
f922e8994a | ||
|
|
b97d9b688e | ||
|
|
5e302d7ec6 | ||
|
|
b122148acf | ||
|
|
1e74c7a547 | ||
|
|
8144e7620f | ||
|
|
bb307bf6c1 | ||
|
|
f210cafdf2 | ||
|
|
519c3eb51f | ||
|
|
1cf5c8abd7 | ||
|
|
7635d08ecf | ||
|
|
fc0d440201 | ||
|
|
e470cae6da | ||
|
|
1ef7653fed | ||
|
|
66c4ff8800 | ||
|
|
64d1a81968 | ||
|
|
61b17d3dc8 | ||
|
|
1efb1d7a58 | ||
|
|
4907b4c9f2 | ||
|
|
1bc8a83774 | ||
|
|
b0c3e3fa47 | ||
|
|
1430b6901d | ||
|
|
9880cea627 | ||
|
|
42b68261da | ||
|
|
b1a6b21dad | ||
|
|
b35a2dd66d | ||
|
|
6f000c3807 | ||
|
|
499339548d | ||
|
|
cd1d7afd59 | ||
|
|
f17d0076e0 | ||
|
|
0daf1f5514 | ||
|
|
5e212648f6 | ||
|
|
129a0b6b7d | ||
|
|
a42d0ad9e9 | ||
|
|
ec105b3e54 | ||
|
|
4528772e20 | ||
|
|
5457fa16f6 | ||
|
|
a473b45e35 | ||
|
|
41c3dd4cde | ||
|
|
071e775a55 | ||
|
|
cb6e2574ce | ||
|
|
413783c4e8 | ||
|
|
daf638b600 | ||
|
|
a449512912 | ||
|
|
41e2994868 | ||
|
|
51f79a4387 | ||
|
|
6422477c5e | ||
|
|
19a8473023 | ||
|
|
e801d55ddf | ||
|
|
ade2847301 | ||
|
|
7040448b75 | ||
|
|
eb4e9dd347 | ||
|
|
d5b26c94d2 | ||
|
|
eadba642ce | ||
|
|
387c40f667 | ||
|
|
2bd3815b42 | ||
|
|
df2a92cb39 | ||
|
|
a224491d20 | ||
|
|
7861f12727 | ||
|
|
6ee728efcb | ||
|
|
ba9a28474f | ||
|
|
6c9200252a | ||
|
|
4b471fe9fb | ||
|
|
d576d7bfae | ||
|
|
4effe25cc1 | ||
|
|
4c65772c44 | ||
|
|
764a2c1b39 | ||
|
|
487631e935 | ||
|
|
e823ac5180 | ||
|
|
f80321ecac | ||
|
|
06ab708edf | ||
|
|
9347e90a67 | ||
|
|
4aadfe9fd7 | ||
|
|
bbd2a2b7f1 | ||
|
|
33255e3ac3 | ||
|
|
0920d2b48a | ||
|
|
a30068bf3f | ||
|
|
a1a4b3937a | ||
|
|
f2aa15555b | ||
|
|
afa89d68f8 | ||
|
|
6aae64c985 | ||
|
|
9474c370dc | ||
|
|
a04df2f440 | ||
|
|
d213981a24 | ||
|
|
7cdc8394aa | ||
|
|
f16c5d0e65 | ||
|
|
1ab0ed3664 | ||
|
|
0f90fe67d2 | ||
|
|
4a70382d5b | ||
|
|
bdaa0c3b5b | ||
|
|
9be387ef6f | ||
|
|
f60d3a8dbc | ||
|
|
9234fa7510 | ||
|
|
7a4817e55a | ||
|
|
f0e9b378f6 | ||
|
|
da4a664290 | ||
|
|
9fc4a85806 | ||
|
|
59d1a122c6 | ||
|
|
0f2df6c7b3 | ||
|
|
c7d4386b63 | ||
|
|
54fcc97725 | ||
|
|
5f97f928de | ||
|
|
c27c669796 | ||
|
|
c6564d352b | ||
|
|
87d0f03f5c | ||
|
|
7695ba6eb4 | ||
|
|
01d48320fd | ||
|
|
22d9312eaf | ||
|
|
da35e134f1 | ||
|
|
09f9f193d8 | ||
|
|
0c172f6463 | ||
|
|
4ce50e3936 | ||
|
|
007b7d45dc | ||
|
|
9b60df8883 | ||
|
|
84b7d9b3ac | ||
|
|
b5e459430b | ||
|
|
d2c754c0fe | ||
|
|
8786163f35 | ||
|
|
e1fe161071 | ||
|
|
e873934d60 | ||
|
|
f542d817b0 | ||
|
|
4cb6b249f1 | ||
|
|
27d617a319 | ||
|
|
aeecbd741f | ||
|
|
b06af5a44f | ||
|
|
62669d9229 | ||
|
|
0a2c8bb26a | ||
|
|
bbb76a39a2 | ||
|
|
2736be44c5 | ||
|
|
848b1358a1 | ||
|
|
526ded00e9 | ||
|
|
983cd60a8d | ||
|
|
a54cedbb72 | ||
|
|
bd0cdcd4cb | ||
|
|
c795acd09f | ||
|
|
46c08e5dc1 | ||
|
|
4618a2a8b5 | ||
|
|
c28a17d71f | ||
|
|
a81bc9773f | ||
|
|
68892ab693 | ||
|
|
c0dec091a2 | ||
|
|
36dc8c2169 | ||
|
|
af47b3c1a7 | ||
|
|
0c73a6ded9 | ||
|
|
4b32bd2b13 | ||
|
|
f79f9d60a9 | ||
|
|
ac9a72482d | ||
|
|
b9859489b0 | ||
|
|
5930bbfac1 | ||
|
|
4883a24363 | ||
|
|
97efa0f0ce | ||
|
|
329878c45f | ||
|
|
bb1bd671b7 | ||
|
|
c006979160 | ||
|
|
a882c88081 | ||
|
|
3014444b0e | ||
|
|
ebe46f1ddc | ||
|
|
417b5a3b2e | ||
|
|
e33574b391 | ||
|
|
204e3074c9 | ||
|
|
285aa54445 | ||
|
|
ceace852b0 | ||
|
|
15e7c30cc7 | ||
|
|
64e4984ff5 | ||
|
|
5f8ae36380 | ||
|
|
7b63c8d201 | ||
|
|
0a04932020 | ||
|
|
f89fbbe9e6 | ||
|
|
e3c71ea407 | ||
|
|
1a203a0598 | ||
|
|
92168954d2 | ||
|
|
e92a46e156 | ||
|
|
2ea3bc53d3 | ||
|
|
c206df3401 | ||
|
|
d4c1d97cb3 | ||
|
|
4948b5a3b3 | ||
|
|
64d5e3dfd3 | ||
|
|
79f8210fff | ||
|
|
52eb60e171 | ||
|
|
8c9ebd2674 | ||
|
|
1768bcc489 | ||
|
|
86e4fa9a35 | ||
|
|
b086a3b423 | ||
|
|
1c59be1494 | ||
|
|
c759771dc7 | ||
|
|
238341ac8a | ||
|
|
21847980e3 | ||
|
|
b4ca9a56fe | ||
|
|
3403a76ec8 | ||
|
|
61e549d317 | ||
|
|
2240d52338 | ||
|
|
3acf4beb81 | ||
|
|
0f8a3b2971 | ||
|
|
d2fd910828 | ||
|
|
a068bfb8ee | ||
|
|
a3577d953d | ||
|
|
40a5e5c60c | ||
|
|
9e57eb1858 | ||
|
|
0f50dd1bb7 | ||
|
|
a93c3eadd1 | ||
|
|
9e0ed00a59 | ||
|
|
a1835c0a31 | ||
|
|
c49d1fc1bd | ||
|
|
3129372d12 | ||
|
|
faf06d1969 | ||
|
|
d912f3a456 | ||
|
|
9520d9bbf9 | ||
|
|
b29ce257c3 | ||
|
|
78acdc72e2 | ||
|
|
678d494d90 | ||
|
|
eb341514a7 | ||
|
|
e8617cf7cd | ||
|
|
ea84ac9b04 | ||
|
|
06ee9bcff4 | ||
|
|
ce3ea138ce | ||
|
|
85685a8981 | ||
|
|
13912482ad | ||
|
|
3213ea70e5 | ||
|
|
24da7f8883 | ||
|
|
c86fba6fb3 | ||
|
|
ff3df203c4 | ||
|
|
71d510a79c | ||
|
|
46bdaa49dc | ||
|
|
8b880cb993 | ||
|
|
ada7c4f441 | ||
|
|
47416169c3 | ||
|
|
8bfb9e51f3 | ||
|
|
b3c6714b12 | ||
|
|
37cc45239d | ||
|
|
456007aab7 | ||
|
|
b8b5cb47ec | ||
|
|
d8bb9ae77b | ||
|
|
26782e246b | ||
|
|
664206608d | ||
|
|
90e83e0636 | ||
|
|
09b9db259c | ||
|
|
a416802a89 | ||
|
|
03f57a898b | ||
|
|
ff91463c43 | ||
|
|
e130a0841f | ||
|
|
55edf76590 | ||
|
|
7b80cb78bd | ||
|
|
6262a59be8 | ||
|
|
1bc9e0ed63 | ||
|
|
b80a0cb5ce | ||
|
|
301fe59dc6 | ||
|
|
1853f6a210 | ||
|
|
0654e2f65e | ||
|
|
059d7d2997 | ||
|
|
81c88d6833 | ||
|
|
11d2d78cd9 | ||
|
|
3954cb4dd4 | ||
|
|
25cf188caa | ||
|
|
de8f67c4a2 | ||
|
|
7e21d2a98f | ||
|
|
928faed7c7 | ||
|
|
67904e849d | ||
|
|
377d212ecc | ||
|
|
f274179d9b | ||
|
|
b0c730d278 | ||
|
|
f66f791668 | ||
|
|
14e9ec2bbb | ||
|
|
39a4dc6fb7 | ||
|
|
c16a2f4d6a | ||
|
|
390fc11239 | ||
|
|
cddea273a9 | ||
|
|
38d2445430 | ||
|
|
c0f0efc1cd | ||
|
|
f2c428bedc | ||
|
|
9b889217fa | ||
|
|
c6a85ff359 | ||
|
|
b638c94625 | ||
|
|
8e81dd69ec | ||
|
|
0114c51c6e | ||
|
|
ac704b9763 | ||
|
|
ae228705b2 | ||
|
|
aa1b565228 | ||
|
|
0618ae8a2e | ||
|
|
dafb25cbfe | ||
|
|
43873bb881 | ||
|
|
c6790bd8c9 | ||
|
|
61567f430e | ||
|
|
2a2326aea3 | ||
|
|
e3cfe13ef5 | ||
|
|
0e155adef6 | ||
|
|
1367123d5b | ||
|
|
d51c1c471a | ||
|
|
268f8f41ed | ||
|
|
b7d4f92764 | ||
|
|
d4cf0dbb0c | ||
|
|
91b348966e | ||
|
|
502be39e9b | ||
|
|
43f4be7752 | ||
|
|
7665488e39 | ||
|
|
455e12a1a4 | ||
|
|
87a1a1426f | ||
|
|
9d3a5be579 | ||
|
|
b2eb00b902 | ||
|
|
cd633ea188 | ||
|
|
579733dbb5 | ||
|
|
fa1eb68941 | ||
|
|
e4a3712f30 | ||
|
|
7728d7bb86 | ||
|
|
d67cd63723 | ||
|
|
3fbca47b1a | ||
|
|
f5f8548eb8 | ||
|
|
6245ddb14d | ||
|
|
d14600152f | ||
|
|
9c1a897d60 | ||
|
|
58a74a166d | ||
|
|
cfb4a848b4 | ||
|
|
b2e6211f2f | ||
|
|
9f93b2595d | ||
|
|
14cccbfdc2 | ||
|
|
98b5ca3850 | ||
|
|
70ed98fadd | ||
|
|
279d24a8f5 | ||
|
|
7542ab51b7 | ||
|
|
64ad293b89 | ||
|
|
03a7e22b7e | ||
|
|
b6a0b9e548 | ||
|
|
9e67c0a9b7 | ||
|
|
107c95cf5f | ||
|
|
04ff228660 | ||
|
|
8537e36936 | ||
|
|
7bffb39244 | ||
|
|
0fd3c2d64c | ||
|
|
3c7c645505 | ||
|
|
d1c08d85d2 | ||
|
|
f05e3f340e | ||
|
|
e9ecb93dec | ||
|
|
fa4d327ddb | ||
|
|
18126d0ebd | ||
|
|
8d7e329a6e | ||
|
|
391960b55f | ||
|
|
5d66a12ed4 | ||
|
|
05d753f4e0 | ||
|
|
32c5ac35dd | ||
|
|
a47b913273 | ||
|
|
d929242e2b | ||
|
|
3aa80b7d04 | ||
|
|
3b93625a8f | ||
|
|
7897a1842c | ||
|
|
551f8b751f | ||
|
|
d387fd0baa | ||
|
|
f0b8db0d72 | ||
|
|
b440d478ea | ||
|
|
65e7605342 | ||
|
|
2bd0d062e1 | ||
|
|
d38d90f278 | ||
|
|
5e6aef6138 | ||
|
|
84f9bcdd42 | ||
|
|
40928364d4 | ||
|
|
22f5b19884 | ||
|
|
bc1ea4b602 | ||
|
|
c9e027fd9a | ||
|
|
4d648c8558 | ||
|
|
db9865ebb6 | ||
|
|
e4aa45b03f | ||
|
|
4cb7079601 | ||
|
|
abd8fef19b | ||
|
|
4c8c59dfcb | ||
|
|
3ba1128ac5 | ||
|
|
13bea15bbe | ||
|
|
2f790b993d | ||
|
|
5fa5c54c1e | ||
|
|
44b20ab8a1 | ||
|
|
bbdbcefbbb | ||
|
|
8d8021e0ac | ||
|
|
769331d8c2 | ||
|
|
99b9c8486c | ||
|
|
150862ee96 | ||
|
|
e191109549 | ||
|
|
c85a3aafbe | ||
|
|
fd0e99ceac | ||
|
|
29a5a3c303 | ||
|
|
b8f5b9f63e | ||
|
|
05d99a9c96 | ||
|
|
2e5e6ace3d | ||
|
|
f57899fdb8 | ||
|
|
d35d6a8cd4 | ||
|
|
adadc2eeab | ||
|
|
3b5f91adc3 | ||
|
|
b237b1f93c | ||
|
|
5aed7c5467 | ||
|
|
db241c4f91 | ||
|
|
a040af37c0 | ||
|
|
0e89a37eaf | ||
|
|
246e65914f | ||
|
|
d603b38ef0 | ||
|
|
3373eb6525 | ||
|
|
3950408e39 | ||
|
|
2d0c572d29 | ||
|
|
48c44e158d | ||
|
|
b0797c3035 | ||
|
|
38bc4f55e4 | ||
|
|
9366a90d38 | ||
|
|
8cf68c5216 | ||
|
|
fd121e2a5e | ||
|
|
ac463bb397 | ||
|
|
011152e5e0 | ||
|
|
71e04760c9 | ||
|
|
bffd34bfbf | ||
|
|
d47ae6ce95 | ||
|
|
130cc229e2 | ||
|
|
99c71d3cc6 | ||
|
|
6d27a1c660 | ||
|
|
1671c98975 | ||
|
|
53c1107eaa | ||
|
|
ac3348b9a6 | ||
|
|
6ea6f79b69 | ||
|
|
d18769aff0 | ||
|
|
aa284d90cc | ||
|
|
b4deb79392 | ||
|
|
53bb262fed | ||
|
|
49e3180607 | ||
|
|
7df8f50248 | ||
|
|
b0d6988c1d | ||
|
|
75b55ff4f2 | ||
|
|
7886fdb166 | ||
|
|
6e37d16907 | ||
|
|
5058382d5a | ||
|
|
bbefef20cd | ||
|
|
27535e2b3c | ||
|
|
65a1fc4120 | ||
|
|
7ae4973788 | ||
|
|
a452d0cb29 | ||
|
|
b1b409433c | ||
|
|
7f6d29af5d | ||
|
|
198103ce7a | ||
|
|
8234c01d58 | ||
|
|
e32daaedb4 | ||
|
|
a820f8d9c8 | ||
|
|
6e76f85b52 | ||
|
|
2814838406 | ||
|
|
def633060d | ||
|
|
1d58938f4b | ||
|
|
f89c180188 | ||
|
|
36591f5d28 | ||
|
|
99aabaaf16 | ||
|
|
4d805e29bc | ||
|
|
183ea08de6 | ||
|
|
6e93dbbbd1 | ||
|
|
932d6641bc | ||
|
|
9dc273ca50 | ||
|
|
39ac364b2c | ||
|
|
c6dde4af51 | ||
|
|
6fbd965509 | ||
|
|
bfee5c5b59 | ||
|
|
1d1ffdff9b | ||
|
|
00d753612c | ||
|
|
eb5be62cba | ||
|
|
98a64c8783 | ||
|
|
cc390d1a80 | ||
|
|
0deae96a75 | ||
|
|
0b32252506 | ||
|
|
5d126350d6 | ||
|
|
8592aed284 | ||
|
|
6c4a1bf00e | ||
|
|
5fc48ffcb9 | ||
|
|
e898b6e8bd | ||
|
|
6cd393c8ef | ||
|
|
b1868983c7 | ||
|
|
9daebe8dd2 | ||
|
|
b70ee10198 | ||
|
|
aad54c9a87 | ||
|
|
38b64faeb2 | ||
|
|
ce77fe6488 | ||
|
|
a13102f039 | ||
|
|
ea5e3d56f5 | ||
|
|
74fb4aca16 | ||
|
|
a4ba8246d7 | ||
|
|
d7ff4234f0 | ||
|
|
e940dd1be4 | ||
|
|
29da9024ca | ||
|
|
8507cda6dd | ||
|
|
805ab6b7f8 | ||
|
|
1eb626b1df | ||
|
|
3b60237cb1 | ||
|
|
e0b8539670 |
@@ -1,29 +1,33 @@
|
||||
engines:
|
||||
rubocop: { enabled: true }
|
||||
fixme: { enabled: false }
|
||||
fixme:
|
||||
enabled: false
|
||||
rubocop:
|
||||
enabled: true
|
||||
|
||||
exclude_paths:
|
||||
- .rubocop.yml
|
||||
- .codeclimate.yml
|
||||
- .travis.yml
|
||||
- .gitignore
|
||||
- .rspec
|
||||
- .codeclimate.yml
|
||||
- .gitignore
|
||||
- .rspec
|
||||
- .rubocop.yml
|
||||
- .travis.yml
|
||||
|
||||
- Gemfile.lock
|
||||
- CHANGELOG.{md,markdown,txt,textile}
|
||||
- CONTRIBUTING.{md,markdown,txt,textile}
|
||||
- readme.{md,markdown,txt,textile}
|
||||
- README.{md,markdown,txt,textile}
|
||||
- Readme.{md,markdown,txt,textile}
|
||||
- ReadMe.{md,markdown,txt,textile}
|
||||
- COPYING
|
||||
- LICENSE
|
||||
- Gemfile.lock
|
||||
- CHANGELOG.{md,markdown,txt,textile}
|
||||
- CONTRIBUTING.{md,markdown,txt,textile}
|
||||
- readme.{md,markdown,txt,textile}
|
||||
- README.{md,markdown,txt,textile}
|
||||
- Readme.{md,markdown,txt,textile}
|
||||
- ReadMe.{md,markdown,txt,textile}
|
||||
- COPYING
|
||||
- LICENSE
|
||||
|
||||
- features/**/*
|
||||
- script/**/*
|
||||
- site/**/*
|
||||
- spec/**/*
|
||||
- test/**/*
|
||||
- vendor/**/*
|
||||
|
||||
- site/**/*
|
||||
- test/**/*
|
||||
- vendor/**/*
|
||||
- features/**/*
|
||||
- script/**/*
|
||||
- spec/**/*
|
||||
ratings:
|
||||
paths:
|
||||
- lib/**/*.rb
|
||||
- lib/**/*.rb
|
||||
|
||||
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
122
.github/CONTRIBUTING.markdown
vendored
Normal file
122
.github/CONTRIBUTING.markdown
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
# Contributing to Jekyll
|
||||
|
||||
Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is an open source project, built one contribution at a time by users like you.
|
||||
|
||||
## Where to get help or report a problem
|
||||
|
||||
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
Whether you're a developer, a designer, or just a Jekyll devotee, there are lots of ways to contribute. Here's a few ideas:
|
||||
|
||||
* [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
|
||||
* Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
|
||||
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
|
||||
* Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
|
||||
* Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
|
||||
* Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
### Pull requests generally
|
||||
|
||||
* The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
|
||||
|
||||
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
|
||||
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
|
||||
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
|
||||
### Submitting a pull request via github.com
|
||||
|
||||
Many small changes can be made entirely through the github.com web interface.
|
||||
|
||||
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit.
|
||||
2. Click the pencil icon in the top right corner to edit the file
|
||||
3. Make your proposed changes
|
||||
4. Click "Propose file change"
|
||||
5. Click "Create pull request"
|
||||
6. Add a descriptive title and detailed description for your proposed change. The more information the better.
|
||||
7. Click "Create pull request"
|
||||
|
||||
That's it! You'll be automatically subscribed to receive updates as others review your proposed change and provide feedback.
|
||||
|
||||
### Submitting a pull request via Git command line
|
||||
|
||||
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
|
||||
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
|
||||
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
|
||||
4. Hack away, add tests. Not necessarily in that order.
|
||||
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
|
||||
6. Push the branch up ( `git push origin my-awesome-feature` ).
|
||||
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
|
||||
|
||||
## Proposing updates to the documentation
|
||||
|
||||
We want the Jekyll documentation to be the best it can be. We've open-sourced our docs and we welcome any pull requests if you find it lacking.
|
||||
|
||||
### How to submit changes
|
||||
|
||||
You can find the documentation for jekyllrb.com in the [site](https://github.com/jekyll/jekyll/tree/master/site) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
|
||||
|
||||
One gotcha, all pull requests should be directed at the `master` branch (the default branch).
|
||||
|
||||
### Adding plugins
|
||||
|
||||
If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type.
|
||||
|
||||
## Code Contributions
|
||||
|
||||
Interesting in submitting a pull request? Awesome. Read on. There's a few common gotchas that we'd love to help you avoid.
|
||||
|
||||
### Tests and documentation
|
||||
|
||||
Any time you propose a code change, you should also include updates to the documentation and tests within the same pull request.
|
||||
|
||||
#### Documentation
|
||||
|
||||
If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `site/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated.
|
||||
|
||||
#### Tests
|
||||
|
||||
* If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
|
||||
* If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.
|
||||
|
||||
### Code contributions generally
|
||||
|
||||
* Jekyll uses the [Rubocop](https://github.com/bbatsov/rubocop) static analyzer to ensure that contributions follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby). Please check your code using `script/fmt` and resolve any errors before pushing your branch.
|
||||
|
||||
* Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
|
||||
|
||||
## Running tests locally
|
||||
|
||||
### Test Dependencies
|
||||
|
||||
To run the test suite and build the gem you'll need to install Jekyll's dependencies by running the following command:
|
||||
|
||||
<pre class="highlight"><code>$ script/bootstrap</code></pre>
|
||||
|
||||
Before you make any changes, run the tests and make sure that they pass (to confirm your environment is configured properly):
|
||||
|
||||
<pre class="highlight"><code>$ script/cibuild</code></pre>
|
||||
|
||||
If you are only updating a file in `test/`, you can use the command:
|
||||
|
||||
<pre class="highlight"><code>$ script/test test/blah_test.rb</code></pre>
|
||||
|
||||
If you are only updating a `.feature` file, you can use the command:
|
||||
|
||||
<pre class="highlight"><code>$ script/cucumber features/blah.feature</code></pre>
|
||||
|
||||
Both `script/test` and `script/cucumber` can be run without arguments to
|
||||
run its entire respective suite.
|
||||
|
||||
## A thank you
|
||||
|
||||
Thanks! Hacking on Jekyll should be fun. If you find any of this hard to figure out, let us know so we can improve our process or documentation!
|
||||
82
.github/ISSUE_TEMPLATE.md
vendored
Normal file
82
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<!--
|
||||
Hi! Thanks for considering to file a bug with Jekyll. Please take the time to
|
||||
answer the basic questions. You can convert `[ ]` into `[x]` to check boxes (or submit
|
||||
and check.) If there is no need for certain fields like output and redirection, please delete
|
||||
those headers before submitting. We know not all tickets require those steps.
|
||||
Otherwise, please try to be as detailed as possible.
|
||||
|
||||
If you are unsure this is a bug in Jekyll, or this is a bug caused
|
||||
by a plugin that isn't directly related to Jekyll, or if this is just
|
||||
a generic usage question, please consider asking your question at
|
||||
https://talk.jekyllrb.com where non-bug questions go.
|
||||
|
||||
Please make sure to mention an affinity team whose responsibilities
|
||||
most closely align with your issue.
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
|
||||
- [ ] I believe this to be a bug, not a question about using Jekyll.
|
||||
- [ ] I updated to the latest Jekyll (or) if on GitHub Pages to the latest `github-pages`
|
||||
- [ ] I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
|
||||
- [ ] This is a feature request.
|
||||
|
||||
---
|
||||
|
||||
- [ ] I am on (or have tested on) ***macOS*** 10+
|
||||
- [ ] I am on (or have tested on) ***Debian/Ubuntu*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Fedora*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Arch*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Other*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Windows*** 10+
|
||||
|
||||
<!--
|
||||
Other GNU/Linux includes Scientific GNU/Linux, CentOS GNU/Linux, and others.
|
||||
If you are on a minor sub-distro (such as ElementaryOS which does not diverge from
|
||||
Ubuntu much, please check the parent distro. Kubuntu, Edubuntu, Lubuntu should
|
||||
also be flagged as Ubuntu as their packages come from upstream Ubuntu.
|
||||
-->
|
||||
|
||||
---
|
||||
|
||||
- [ ] I was trying to install.
|
||||
- [ ] There is a broken Plugin API.
|
||||
- [ ] I had an error on GitHub Pages, and I have reproduced it locally.
|
||||
- [ ] I had an error on GitHub Pages, and GitHub Support said it was a Jekyll Bug.
|
||||
- [ ] I had an error on GitHub Pages and I did not test it locally.
|
||||
- [ ] I was trying to build.
|
||||
- [ ] It was another bug.
|
||||
|
||||
## My Reproduction Steps
|
||||
|
||||
<!--
|
||||
If this error occured on GitHub Pages, please try to provide us with logs,
|
||||
and look at them yourself, to determine if this is an actual Jekyll bug. In
|
||||
the event you are unsure, file a ticket, however, when you do please provide
|
||||
the logs (strip them of personal information.)
|
||||
|
||||
If you have trouble finding your logs, please email support@github.com and
|
||||
they will happily help you. If you cannot find logs, please try your best to
|
||||
replicate it locally because we cannot fix a problem if we do not know
|
||||
exactly what caused it, or within a relatively close distance.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Insert the steps you took to for this problem to exist. Such as the
|
||||
directories you created and, the full command you ran, and include any
|
||||
plugins you have installed, this is very important.
|
||||
|
||||
If your steps are complicated, you can also submit a GitHub
|
||||
repository (please no zips, they will be removed and rejected by maintainers,)
|
||||
and just supply a command for us to reproduce it ourselves.
|
||||
-->
|
||||
|
||||
## The Output I Wanted
|
||||
|
||||
<!--
|
||||
Insert the output from the command. Alter it as little as you can.
|
||||
The minimum should be personal information. Though we normally don't log
|
||||
anything like that so there should be no need to alter it.
|
||||
-->
|
||||
|
||||
/cc include any Jekyll affinity teams here (see https://teams.jekyllrb.com/ for more info)
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,6 +13,7 @@
|
||||
/vendor
|
||||
Gemfile.lock
|
||||
_site/
|
||||
bin/
|
||||
bbin/
|
||||
coverage
|
||||
gh-pages/
|
||||
|
||||
205
.rubocop.yml
205
.rubocop.yml
@@ -1,80 +1,133 @@
|
||||
Metrics/MethodLength: { Max: 24 }
|
||||
Metrics/ClassLength: { Max: 240 }
|
||||
Metrics/ModuleLength: { Max: 240 }
|
||||
Metrics/LineLength: { Max: 112 }
|
||||
Metrics/CyclomaticComplexity: { Max: 8 }
|
||||
Metrics/PerceivedComplexity: { Max: 8 }
|
||||
Metrics/ParameterLists: { Max: 4 }
|
||||
Metrics/MethodLength: { Max: 24 }
|
||||
Metrics/AbcSize: { Max: 20 }
|
||||
|
||||
Style/IndentHash: { EnforcedStyle: consistent }
|
||||
Style/HashSyntax: { EnforcedStyle: hash_rockets }
|
||||
Style/SignalException: { EnforcedStyle: only_raise }
|
||||
Style/AlignParameters: { EnforcedStyle: with_fixed_indentation }
|
||||
Style/StringLiteralsInInterpolation: { EnforcedStyle: double_quotes }
|
||||
Style/MultilineMethodCallIndentation: { EnforcedStyle: indented }
|
||||
Style/MultilineOperationIndentation: { EnforcedStyle: indented }
|
||||
Style/FirstParameterIndentation: { EnforcedStyle: consistent }
|
||||
Style/StringLiterals: { EnforcedStyle: double_quotes }
|
||||
Style/RegexpLiteral: { EnforcedStyle: slashes }
|
||||
Style/IndentArray: { EnforcedStyle: consistent }
|
||||
Style/ExtraSpacing: { AllowForAlignment: true }
|
||||
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
'%q': '{}'
|
||||
'%Q': '{}'
|
||||
'%r': '!!'
|
||||
'%s': '()'
|
||||
'%w': '()'
|
||||
'%W': '()'
|
||||
'%x': '()'
|
||||
|
||||
Style/AlignArray: { Enabled: false }
|
||||
Style/StringLiterals: { Enabled: false }
|
||||
Style/Documentation: { Enabled: false }
|
||||
Style/DoubleNegation: { Enabled: false }
|
||||
Style/UnneededCapitalW: { Enabled: false }
|
||||
Style/EmptyLinesAroundModuleBody: { Enabled: false }
|
||||
Style/EmptyLinesAroundAccessModifier: { Enabled: false }
|
||||
Style/BracesAroundHashParameters: { Enabled: false }
|
||||
Style/SpaceInsideBrackets: { Enabled: false }
|
||||
Style/IfUnlessModifier: { Enabled: false }
|
||||
Style/ModuleFunction: { Enabled: false }
|
||||
Style/RescueModifier: { Enabled: false }
|
||||
Style/GuardClause: { Enabled: false }
|
||||
Style/FileName: { Enabled: false }
|
||||
Lint/UselessAccessModifier: { Enabled: false }
|
||||
Style/SpaceAroundOperators: { Enabled: false }
|
||||
Style/RedundantReturn: { Enabled: false }
|
||||
Style/SingleLineMethods: { Enabled: false }
|
||||
|
||||
---
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.0
|
||||
Include:
|
||||
- lib/**/*.rb
|
||||
|
||||
- lib/**/*.rb
|
||||
Exclude:
|
||||
- .rubocop.yml
|
||||
- .codeclimate.yml
|
||||
- .travis.yml
|
||||
- .gitignore
|
||||
- .rspec
|
||||
|
||||
- Gemfile.lock
|
||||
- CHANGELOG.{md,markdown,txt,textile}
|
||||
- CONTRIBUTING.{md,markdown,txt,textile}
|
||||
- readme.{md,markdown,txt,textile}
|
||||
- README.{md,markdown,txt,textile}
|
||||
- Readme.{md,markdown,txt,textile}
|
||||
- ReadMe.{md,markdown,txt,textile}
|
||||
- COPYING
|
||||
- LICENSE
|
||||
|
||||
- site/**/*
|
||||
- test/**/*
|
||||
- vendor/**/*
|
||||
- features/**/*
|
||||
- script/**/*
|
||||
- spec/**/*
|
||||
- lib/jekyll/renderer.rb
|
||||
- bin/**/*
|
||||
- exe/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- vendor/**/*
|
||||
Lint/EndAlignment:
|
||||
Severity: error
|
||||
Lint/UnreachableCode:
|
||||
Severity: error
|
||||
Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Max: 21
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
Metrics/ClassLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
Max: 300
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 9
|
||||
Metrics/LineLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
Max: 90
|
||||
Severity: warning
|
||||
Metrics/MethodLength:
|
||||
CountComments: false
|
||||
Max: 20
|
||||
Severity: error
|
||||
Metrics/ModuleLength:
|
||||
Exclude:
|
||||
- lib/jekyll/filters.rb
|
||||
Max: 240
|
||||
Metrics/ParameterLists:
|
||||
Max: 4
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 8
|
||||
Style/Alias:
|
||||
Enabled: false
|
||||
Style/AlignArray:
|
||||
Enabled: false
|
||||
Style/AlignHash:
|
||||
EnforcedHashRocketStyle: table
|
||||
Style/AlignParameters:
|
||||
Enabled: false
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
Style/AndOr:
|
||||
Severity: error
|
||||
Style/Attr:
|
||||
Enabled: false
|
||||
Style/BracesAroundHashParameters:
|
||||
Enabled: false
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
Style/DoubleNegation:
|
||||
Enabled: false
|
||||
Style/EmptyLinesAroundAccessModifier:
|
||||
Enabled: false
|
||||
Style/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
Style/ExtraSpacing:
|
||||
AllowForAlignment: true
|
||||
Style/FileName:
|
||||
Enabled: false
|
||||
Style/FirstParameterIndentation:
|
||||
EnforcedStyle: consistent
|
||||
Style/GuardClause:
|
||||
Enabled: false
|
||||
Style/HashSyntax:
|
||||
EnforcedStyle: hash_rockets
|
||||
Severity: error
|
||||
Style/IfUnlessModifier:
|
||||
Enabled: false
|
||||
Style/IndentArray:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentHash:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentationWidth:
|
||||
Severity: error
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineOperationIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineTernaryOperator:
|
||||
Severity: error
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
"%q": "{}"
|
||||
"%Q": "{}"
|
||||
"%r": "!!"
|
||||
"%s": "()"
|
||||
"%w": "()"
|
||||
"%W": "()"
|
||||
"%x": "()"
|
||||
Style/RedundantReturn:
|
||||
Enabled: false
|
||||
Style/RedundantSelf:
|
||||
Enabled: false
|
||||
Style/RegexpLiteral:
|
||||
EnforcedStyle: percent_r
|
||||
Style/RescueModifier:
|
||||
Enabled: false
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
Style/SingleLineMethods:
|
||||
Enabled: false
|
||||
Style/SpaceAroundOperators:
|
||||
Enabled: false
|
||||
Style/SpaceInsideBrackets:
|
||||
Enabled: false
|
||||
Style/StringLiterals:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/StringLiteralsInInterpolation:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/UnneededCapitalW:
|
||||
Enabled: false
|
||||
|
||||
32
.travis.yml
32
.travis.yml
@@ -1,4 +1,3 @@
|
||||
before_script: bundle update
|
||||
bundler_args: --without benchmark:site:development
|
||||
script: script/cibuild
|
||||
cache: bundler
|
||||
@@ -6,36 +5,31 @@ language: ruby
|
||||
sudo: false
|
||||
|
||||
rvm:
|
||||
- &ruby1 2.3.0
|
||||
- &ruby2 2.2.4
|
||||
- &ruby3 2.1.8
|
||||
- &ruby4 2.0.0-p648
|
||||
- &jruby jruby-9.0.4.0
|
||||
- &rhead ruby-head
|
||||
- &ruby1 2.3.1
|
||||
- &ruby2 2.2.5
|
||||
- &ruby3 2.1.9
|
||||
- &jruby jruby-9.1.2.0
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
include:
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=fmt
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=default-site
|
||||
exclude:
|
||||
- rvm: *jruby
|
||||
- rvm: *rhead
|
||||
env: TEST_SUITE=cucumber
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- TEST_SUITE=test
|
||||
- TEST_SUITE=cucumber
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
template: "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}"
|
||||
channels: irc.freenode.org#jekyll
|
||||
|
||||
email:
|
||||
recipients:
|
||||
- jordon@envygeeks.io
|
||||
|
||||
slack:
|
||||
secure: "\
|
||||
dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4Y\
|
||||
|
||||
49
CONDUCT.markdown
Normal file
49
CONDUCT.markdown
Normal file
@@ -0,0 +1,49 @@
|
||||
# Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all people who
|
||||
contribute through reporting issues, posting feature requests, updating
|
||||
documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to
|
||||
fairly and consistently applying these principles to every aspect of managing
|
||||
this project. Project maintainers who do not follow or enforce the Code of
|
||||
Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by opening an issue or contacting a project maintainer. All complaints
|
||||
will be reviewed and investigated and will result in a response that is deemed
|
||||
necessary and appropriate to the circumstances. Maintainers are obligated to
|
||||
maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.3.0, available at
|
||||
[http://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/3/0/
|
||||
22
CONDUCT.md
22
CONDUCT.md
@@ -1,22 +0,0 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
||||
@@ -1,106 +0,0 @@
|
||||
Contribute
|
||||
==========
|
||||
|
||||
So you've got an awesome idea to throw into Jekyll. Great! Please keep the
|
||||
following in mind:
|
||||
|
||||
* **Use https://talk.jekyllrb.com for non-technical or indirect Jekyll questions that are not bugs.**
|
||||
* **Contributions will not be accepted without tests or necessary documentation updates.**
|
||||
* If you're creating a small fix or patch to an existing feature, just a simple
|
||||
test will do. Please stay in the confines of the current test suite and use
|
||||
[Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and
|
||||
[RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
* If it's a brand new feature, make sure to create a new
|
||||
[Cucumber](https://github.com/cucumber/cucumber/) feature and reuse steps
|
||||
where appropriate. Also, whipping up some documentation in your fork's `site`
|
||||
would be appreciated, and once merged it will be transferred over to the main
|
||||
`site`, jekyllrb.com.
|
||||
* If your contribution changes any Jekyll behavior, make sure to update the
|
||||
documentation. It lives in `site/_docs`. If the docs are missing information,
|
||||
please feel free to add it in. Great docs make a great project!
|
||||
* Please follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby)
|
||||
when modifying Ruby code.
|
||||
* Please do your best to submit **small pull requests**. The easier the proposed
|
||||
change is to review, the more likely it will be merged.
|
||||
* When submitting a pull request, please make judicious use of the pull request
|
||||
body. A description of what changes were made, the motivations behind the
|
||||
changes and [any tasks completed or left to complete](http://git.io/gfm-tasks)
|
||||
will also speed up review time.
|
||||
|
||||
Test Dependencies
|
||||
-----------------
|
||||
|
||||
To run the test suite and build the gem you'll need to install Jekyll's
|
||||
dependencies. Simply run this command to get all setup:
|
||||
|
||||
$ script/bootstrap
|
||||
|
||||
Before you start, run the tests and make sure that they pass (to confirm your
|
||||
environment is configured properly):
|
||||
|
||||
$ script/cibuild
|
||||
|
||||
If you are only updating a file in `test/`, you can use the command:
|
||||
|
||||
$ script/test test/blah_test.rb
|
||||
|
||||
If you are only updating a `.feature` file, you can use the command:
|
||||
|
||||
$ script/cucumber features/blah.feature
|
||||
|
||||
Both `script/test` and `script/cucumber` can be run without arguments to
|
||||
run its entire respective suite.
|
||||
|
||||
Workflow
|
||||
--------
|
||||
|
||||
Here's the most direct way to get your work merged into the project:
|
||||
|
||||
* Fork the project.
|
||||
* Clone down your fork ( `git clone git@github.com:[username]/jekyll.git` ).
|
||||
* Create a topic branch to contain your change ( `git checkout -b my_awesome_feature` ).
|
||||
* Hack away, add tests. Not necessarily in that order.
|
||||
* Make sure everything still passes by running `script/cibuild`.
|
||||
* If necessary, rebase your commits into logical chunks, without errors.
|
||||
* Push the branch up ( `git push origin my_awesome_feature` ).
|
||||
* Create a pull request against jekyll/jekyll and describe what your change
|
||||
does and the why you think it should be merged.
|
||||
|
||||
Updating Documentation
|
||||
----------------------
|
||||
|
||||
We want the Jekyll documentation to be the best it can be. We've
|
||||
open-sourced our docs and we welcome any pull requests if you find it
|
||||
lacking.
|
||||
|
||||
You can find the documentation for jekyllrb.com in the
|
||||
[site](https://github.com/jekyll/jekyll/tree/master/site) directory of
|
||||
Jekyll's repo on GitHub.com.
|
||||
|
||||
All documentation pull requests should be directed at `master`. Pull
|
||||
requests directed at another branch will not be accepted.
|
||||
|
||||
The [Jekyll wiki](https://github.com/jekyll/jekyll/wiki) on GitHub
|
||||
can be freely updated without a pull request as all GitHub users have access.
|
||||
|
||||
If you want to add your plugin to the
|
||||
[list of plugins](http://jekyllrb.com/docs/plugins/#available-plugins),
|
||||
please submit a pull request modifying the
|
||||
[plugins page source file](site/_docs/plugins.md) by adding a
|
||||
link to your plugin under the proper subheading depending upon its type.
|
||||
|
||||
Gotchas
|
||||
-------
|
||||
|
||||
* Please do not bump the gem version in your pull requests.
|
||||
* Try to keep your patch(es) based from the latest commit on jekyll/jekyll.
|
||||
The easier it is to apply your work, the less work the maintainers have to do,
|
||||
which is always a good thing.
|
||||
* Please don't tag your GitHub issue with [fix], [feature], etc. The maintainers
|
||||
actively read the issues and will label it once they come across it.
|
||||
|
||||
Finally...
|
||||
----------
|
||||
|
||||
Thanks! Hacking on Jekyll should be fun. If you find any of this hard to figure
|
||||
out, let us know so we can improve our process or documentation!
|
||||
32
Gemfile
32
Gemfile
@@ -1,10 +1,13 @@
|
||||
source "https://rubygems.org"
|
||||
gemspec :name => "jekyll"
|
||||
|
||||
gem "rake", "~> 10.1"
|
||||
gem "rake", "~> 11.0"
|
||||
|
||||
# Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this.
|
||||
gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2'
|
||||
|
||||
group :development do
|
||||
gem "launchy", "~> 2.3"
|
||||
gem "rubocop", :branch => :master, :github => "bbatsov/rubocop"
|
||||
gem "pry"
|
||||
|
||||
unless RUBY_ENGINE == "jruby"
|
||||
@@ -15,13 +18,17 @@ end
|
||||
#
|
||||
|
||||
group :test do
|
||||
gem "cucumber"
|
||||
gem "rubocop", "~> 0.44.1"
|
||||
gem "cucumber", "~> 2.1"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
gem "codeclimate-test-reporter"
|
||||
gem "rspec-mocks"
|
||||
gem "nokogiri"
|
||||
gem "rspec"
|
||||
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
|
||||
|
||||
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
|
||||
end
|
||||
|
||||
#
|
||||
@@ -55,16 +62,17 @@ end
|
||||
group :jekyll_optional_dependencies do
|
||||
gem "toml", "~> 0.1.0"
|
||||
gem "coderay", "~> 1.1.0"
|
||||
gem "jekyll-gist", "~> 1.0"
|
||||
gem "jekyll-feed", "~> 0.1.3"
|
||||
gem "jekyll-coffeescript", "~> 1.0"
|
||||
gem "jekyll-redirect-from", "~> 0.9.1"
|
||||
gem "jekyll-paginate", "~> 1.0"
|
||||
gem "jekyll-docs", :path => '../docs' if Dir.exist?('../docs') && ENV['JEKYLL_VERSION']
|
||||
gem "jekyll-gist"
|
||||
gem "jekyll-feed"
|
||||
gem "jekyll-coffeescript"
|
||||
gem "jekyll-redirect-from"
|
||||
gem "jekyll-paginate"
|
||||
gem "mime-types", "~> 3.0"
|
||||
gem "kramdown", "~> 1.9"
|
||||
gem "rdoc", "~> 4.2"
|
||||
|
||||
platform :ruby, :mswin, :mingw do
|
||||
platform :ruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "rdiscount", "~> 2.0"
|
||||
gem "pygments.rb", "~> 0.6.0"
|
||||
gem "redcarpet", "~> 3.2", ">= 3.2.3"
|
||||
@@ -79,4 +87,10 @@ group :site do
|
||||
if ENV["PROOF"]
|
||||
gem "html-proofer", "~> 2.0"
|
||||
end
|
||||
|
||||
gem "jemoji", "0.5.1"
|
||||
gem "jekyll-sitemap"
|
||||
gem "jekyll-seo-tag"
|
||||
gem "jekyll-avatar"
|
||||
gem "jekyll-mentions"
|
||||
end
|
||||
|
||||
458
History.markdown
458
History.markdown
@@ -1,3 +1,438 @@
|
||||
## HEAD
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Documentation: {% link %} tag (#5449)
|
||||
* Updating install instruction link for Jekyll 3 on Windows (#5475)
|
||||
* Update normalize.css to v5.0.0 (#5471)
|
||||
* Add jekyll-data to the list of plugins (#5491)
|
||||
* Add info about checking version + updating (#5497)
|
||||
* Add jekyll-include-absolute-plugin to list of third-party plugins (#5492)
|
||||
* Remove jekyll-hook from deployment methods (#5502)
|
||||
* Update deployment-methods.md (#5504)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix typo in theme_template README (#5472)
|
||||
* Do not swallow all exceptions on render (#5495)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* fix rubocop errors on testing with Rubocop 0.44 (#5489)
|
||||
* script/test: add missing whitespace (#5479)
|
||||
* Restrict Rubocop version (#5496)
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Collapse `gsub` (#5494)
|
||||
|
||||
## 3.3.0 / 2016-10-06
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Colorize interpolated output in logger.info (#5239)
|
||||
* Site template: exclude Gemfile and Gemfile.lock in site config (#5293)
|
||||
* Fix #5233: Increase our ability to detect Windows. (#5235)
|
||||
* update gitignore template to ignore theme gems built by user (#5326)
|
||||
* Adds ability to link to all files (#5199)
|
||||
* Exclude vendor by default (#5361)
|
||||
* Add ThemeAssetsReader which reads assets from a theme (#5364)
|
||||
* Add bundle install to jekyll new command (#5237)
|
||||
* Add absolute_url and relative_url filters. (#5399)
|
||||
* Site template: remove `css/` from new site scaffolding (#5402)
|
||||
* Site template: Move contents of the index.html page to the 'home' layout (#5420)
|
||||
* Exclude node_modules by default (#5210)
|
||||
* Run hooks in priority order. (#5157)
|
||||
* Add `static_file.name` and `.basename` Liquid attributes (#5264)
|
||||
* set site.url in dev environment to `http://localhost:4000` (#5431)
|
||||
* Add support for indented link references on excerpt (#5212)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Use jekyll-feed to generate the default site's RSS feed (#5196)
|
||||
* Site#configure_theme: do not set theme unless it's a string (#5189)
|
||||
* Convertible: set self.output in #render_all_layouts and #do_layout (#5337)
|
||||
* Only complain about `kramdown.coderay` if it is actually in the config (#5380)
|
||||
* Clarify documentation in theme gem's README template (#5376)
|
||||
* Allow underscore in highlighter language (#5375)
|
||||
* Site template: set empty url in config file by default (#5338)
|
||||
* Site template config: prepend 'jekyll serve' with 'bundle exec' (#5430)
|
||||
* Don't call `File.utime` for StaticFiles if it's a symlink (#5427)
|
||||
* Fix handling of non-ASCII characters in new `*_url` filters (#5410)
|
||||
* Remove autoload of Draft which no longer exists. (#5441)
|
||||
* Fix issue where Windows drive name is stripped from Jekyll.sanitized_path incorrectly (#5256)
|
||||
* Fix bug where `post_url` tag matched incorrect post with subdirectory (#4873)
|
||||
* Fix loading data from subdir with a period in name (#5433)
|
||||
* Revert Commands::Serve#server_address signature change. (#5456)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Document `to_integer` and `inspect` filters (#5185)
|
||||
* Fix path in the prompt (#5194)
|
||||
* need subcommand build (#5190)
|
||||
* Add the Jekyll Cloudinary plugin (#5183)
|
||||
* Documentation : `new-theme` command (#5205)
|
||||
* Document `link` Liquid tag (#5182)
|
||||
* Remove mention of page for link tag in release post (#5214)
|
||||
* fixed typo (#5226)
|
||||
* Add missing comma (#5222)
|
||||
* Maintain aspect ratio with `height: auto;` (#5254)
|
||||
* Fix a link in deployment-methods.md (#5244)
|
||||
* Documentation: improve highlight in `Creating a theme` (#5249)
|
||||
* Bundler isn't installed by default (#5258)
|
||||
* Update troubleshooting documentation to include fix for issue with vendored gems (#5271)
|
||||
* Link `--lsi` option's description to Wikipedia docs on LSI (#5274)
|
||||
* Document `--profile` option on the configuration page (#5279)
|
||||
* Update homepage to sync with merge of #5258 (#5287)
|
||||
* Add post about Jekyll Admin initial release (#5291)
|
||||
* Replace liquid highlight tag with backticks (#5262)
|
||||
* Word update (#5294)
|
||||
* Site documentation section links always point to https://jekyllrb.com (#5281)
|
||||
* Missing `:site, :post_render` payload documentation on site (#5280)
|
||||
* Site: exclude README.md and .gitignore (#5304)
|
||||
* Add link to Staticman (#5224)
|
||||
* Update url for OpenShift (#5320)
|
||||
* [docs] add help for missing static_file e.g. on heroku (#5334)
|
||||
* Add a line about updating theme-gems in the docs (#5318)
|
||||
* Explain how to copy a theme's files (#5335)
|
||||
* [docs] .md as default extension in examples (#5316)
|
||||
* Fix small typo in docs (#5347)
|
||||
* Add missing period to sentence in first paragraph. (#5372)
|
||||
* added jekyll-spotify plugin (#5369)
|
||||
* Add jekyll-menus to the list of plugins. (#5397)
|
||||
* macOS and one grammar fix (#5403)
|
||||
* Add documentation for `relative_url` and `absolute_url` (#5405)
|
||||
* Bugfix on logo in JSON-LD (#5421)
|
||||
* Fix Travis.ci documentation (#5413)
|
||||
* [docs] Update documentation regarding `bundle install` after `jekyll new` (#5428)
|
||||
* Replace classic box-sizing reset with inheritance reset (#5411)
|
||||
* Update Wikipedia YAML list link (#5452)
|
||||
* Add Jekyll 3.3 release post (#5442)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Update appveyor.yml and fix optional deps for Ruby x64 (#5180)
|
||||
* Improve tests for Jekyll::PluginManager (#5167)
|
||||
* Update Ruby versions in travis.yml (#5221)
|
||||
* Avoid installing unecessary gems for site testing (#5272)
|
||||
* Proposal: Affinity teams and their captains (#5273)
|
||||
* Replace duplicate with postive local test in issue template (#5286)
|
||||
* Update AppVeyor config. (#5240)
|
||||
* Execute jekyll from clone instead of defined binary when running 'script/default-site' (#5295)
|
||||
* rubocop: lib/jekyll/document.rb complexity fixes (#5045)
|
||||
* Proxy a number of Convertible methods to Renderer (#5308)
|
||||
* Run executable for Cucumber via Ruby instead of Shell (#5383)
|
||||
* Appease Rubocop (#5381)
|
||||
* remove features' directories on windows with proper access (#5389)
|
||||
* `site_configuration.feature`: use UTC format in timezone (#5416)
|
||||
* swallow bundle output from `jekyll new` while in CI (#5408)
|
||||
* Add .editorconfig (#5412)
|
||||
|
||||
## 3.2.1 / 2016-08-02
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Include theme directories in default gemspec (#5152)
|
||||
* Fix for symlinked themes (#5156)
|
||||
* Layout: set `relative_path` without using Pathname (#5164)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Add test to build the default site (#5154)
|
||||
* script/default-site: specify `BUNDLE_GEMFILE` for new site (#5178)
|
||||
* script/default-site: read Jekyll source from local clone (#5188)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Enable site excerpts (#5150)
|
||||
* Initial 404 page (#5143)
|
||||
* Remove the "this feature is unreleased" warning from the theme docs (#5158)
|
||||
* Future True on GitHub Pages note (#5173)
|
||||
* Minor updates and corrections (#5177)
|
||||
* index.html: update instructions to require bundler (#5169)
|
||||
* docs/quickstart: update instructions to require bundler (#5168)
|
||||
|
||||
## 3.2.0 / 2016-07-26
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Stop testing with Ruby 2.0.x, which is EOL'd. (#4381)
|
||||
* Allow collections to have documents that have no file extension (#4545)
|
||||
* Add size property to `group_by` result (#4557)
|
||||
* Site Template: Removed unnecessary nesting from `_base.scss` (#4637)
|
||||
* Adding a debug log statment for skipped future documents. (#4558)
|
||||
* Site Template: Changed main `<div>` to `<main>` and added accessibility info (#4636)
|
||||
* Add array support to `where` filter (#4555)
|
||||
* 'jekyll clean': also remove .sass-cache (#4652)
|
||||
* Clean up `Tags::PostUrl` a bit, including better errors and date parsing (#4670)
|
||||
* Use `String#encode` for `xml_escape` filter instead of `CGI.escapeHTML` (#4694)
|
||||
* Add `show_dir_listing` option for serve command and fix index file names (#4533)
|
||||
* Site Template: write a Gemfile which is educational to the new site (#4542)
|
||||
* Site template: add explanation of site variables in the example `_config.yml` (#4704)
|
||||
* Adds `link` Liquid tag to make generation of URL's easier (#4624)
|
||||
* Allow static files to be symlinked in unsafe mode or non-prod environments (#4640)
|
||||
* Add `:after_init` hook & add `Site#config=` to make resetting config easy (#4703)
|
||||
* DocumentDrop: add `#<=>` which sorts by date (falling back to path) (#4741)
|
||||
* Add a `where_exp` filter for filtering by expression (#4478)
|
||||
* Globalize Jekyll's Filters. (#4792)
|
||||
* Gem-based themes (#4595)
|
||||
* Allow symlinks if they point to stuff inside `site.source` (#4710)
|
||||
* Update colorator dependency to v1.x (#4855)
|
||||
* Move EntryFilter to use Pathutil & fix `glob_include?` (#4859)
|
||||
* Add 'jekyll new-theme' command to help users get up and running creating a theme (#4848)
|
||||
* `markdownify` and `smartify` should convert input to string before conversion (#4958)
|
||||
* Run `Site#generate` for 'jekyll doctor' to catch plugin issues (#5005)
|
||||
* Add `normalize_whitepace` filter (#4917)
|
||||
* Move bin/jekyll to exe/jekyll to prevent collision with binstubs (#5014)
|
||||
* Cleaning up site template & theme updates. (#4922)
|
||||
* Add fetch method to Drops (#5056)
|
||||
* Extract tag name to class method (#5063)
|
||||
* check if relative URL contains a colon (#5069)
|
||||
* Enable strict (or lax) liquid parsing via a config variable. (#5053)
|
||||
* Add filter: `to_integer` (#5101)
|
||||
* watcher: pass site instance to watch plugin (#5109)
|
||||
* Show liquid warnings. (#5129)
|
||||
* Add `--baseurl` to `build` subcommand (#5135)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Site Template: Added a default lang attribute (#4633)
|
||||
* Site template: Escape title and description where it is used in HTML (#4606)
|
||||
* `Document#date`: drafts which have no date should use source file mtime (#4611)
|
||||
* `Filters#time`: clone an input Time so as to be non-destructive (#4590)
|
||||
* Doctor: fix issue where `--config` wasn't a recognized flag (#4598)
|
||||
* Ensures `related_posts` are only set for a post (#4620)
|
||||
* `EntryFilter#special?`: ignore filenames which begin with `~` (#4491)
|
||||
* Cleaner: `keep_files` should only apply to the beginning of paths, not substrings with index > 0 (#3849)
|
||||
* Use SSLEnable instead of EnableSSL and make URL HTTPS. (#4693)
|
||||
* convertible: use `Document::YAML_FRONT_MATTER_REGEXP` to parse transformable files (#4786)
|
||||
* Example in the site template should be IANA-approved example.com (#4793)
|
||||
* 3.2.x/master: Fix defaults for Documents (posts/collection docs) (#4808)
|
||||
* Don't rescue LoadError or bundler load errors for Bundler. (#4857)
|
||||
* `Serve.process` should receive same config as `Build.process` (#4953)
|
||||
* Prevent reset of page in Liquid payload right before rendering layouts (#5009)
|
||||
* Add missing fields to ExcerptDrop (#5067)
|
||||
* Stringify configuration overrides before first use (#5060)
|
||||
* hooks: move `after_init` hook call at the end of `Site#initialize` (#5106)
|
||||
* filters: raise error if no input given to date filters (#5127)
|
||||
* `where_exp` filter should filter posts (#4860)
|
||||
|
||||
### Forward Ports
|
||||
|
||||
* From v3.1.4: Add ExcerptDrop and remove excerpt's ability to refer to itself in Liquid (#4941)
|
||||
* From v3.1.4: Configuration permalink fix and addition of Configuration.from and sorting `site.collections` by label (#4942)
|
||||
* From v3.1.4: Fix `{{ layout }}` oddities (proper inheritance & fixing overflow of old data) (#4943)
|
||||
* From v3.1.5: Sort the results of the `require_all` glob (#4944)
|
||||
* From v3.1.6: Add ability to render drops as JSON (#4945)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Add project maintainer profile links (#4591)
|
||||
* Fix state leakage in Kramdown test (#4618)
|
||||
* Unify method for copying special files from repo to site (#4601)
|
||||
* Refresh the contributing file (#4596)
|
||||
* change smartify doc from copy/paste of mardownify doc (#4653)
|
||||
* Update Rake & disable warnings when running tests (#4720)
|
||||
* Fix many warnings (#4537)
|
||||
* Don't blindly assume the last system when determining "open" cmd (#4717)
|
||||
* Fix "locally" typo in contributing documentation (#4756)
|
||||
* Update Rubocop rules (#4886)
|
||||
* Flesh out the issue template to be much more detailed (#4849)
|
||||
* Fixing rubocop offenses in lib/jekyll/cleaner.rb (#4892)
|
||||
* Update `jekyll/commands*` to pass rubocop rules (#4888)
|
||||
* Clean up many test files to pass Rubocop rules (#4902)
|
||||
* Rubocop cleanup for some utils and further test files (#4916)
|
||||
* Rubocop: Low hanging fruit (#4936)
|
||||
* Rubocop: `Drop` changes from v3.1 forward-ports (#4949)
|
||||
* Rubocop: cleanup for misc files (#4946)
|
||||
* Rubocop: Stevenson (#4951)
|
||||
* Rubocop: lib/jekyll/entry_filter.rb (#4950)
|
||||
* Rubocop: `test/*` (#4947)
|
||||
* Rubocop: features (#4934)
|
||||
* Rubocop: Liquid renderer (#4933)
|
||||
* Rubocop: converters (#4931)
|
||||
* Rubocop: Site Drop (#4948)
|
||||
* Rubocop: tags (#4938)
|
||||
* Rubocop: Readers (#4932)
|
||||
* rubocop: jekyll/lib/frontmatter_defaults.rb (#4974)
|
||||
* rubocop: features/step_definitions.rb (#4956)
|
||||
* Rubocop theme and url jekyll libs (#4959)
|
||||
* Rubocop jekyll.rb (#4966)
|
||||
* Rubocop: use %r for all regular expressions. (#4979)
|
||||
* Cleanup and make misc files compliant with Rubocop. (#4940)
|
||||
* Rubocop: jekyll/lib/site.rb (#4973)
|
||||
* Add timings for each scenario in cucumber & print worst offenders (#4908)
|
||||
* rubocop: jekyll/lib/filters.rb (#4993)
|
||||
* Fix rubocop offenses in exe/jekyll (#5017)
|
||||
* Rubocop: lib/jekyll/command.rb (#5018)
|
||||
* rubocop: lib/jekyll/static_file.rb (#5019)
|
||||
* rubocop: lib/jekyll/utils.rb (#5026)
|
||||
* rubocop: lib/jekyll/regenerator.rb (#5025)
|
||||
* rubocop: lib/jekyll/configuration.rb (#5024)
|
||||
* rubocop: lib/jekyll/renderer.rb style fixes (#5032)
|
||||
* rubocop: lib/jekyll/convertible.rb style fixes (#5031)
|
||||
* rubocop: lib/jekyll/document.rb style fixes (#5030)
|
||||
* Remove ruby-head from Travis matrix & fix jruby failures (#5015)
|
||||
* Remove useless statement from Configuration test (#5065)
|
||||
* Change baseurl to example.com for some test cases (#5068)
|
||||
* use activesupport < 5 if we are on a Ruby < 2.2.2 (#5100)
|
||||
* Internal documentation for working on Jekyll (#5011)
|
||||
* rubocop: lib/jekyll/collection.rb (#5022)
|
||||
* tests: Typo fixes. (#5114)
|
||||
* Normalize yml files. (#5116)
|
||||
* Whitespace cleanup. (#5113)
|
||||
* Add AppVeyor support. (#5115)
|
||||
* appveyor.yml: drop Ruby 2.0.0. (#5119)
|
||||
* Fix indentation in benchmark (#5124)
|
||||
* Style fixes for Rubocop 0.42.0 - var == 0 becomes var.zero? - when defining method_missing, also define respond_to_missing? (#5137)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Add jekyll-seo-tag, jekyll-avatar, and jekyll-sitemap to the site (#4553)
|
||||
* Add Google search query to /docs/help/ (#4589)
|
||||
* Upgrading, documentation (#4597)
|
||||
* Add 'view source' entry (#4602)
|
||||
* Add jekyll-video-embed to list of third-party plugins. (#4621)
|
||||
* Adding Aerobatic to list of deployment options (#4630)
|
||||
* Update documentation: HTMLProofer CLI command (#4641)
|
||||
* Document that subdirectories of `_posts` are no longer categories (#4639)
|
||||
* Update continuous-integration docs with sudo: false information (#4628)
|
||||
* Blog post on refreshed contributing file and new affinity teams (#4645)
|
||||
* Fixes typo on collections (#4647)
|
||||
* Documentation: future option also works for collections (#4682)
|
||||
* Additional package needed for Fedora 23 Workspace (#4685)
|
||||
* Fix typo on Chocolatey name in Windows documentation (#4686)
|
||||
* Use the correct URL, Fixes #4698 (#4699)
|
||||
* Add jekyll-paspagon plugin (#4700)
|
||||
* Bold-italicize note in assets documentation about needing yaml front matter (#4706)
|
||||
* Highlight the `script/` calls in the Contributing documentation (#4712)
|
||||
* Add Hawkins to the list of third-party plugins (#4755)
|
||||
* Fix a typo in pagination doc (#4763)
|
||||
* Switch second GitHub Pages link to HTTPS (#4760)
|
||||
* Explain data file format requirements more clearly in documentation (#4781)
|
||||
* Add jekyll-i18n_tags to list of third-party plugins (#4775)
|
||||
* Remove Leonard Lamprecht's website from Sites page (#4771)
|
||||
* Updates documentation for collections to include `date` property (#4769)
|
||||
* Added an explicit rerun note to configuration.md, defaults section (#4734)
|
||||
* Update Rack-Jekyll Heroku deployment blog post url (#4789)
|
||||
* Added missing single quote on rsync client side command (#4813)
|
||||
* Organize Form Platforms-as-a-Service into unified list & add FormSpree.io (#4754)
|
||||
* Fixed typo on Configuration page (#4804)
|
||||
* Update FormKeep URL on the Resources doc (#4844)
|
||||
* site: use liquid & reduce some whitespace noise (#4854)
|
||||
* Add jekyll-breadcrumbs to list of third-party plugins (#4874)
|
||||
* Added Pug converter to list of third-party plugins (#4872)
|
||||
* Add jekyll-ideal-image-slider to list of third-party plugins (#4863)
|
||||
* Add Jekyll Tips and the Cheatsheet to the list of resources (#4887)
|
||||
* Removed extra `</p>` from `site/_docs/permalinks.md` (#4890)
|
||||
* Add pubstorm deployment instructions to docs (#4881)
|
||||
* Corrected pagination docs for hidden: true feature (#4903)
|
||||
* Remove a Broken Link for Refheap Plugin (#4971)
|
||||
* Instructions on how to install github-gem on Windows (#4975)
|
||||
* Minor tweak to fix missing apostrophne (#4962)
|
||||
* Instructions on how to install github-gem on Windows (v2) (#4977)
|
||||
* Fix inaccurate HTTP response header field name (#4976)
|
||||
* Add post about GSoC project (#4980)
|
||||
* Link to the HTML page instead of Markdown (#4985)
|
||||
* Update normalize.css to v4.0.0. (#4989)
|
||||
* Add jekyll-tags-list-plugin to list of third-party plugins (#5000)
|
||||
* Windows docs: Command needs to be called from blog path (#5006)
|
||||
* Update text to be consitent with example (#5010)
|
||||
* Update template links to point to core Liquid site (#5012)
|
||||
* Add generator-jekyllized to third-party plugins (#5027)
|
||||
* Add Jekyll Art Hallery generator plugin to list of third-party plugins (#5043)
|
||||
* Add Formingo to the list of Jekyll form SaaS (#5054)
|
||||
* Highlight help nav item when navigated to. (#5058)
|
||||
* Update normalize.css to v4.2.0. (#5096)
|
||||
* Updates html-proofer code (#5098)
|
||||
* Jekyll Community (#5097)
|
||||
* Typo in documentation file templates.md (#5117)
|
||||
* Slightly, improve PNG compression. (#5112)
|
||||
* docs: add jekyll-maps plugin reference (#5123)
|
||||
* docs: fix link to plugins page source (#5122)
|
||||
* Update the configuration docs to match the code (#5131)
|
||||
* Removed confusing word repetition. (#5139)
|
||||
* Add a note about script/fmt (#5138)
|
||||
|
||||
## 3.1.6 / 2016-05-19
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add ability to `jsonify` Drops such that, e.g. `site | jsonify`, works. (#4914)
|
||||
|
||||
## 3.1.5 / 2016-05-18
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Sort the results of the `require_all` glob (affects Linux only). (#4912)
|
||||
|
||||
## 3.1.4 / 2016-05-18
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add `ExcerptDrop` and remove excerpt's ability to refer to itself in Liquid (#4907)
|
||||
* Configuration permalink fix where `collections.posts.permalink` inherits properly from `permalink` only when it doesn't exist (#4910)
|
||||
* Add `Configuration.from` to make it easier to build configs from just a hash
|
||||
* Sorting `site.collections` in Liquid by label (#4910)
|
||||
* Fix bug where `layout` in Liquid would inherit from previously-rendered layouts' metadatas (#4909)
|
||||
* Fix bug where `layout` in Liquid would override in the wrong direction (more-specific layouts' data were overwritten by their parent layouts' data; this has now been reversed) (#4909)
|
||||
|
||||
## 3.1.3 / 2016-04-18
|
||||
|
||||
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4807)
|
||||
* Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) (#4693)
|
||||
|
||||
## 3.1.2 / 2016-02-19
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Include `.rubocop.yml` in Gem (#4437)
|
||||
* `LiquidRenderer#parse`: parse with line numbers. (#4452)
|
||||
* Add consistency to the no-subcommand deprecation message (#4505)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix syntax highlighting in kramdown by making `@config` accessible in the Markdown converter. (#4428)
|
||||
* `Jekyll.sanitized_path`: sanitizing a questionable path should handle tildes (#4492)
|
||||
* Fix `titleize` so already capitalized words are not dropped (#4525)
|
||||
* Permalinks which end in a slash should always output HTML (#4546)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Require at least cucumber version 2.1.0 (#4514)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Add jekyll-toc plugin (#4429)
|
||||
* Docs: Quickstart - added documentation about the `--force` option (#4410)
|
||||
* Fix broken links to the Code of Conduct (#4436)
|
||||
* Upgrade notes: mention trailing slash in permalink; fixes #4440 (#4455)
|
||||
* Add hooks to the plugin categories toc (#4463)
|
||||
* [add note] Jekyll 3 requires newer version of Ruby. (#4461)
|
||||
* Fix typo in upgrading docs (#4473)
|
||||
* Add note about upgrading documentation on jekyllrb.com/help/ (#4484)
|
||||
* Update Rake link (#4496)
|
||||
* Update & prune the short list of example sites (#4374)
|
||||
* Added amp-jekyll plugin to plugins docs (#4517)
|
||||
* A few grammar fixes (#4512)
|
||||
* Correct a couple mistakes in structure.md (#4522)
|
||||
|
||||
## 3.1.1 / 2016-01-29
|
||||
|
||||
### Meta
|
||||
|
||||
* Update the Code of Conduct to the latest version (#4402)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Page#dir`: ensure it ends in a slash (#4403)
|
||||
* Add `Utils.merged_file_read_opts` to unify reading & strip the BOM (#4404)
|
||||
* `Renderer#output_ext`: honor folders when looking for ext (#4401)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Suppress stdout in liquid profiling test (#4409)
|
||||
|
||||
## 3.1.0 / 2016-01-23
|
||||
|
||||
### Minor Enhancements
|
||||
@@ -94,6 +529,25 @@
|
||||
* Add Contentful Extension to list of third-party plugins (#4390)
|
||||
* Correct Minor spelling error (#4394)
|
||||
|
||||
## 3.0.5 / 2016-04-26
|
||||
|
||||
* Remove call to `#backwards_compatibilize` in `Configuration.from` (#4846)
|
||||
|
||||
## 3.0.4 / 2016-04-18
|
||||
|
||||
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4806)
|
||||
* Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it (#4753)
|
||||
|
||||
## 3.0.3 / 2016-02-08
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix extension weirdness with folders (#4493)
|
||||
* EntryFilter: only include 'excluded' log on excluded files (#4479)
|
||||
* `Jekyll.sanitized_path`: escape tildes before sanitizing a questionable path (#4468)
|
||||
* `LiquidRenderer#parse`: parse with line numbers (#4453)
|
||||
* `Document#<=>`: protect against nil comparison in dates. (#4446)
|
||||
|
||||
## 3.0.2 / 2016-01-20
|
||||
|
||||
### Bug Fixes
|
||||
@@ -898,7 +1352,7 @@
|
||||
* Patch a couple show-stopping security vulnerabilities (#1946)
|
||||
* Sanitize paths uniformly, in a Windows-friendly way (#2065, #2109)
|
||||
* Update gem build steps to work correctly on Windows (#2118)
|
||||
* Remove obsolete `normalize_options` method call from `bin/jekyll` (#2121).
|
||||
* Remove obsolete `normalize_options` method call from `bin/jekyll` (#2121)
|
||||
* Remove `+` characters from Pygments lexer names when adding as a CSS class (#994)
|
||||
* Remove some code that caused Ruby interpreter warnings (#2178)
|
||||
* Only strip the drive name if it begins the string (#2175)
|
||||
@@ -1764,7 +2218,7 @@
|
||||
|
||||
* Bug Fixes
|
||||
* Fix pagination % 0 bug (#78)
|
||||
* Ensure all posts are processed first (#71) ## NOTE
|
||||
* Ensure all posts are processed first (#71)
|
||||
* After this point I will no longer be giving credit in the history; that is what the commit log is for.
|
||||
|
||||
## 0.5.4 / 2009-08-23
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# [Jekyll](http://jekyllrb.com/)
|
||||
# [Jekyll](https://jekyllrb.com/)
|
||||
|
||||
[][ruby-gems]
|
||||
[][travis]
|
||||
[][coverage]
|
||||
[][codeclimate]
|
||||
[][gemnasium]
|
||||
[][travis]
|
||||
[][appveyor]
|
||||
[][coverage]
|
||||
[][codeclimate]
|
||||
[][gemnasium]
|
||||
[][hakiri]
|
||||
|
||||
[ruby-gems]: https://rubygems.org/gems/jekyll
|
||||
@@ -13,10 +14,9 @@
|
||||
[coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
|
||||
[hakiri]: https://hakiri.io/github/jekyll/jekyll/master
|
||||
[travis]: https://travis-ci.org/jekyll/jekyll
|
||||
[appveyor]: https://ci.appveyor.com/project/jekyll/jekyll/branch/master
|
||||
|
||||
By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
||||
|
||||
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](http://pages.github.com), which you can use to host sites right from your GitHub repositories.
|
||||
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](https://pages.github.com), which you can use to host sites right from your GitHub repositories.
|
||||
|
||||
## Philosophy
|
||||
|
||||
@@ -24,37 +24,37 @@ Jekyll does what you tell it to do — no more, no less. It doesn't try to outs
|
||||
|
||||
## Having trouble with OS X El Capitan?
|
||||
|
||||
See: http://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
|
||||
See: https://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
|
||||
|
||||
## Getting Started
|
||||
|
||||
* [Install](http://jekyllrb.com/docs/installation/) the gem
|
||||
* Read up about its [Usage](http://jekyllrb.com/docs/usage/) and [Configuration](http://jekyllrb.com/docs/configuration/)
|
||||
* [Install](https://jekyllrb.com/docs/installation/) the gem
|
||||
* Read up about its [Usage](https://jekyllrb.com/docs/usage/) and [Configuration](https://jekyllrb.com/docs/configuration/)
|
||||
* Take a gander at some existing [Sites](https://wiki.github.com/jekyll/jekyll/sites)
|
||||
* Fork and [Contribute](http://jekyllrb.com/docs/contributing/) your own modifications
|
||||
* [Fork](https://github.com/jekyll/jekyll/fork) and [Contribute](https://jekyllrb.com/docs/contributing/) your own modifications
|
||||
* Have questions? Check out our official forum community [Jekyll Talk](https://talk.jekyllrb.com/) or [`#jekyll` on irc.freenode.net](https://botbot.me/freenode/jekyll/)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to have a more open and welcoming community, Jekyll adheres to a
|
||||
[code of conduct](CONDUCT.md) adapted from the Ruby on Rails code of
|
||||
[code of conduct](CONDUCT.markdown) adapted from the Ruby on Rails code of
|
||||
conduct.
|
||||
|
||||
Please adhere to this code of conduct in any interactions you have in the
|
||||
Jekyll community. It is strictly enforced on all official Jekyll
|
||||
repositories, websites, and resources. If you encounter someone violating
|
||||
these terms, please let a maintainer (@parkr, @envygeeks, or @mattr-) know
|
||||
these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), or [@mattr-](https://github.com/mattr-)) know
|
||||
and we will address it as soon as possible.
|
||||
|
||||
## Diving In
|
||||
|
||||
* [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
|
||||
* Learn how the [YAML Front Matter](http://jekyllrb.com/docs/frontmatter/) works
|
||||
* Put information on your site with [Variables](http://jekyllrb.com/docs/variables/)
|
||||
* Customize the [Permalinks](http://jekyllrb.com/docs/permalinks/) your posts are generated with
|
||||
* Use the built-in [Liquid Extensions](http://jekyllrb.com/docs/templates/) to make your life easier
|
||||
* Use custom [Plugins](http://jekyllrb.com/docs/plugins/) to generate content specific to your site
|
||||
* Learn how the [YAML Front Matter](https://jekyllrb.com/docs/frontmatter/) works
|
||||
* Put information on your site with [Variables](https://jekyllrb.com/docs/variables/)
|
||||
* Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with
|
||||
* Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier
|
||||
* Use custom [Plugins](https://jekyllrb.com/docs/plugins/) to generate content specific to your site
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE).
|
||||
See the [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE) file.
|
||||
|
||||
28
Rakefile
28
Rakefile
@@ -87,6 +87,34 @@ def converted_history(markdown)
|
||||
normalize_bullets(markdown)))))
|
||||
end
|
||||
|
||||
def siteify_file(file, overrides_front_matter = {})
|
||||
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
|
||||
title = begin
|
||||
File.read(file).match(/\A# (.*)$/)[1]
|
||||
rescue
|
||||
File.basename(file, ".*").downcase.capitalize
|
||||
end
|
||||
slug = File.basename(file, ".markdown").downcase
|
||||
front_matter = {
|
||||
"title" => title,
|
||||
"layout" => "docs",
|
||||
"permalink" => "/docs/#{slug}/",
|
||||
"note" => "This file is autogenerated. Edit /#{file} instead."
|
||||
}.merge(overrides_front_matter)
|
||||
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
|
||||
File.write("site/_docs/#{slug}.md", contents)
|
||||
end
|
||||
|
||||
def content_for(file)
|
||||
contents = File.read(file)
|
||||
case file
|
||||
when "History.markdown"
|
||||
converted_history(contents)
|
||||
else
|
||||
contents.gsub(/\A# .*\n\n?/, "")
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Standard tasks
|
||||
|
||||
42
appveyor.yml
Normal file
42
appveyor.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
version: "{build}"
|
||||
|
||||
clone_depth: 10
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
|
||||
build: off
|
||||
|
||||
install:
|
||||
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%\bin;%PATH%
|
||||
- bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle
|
||||
|
||||
environment:
|
||||
BUNDLE_WITHOUT: "benchmark:site:development"
|
||||
matrix:
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "cucumber"
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "fmt"
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "default-site"
|
||||
- RUBY_FOLDER_VER: "23-x64"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "22"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "21"
|
||||
TEST_SUITE: "test"
|
||||
|
||||
test_script:
|
||||
- ruby --version
|
||||
- gem --version
|
||||
- bundler --version
|
||||
- bash ./script/cibuild
|
||||
|
||||
cache:
|
||||
# If one of the files after the right arrow changes, cache will be skipped
|
||||
- 'vendor\bundle -> appveyor.yml,Gemfile,jekyll.gemspec'
|
||||
20
benchmark/capture-assign.rb
Normal file
20
benchmark/capture-assign.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require "liquid"
|
||||
require "benchmark/ips"
|
||||
|
||||
puts "Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
||||
puts "Liquid #{Liquid::VERSION}"
|
||||
|
||||
template1 = '{% capture foobar %}foo{{ bar }}{% endcapture %}{{ foo }}{{ foobar }}'
|
||||
template2 = '{% assign foobar = "foo" | append: bar %}{{ foobar }}'
|
||||
|
||||
def render(template)
|
||||
Liquid::Template.parse(template).render("bar" => "42")
|
||||
end
|
||||
|
||||
puts render(template1)
|
||||
puts render(template2)
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('capture') { render(template1) }
|
||||
x.report('assign') { render(template2) }
|
||||
end
|
||||
@@ -4,10 +4,12 @@ Benchmark.ips do |x|
|
||||
path_without_ending_slash = '/some/very/very/long/path/to/a/file/i/like'
|
||||
x.report('no slash regexp') { path_without_ending_slash =~ /\/$/ }
|
||||
x.report('no slash end_with?') { path_without_ending_slash.end_with?("/") }
|
||||
x.report('no slash [-1, 1]') { path_without_ending_slash[-1, 1] == "/" }
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
path_with_ending_slash = '/some/very/very/long/path/to/a/file/i/like/'
|
||||
x.report('slash regexp') { path_with_ending_slash =~ /\/$/ }
|
||||
x.report('slash end_with?') { path_with_ending_slash.end_with?("/") }
|
||||
x.report('slash [-1, 1]') { path_with_ending_slash[-1, 1] == "/" }
|
||||
end
|
||||
|
||||
54
benchmark/file-dir-ensure-trailing-slash
Normal file
54
benchmark/file-dir-ensure-trailing-slash
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'benchmark/ips'
|
||||
|
||||
# For this pull request, which changes Page#dir
|
||||
# https://github.com/jekyll/jekyll/pull/4403
|
||||
|
||||
FORWARD_SLASH = '/'.freeze
|
||||
|
||||
def pre_pr(url)
|
||||
url[-1, 1] == FORWARD_SLASH ? url : File.dirname(url)
|
||||
end
|
||||
|
||||
def pr(url)
|
||||
if url.end_with?(FORWARD_SLASH)
|
||||
url
|
||||
else
|
||||
url_dir = File.dirname(url)
|
||||
url_dir.end_with?(FORWARD_SLASH) ? url_dir : "#{url_dir}/"
|
||||
end
|
||||
end
|
||||
|
||||
def envygeeks(url)
|
||||
return url if url.end_with?(FORWARD_SLASH) || url == FORWARD_SLASH
|
||||
|
||||
url = File.dirname(url)
|
||||
url == FORWARD_SLASH ? url : "#{url}/"
|
||||
end
|
||||
|
||||
# Just a slash
|
||||
Benchmark.ips do |x|
|
||||
path = '/'
|
||||
x.report("pre_pr:#{path}") { pre_pr(path) }
|
||||
x.report("pr:#{path}") { pr(path) }
|
||||
x.report("envygeeks:#{path}") { pr(path) }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
# No trailing slash
|
||||
Benchmark.ips do |x|
|
||||
path = '/some/very/very/long/path/to/a/file/i/like'
|
||||
x.report("pre_pr:#{path}") { pre_pr(path) }
|
||||
x.report("pr:#{path}") { pr(path) }
|
||||
x.report("envygeeks:#{path}") { pr(path) }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
# No trailing slash
|
||||
Benchmark.ips do |x|
|
||||
path = '/some/very/very/long/path/to/a/file/i/like/'
|
||||
x.report("pre_pr:#{path}") { pre_pr(path) }
|
||||
x.report("pr:#{path}") { pr(path) }
|
||||
x.report("envygeeks:#{path}") { pr(path) }
|
||||
x.compare!
|
||||
end
|
||||
51
benchmark/regexp-vs-include.rb
Normal file
51
benchmark/regexp-vs-include.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'benchmark/ips'
|
||||
|
||||
# For this pull request, which changes Page#dir
|
||||
# https://github.com/jekyll/jekyll/pull/4403
|
||||
|
||||
CONTENT_CONTAINING = <<-HTML.freeze
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title>Jemoji</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" href="/css/screen.css">
|
||||
</head>
|
||||
<body class="wrap">
|
||||
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20" align="absmiddle"></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
CONTENT_NOT_CONTAINING = <<-HTML.freeze
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title>Jemoji</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" href="/css/screen.css">
|
||||
</head>
|
||||
<body class="wrap">
|
||||
<p><img class="emoji" title=":+1:" alt=":+1:" src="https://assets.github.com/images/icons/emoji/unicode/1f44d.png" height="20" width="20" align="absmiddle"></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("no body include?") { CONTENT_NOT_CONTAINING.include?('<body') }
|
||||
x.report("no body regexp") { CONTENT_NOT_CONTAINING =~ /<\s*body/ }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
# No trailing slash
|
||||
Benchmark.ips do |x|
|
||||
x.report("with body include?") { CONTENT_CONTAINING.include?('<body') }
|
||||
x.report("with body regexp") { CONTENT_CONTAINING =~ /<\s*body/ }
|
||||
x.compare!
|
||||
end
|
||||
25
docs/affinity-team-captain.md
Normal file
25
docs/affinity-team-captain.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Affinity Team Captains
|
||||
|
||||
**This guide is for affinity team captains.** These special people are **team maintainers** of one of our [affinity teams][] and help triage and evaluate the issues and contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
## Affinity teams & their captains
|
||||
|
||||
The Jekyll project uses [affinity teams][] to help break up the work of incoming issues and pull requests from community members. We receive a sizeable number of issues and pull requests each week; the use of affinity teams helps distribute this load across a number of specialized groups instead of pushing it all onto @jekyll/core.
|
||||
|
||||
## Responsibilities of Team Captains
|
||||
|
||||
Each affinity team has a few captains who manage the issues and pull requests for that team. When an issue or PR is opened with a `/cc` for a given affinity team, @jekyllbot automatically assigns a random affinity team captain to the issue to triage it. They have access to add labels, reassign the issue, give LGTM's, and so forth. While they do not merge PR's today, they are still asked to review PR's for parts of the codebase under their purview.
|
||||
|
||||
## How do I become a team captain?
|
||||
|
||||
Just ask! Feel free to open an issue on `jekyll/jekyll` and add `/cc @jekyll/core`. We can add you. :smile:
|
||||
|
||||
Alternatively, you can email or otherwise reach out to [@parkr](https://github.com/parkr) directly if you prefer the more private route.
|
||||
|
||||
## Ugh, I'm tired and don't have time to be a captain anymore. What now?
|
||||
|
||||
No sweat at all! Email [@parkr](https://github.com/parkr) and ask to be removed. Alternatively, you should be able to go to your team's page on GitHub.com (go to https://github.com/jekyll, click "Teams", click the link to your team) and change your status to either "member" or leave the team.
|
||||
|
||||
We realize that being a captain is no easy feat so we want to make it a great experience. As always, communicate as much as you can with us about what is working, and what isn't. Thanks for dedicating some time to Jekyll! :sparkles:
|
||||
|
||||
[affinity teams]: https://teams.jekyllrb.com/
|
||||
27
docs/avoiding-burnout.md
Normal file
27
docs/avoiding-burnout.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Maintainers: Avoiding Burnout
|
||||
|
||||
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
# 1. Use Jekyll
|
||||
|
||||
Maintainers of Jekyll should be using it regularly. This is partly because you won't be a good maintainer unless you can put yourself in the shoes of our users but also because you may decide to stop using Jekyll and at that point you should also decide not to be a maintainer and find other things to work on.
|
||||
|
||||
# 2. No Guilt About Leaving
|
||||
|
||||
All maintainers can stop working on Jekyll at any time without any guilt or explanation (like a job). We may still ask for your help with questions after you leave but you are under no obligation to answer them. Like a job, if you create a big mess and then leave you still have no obligations but we may think less of you (or, realistically, probably just revert the problematic work). Like a job, you should probably take a break from Jekyll at least a few times a year.
|
||||
|
||||
This also means contributors should be consumers. If a maintainer finds they are not using a project in the real-world, they should reconsider their involvement with the project.
|
||||
|
||||
# 3. Prioritise Maintainers Over Users
|
||||
|
||||
It's important to be user-focused but ultimately, as long as you follow #1 above, Jekyll's minimum number of users will be the number of maintainers. However, if Jekyll has no maintainers it will quickly become useless to all users and the project will die. As a result, no user complaint, behaviour or need takes priority over the burnout of maintainers. If users do not like the direction of the project, the easiest way to influence it is to make significant, high-quality code contributions and become a maintainer.
|
||||
|
||||
# 4. Learn To Say No
|
||||
|
||||
Jekyll gets a lot of feature requests, non-reproducible bug reports, usage questions and PRs we won't accept. These should be closed out as soon as we realise that they aren't going to be resolved or merged. This is kinder than deciding this after a long period of review. Our issue tracker should reflect work to be done.
|
||||
|
||||
---
|
||||
|
||||
Thanks to https://gist.github.com/ryanflorence/124070e7c4b3839d4573 which influenced this document.
|
||||
|
||||
Thanks to [Homebrew's "Avoiding Burnout" document](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Maintainers-Avoiding-Burnout.md) for providing a perfect base for this document.
|
||||
35
docs/becoming-a-maintainer.md
Normal file
35
docs/becoming-a-maintainer.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Contributors: Becoming a Maintainer
|
||||
|
||||
**This guide is for contributors.** These special people have contributed to one or more of Jekyll's repositories, but do not yet have write access to any. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
So you want to become a maintainer of a Jekyll project? We'd love to have you! Here are some things we like to see from community members before we promote them to maintainers.
|
||||
|
||||
## 1. Use Jekyll
|
||||
|
||||
You want to maintain Jekyll? Use it often. Do weird things with it. Do normal things with it. Does it work? Does it have any weaknesses? Is there a gap in the product that you think should be filled?
|
||||
|
||||
## 2. Help Triage Issues
|
||||
|
||||
Watch the repository you're interested in. Join [an Affinity Team](https://teams.jekyllrb.com) and receive mentions regarding a particular interest area of the project. When you receive a notification for an issue that has not been triaged by a maintainer, dive in. Can you reproduce the issue? Can you determine the fix? [More tips on Triaging an Issue in our maintainer guide](triaging-an-issue.md). Every maintainer loves an issue that is resolved before they get to it. :smiley:
|
||||
|
||||
## 3. Write Documentation
|
||||
|
||||
Good documentation means less confusion for our users and fewer issues to triage. Documentation is always in need of fixes and updates as we change the code. Read through the documentation during your normal usage of the product and submit changes as you feel they are necessary.
|
||||
|
||||
## 4. Write Code
|
||||
|
||||
As a maintainer, you will be reviewing pull requests which update code. You should feel comfortable with the Jekyll codebase enough to confidently review any pull request put forward. In order to become more comfortable, write some code of your own and send a pull request. A great place to start is with any issue labeled "bug" in the issue tracker. Write a test which replicates the problem and fails, then work on fixing the code such that the test passes.
|
||||
|
||||
## 5. Review Pull Requests
|
||||
|
||||
Start by reviewing one pull request a week. Leave detailed comments and [follow our guide for reviewing pull requests](reviewing-a-pull-request.md).
|
||||
|
||||
## 6. Ask!
|
||||
|
||||
Open an issue describing your contributions to the project and why you wish to be a maintainer. Issues are nice because you can easily reference where you have demonstrated that you help triage issues, write code & documentation, and review pull requests. You may also email any maintainer privately if you do not feel comfortable asking in the open.
|
||||
|
||||
We would love to expand the team and look forward to many more community members becoming maintainers!
|
||||
|
||||
# Helping Out Elsewhere
|
||||
|
||||
In addition to maintainers of our core and plugin code, the Jekyll team is comprised of moderators for our forums. These helpful community members take a look at the topics posted to https://help.jekyllrb.com and ensure they are properly categorized and are acceptable under our Code of Conduct. If you would like to be a moderator, email one of the maintainers with links to where you have answered questions and a request to be added as a moderator. More help is always welcome.
|
||||
50
docs/merging-a-pull-request.md
Normal file
50
docs/merging-a-pull-request.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Maintainers: Merging a Pull Request
|
||||
|
||||
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
## Code Review
|
||||
|
||||
All pull requests should be subject to code review. Code review is a [foundational value](https://blog.fullstory.com/what-we-learned-from-google-code-reviews-arent-just-for-catching-bugs-b125a13aa292) of good engineering teams. Besides providing validation of correctness, it promotes a sense of community and gives other maintainers understanding of all parts of the code base. In short, code review is crucial to a healthy open source project.
|
||||
|
||||
**Read our guide for [Reviewing a pull request](reviewing-a-pull-request.md) before merging.** Notably, the change must have tests if for code, and at least two maintainers must give it an OK.
|
||||
|
||||
## Merging
|
||||
|
||||
We have [a helpful little bot](https://github.com/jekyllbot) which we use to merge pull requests. We don't use the GitHub.com interface for two reasons:
|
||||
|
||||
1. You can't modify anything on mobile (e.g. titles, labels)
|
||||
2. Provide a consistent paper trail in the `History.markdown` file for each release
|
||||
|
||||
To merge a pull request, leave a comment thanking the contributor, then add the special merge request:
|
||||
|
||||
```text
|
||||
Thank you very much for your contribution. Folks like you make this project and community strong. :heart:
|
||||
|
||||
@jekyllbot: merge +dev
|
||||
```
|
||||
|
||||
The merge request is made up of three things:
|
||||
|
||||
1. `@jekyllbot:` – this is the prefix our bot looks for when processing commands
|
||||
2. `merge` – the command
|
||||
3. `+dev` – the category to which the changes belong
|
||||
|
||||
The categories match the H3's in the history/changelog file, and they are:
|
||||
|
||||
1. Major Enhancements (`+major`) – major updates or breaking changes to the code which necessitate a major version bump (v3 ~> v4)
|
||||
2. Minor Enhancements (`+minor`) – minor updates (feature, enhancement) which necessitate a minor version bump (v3.1 ~> v3.2)
|
||||
3. Bug Fixes (`+bug`) – corrections to code which do not change or add functionality, which necessitate a patch version bump (v3.1.0 ~> v3.1.1)
|
||||
4. Site Enhancements (`+site`) – changes to the source of https://jekyllrb.com, found in `site/`
|
||||
5. Development Fixes (`+dev`) – changes which do not affect user-facing functionality or documentation, such as test fixes or bumping internal dependencies
|
||||
|
||||
Once @jekyllbot has merged the pull request, you should see three things:
|
||||
|
||||
1. A successful merge
|
||||
2. Addition of labels for the necessary category if they aren't already applied
|
||||
3. A commit to the `History.markdown` file which adds a note about the change
|
||||
|
||||
If you forget the category, that's just fine. You can always go back and move the line to the proper category header later. The category is always necessary for `jekyll/jekyll`, but many plugins have too few changes to necessitate changelog categories.
|
||||
|
||||
## Rejoice
|
||||
|
||||
You did it! Thanks for being a maintainer for one of our official Jekyll projects. Your work means the world to our thousands of users who rely on Jekyll daily. :heart:
|
||||
13
docs/readme.md
Normal file
13
docs/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Maintaining Jekyll
|
||||
|
||||
Hello! This is where we document various processes for maintaining Jekyll. Being a maintainer for any Jekyll project is a big responsibility, so we put together some helpful documentation for various tasks you might do as a maintainer.
|
||||
|
||||
1. [Triaging and issue](triaging-an-issue.md)
|
||||
2. [Reviewing a pull request](reviewing-a-pull-request.md)
|
||||
3. [Merging a pull request](merging-a-pull-request.md)
|
||||
4. [Avoiding burnout](avoiding-burnout.md)
|
||||
5. [Special Labels](special-labels.md)
|
||||
|
||||
Interested in becoming a maintainer? Here is some documentation for **contributors**:
|
||||
|
||||
1. [Becoming a maintainer](becoming-a-maintainer.md)
|
||||
44
docs/reviewing-a-pull-request.md
Normal file
44
docs/reviewing-a-pull-request.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Maintainers: Reviewing a Pull Request
|
||||
|
||||
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
## Respond Kindly
|
||||
|
||||
Above all else, please review a pull request kindly. Our community can only be strong if we make it a welcoming and inclusive environment. To further promote this, the Jekyll community is governed by a [Code of Conduct](../CONDUCT.markdown) by which all community members must abide.
|
||||
|
||||
Use emoji liberally :heart: :tada: :sparkles: :confetti_ball: and feel free to be emotive!! Contributions keep this project moving forward and we're always happy to receive them, even if the pull request isn't ultimately merged.
|
||||
|
||||
Mike McQuaid's post on the GitHub blog entitled ["Kindly Closing Pull Requests"](https://github.com/blog/2124-kindly-closing-pull-requests) is a great place to start. It describes various scenarios in which it would be acceptable to close a pull request for reasons other than lack of technical integrity or accuracy. Part of being kind is responding to and resolving pull requests quickly.
|
||||
|
||||
## Respond Quickly
|
||||
|
||||
We should be able to review all pull requests within one week. The only time initial review should take longer is if all the maintainers mysteriously took vacation during the same week. Promptness encourages frequent, high-quality contributions from community members and other maintainers.
|
||||
|
||||
If your response requires a response on the part of the author, please add the `pending-feedback` tag. @jekyllbot will automatically remove the tag once the author of the pull request responds.
|
||||
|
||||
## Resolve Quickly
|
||||
|
||||
Similarly, we should aim to resolve pull requests quickly. If a pull request introduces a feature which does not fit into the core purpose or goal of the project, close it promptly with a kind explanation of why it is not acceptable.
|
||||
|
||||
Leave detailed comments wherever possible. Provide the contributor with context around why the change you are requesting is necessary, or why the question you are asking is important to resolve. The more context we can clearly communicate to the contributor, the better able the contributor is to provide high-quality patches.
|
||||
|
||||
You may close a pull request if more than 30 days pass without a response from the author.
|
||||
|
||||
In some cases, review will involve many weeks of back-and-forth. As long as communication continues, this is fine. Ideally, any PR would be capable of resolution within 30 days of it being opened.
|
||||
|
||||
## Look for Tests
|
||||
|
||||
If this is a code change, are there tests for the updated or added behaviour? Shipping a version with bugs is inevitable, but ensuring changes are tested helps keep bugs and regressions to a minimum.
|
||||
|
||||
## CI Must Pass
|
||||
|
||||
It is fine to ask a contributor to investigate failures on Travis and patch them up before you begin your review. It is helpful to leave a message for the contributor indicating that the tests have failed and that no review will occur before the tests pass. If they ask for help, take a look and assist if you can.
|
||||
|
||||
## Rule of Two
|
||||
|
||||
A pull request may be merged once two maintainers have reviewed the pull request and indicated that it is acceptable to them. There is no need to wait for a third unless one of the two reviewers wishes for another set of eyes.
|
||||
|
||||
## Think Security
|
||||
|
||||
We owe it to our users to ensure that using a theme from the community or building someone else's site doesn't come with built-in security vulnerabilities. Things like where files may be read from and written to are important to keep secure. Jekyll is also the basis for hosted services such as [GitHub Pages](https://pages.github.com), which cannot upgrade when security issues are introduced.
|
||||
|
||||
17
docs/special-labels.md
Normal file
17
docs/special-labels.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Maintainers: Special Labels
|
||||
|
||||
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
We use a series of "special labels" on GitHub.com to automate handling of some parts of the pull request and issue process. @jekyllbot may automatically apply or remove certain labels based on actions taken by users or maintainers. Below are the labels and how they work:
|
||||
|
||||
## `pending-feedback`
|
||||
|
||||
This label is used to indicate that we need more information from the issue/PR author in order to continue. It may be that you need more info before you can properly triage a bug report, or that you have some unanswered questions about a PR that need to be resolved before moving forward. You can safely ignore any issue with this label, as it is waiting for feedback.
|
||||
|
||||
## `needs-work` & `pending-rebase`
|
||||
|
||||
These labels are used to indicate that the Git state of a pull request must change. Both are removed once a push is registered (a "synchronize" event for the pull request) and the pull request becomes mergable. Add `needs-work` to a PR if, after your review, it requires code changes. Add `pending-rebase` to a PR if the code is fine but the branch is not automatically mergable with the target branch (e.g. `master`).
|
||||
|
||||
## `stale`
|
||||
|
||||
This label is automatically added and removed by @jekyllbot based on activity on an issue or pull request. The rules for this label are laid out in [Triaging an Issue: Staleness and automatic closure](triaging-an-issue.md#staleness-and-automatic-closure).
|
||||
51
docs/triaging-an-issue.md
Normal file
51
docs/triaging-an-issue.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Maintainers: Triaging an Issue
|
||||
|
||||
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone.
|
||||
|
||||
Before evaluating an issue, it is important to identify if it is a feature
|
||||
request or a bug. For the Jekyll project the following definitions are used
|
||||
to identify a feature or a bug:
|
||||
|
||||
**Feature** - A feature is defined as a request that adds functionality to
|
||||
Jekyll outside of its current capabilities.
|
||||
**Bug** - A bug is defined as an issue that identifies an error that a user
|
||||
(or users) encounter when using current Jekyll functionalities.
|
||||
|
||||
## Feature?
|
||||
|
||||
If the issue describes a feature request, ask:
|
||||
|
||||
1. Is this a setting? [Settings are a crutch](http://ben.balter.com/2016/03/08/optimizing-for-power-users-and-edge-cases/#settings-are-a-crutch) for doing "the right thing". Settings usually point to a bad default or an edge case that could be solved easily with a plugin. Keep the :christmas_tree: of settings as small as possible so as not to reduce the usability of the product. We like the philosophy "decisions not options."
|
||||
2. Would at least 80% of users find it useful? If even a quarter of our users won't use it, it's very likely that the request doesn't fit our product's core goal.
|
||||
3. Is there another way to accomplish the end goal of the request? Most feature requests are due to bad documentation for or understanding of a pre-existing feature. See if you can clarify the end goal of the request. What is the user trying to do? Could they accomplish that goal through another feature we already support?
|
||||
4. Even if 80% of our users will use it, does it fit the core goal of our project? We are writing a tool for making static websites, not a swiss army knife for publishing more generally.
|
||||
|
||||
Feel free to get others' opinions and ask questions of the issue author, but depending upon the answers to the questions above, it may be out of scope for our project.
|
||||
|
||||
If the request is within scope, prioritize it on the product roadmap with the other maintainers. Apply the appropriate tags and ensure the right people have weighed in to define the feature's scope and implementation. If you want to be the _best ever_, submit a PR yourself which adds the feature.
|
||||
|
||||
## Bug?
|
||||
|
||||
### Reproducibility
|
||||
|
||||
If the bug has clear reproduction steps, take a minute to try them. If it helps, write a test in our test suite for the scenario which replicates the problem. Can you reliably replicate the issue?
|
||||
|
||||
If you can't replicate the issue, post your replication steps which didn't work and ask for clarification from the issue author.
|
||||
|
||||
### Supported Platform
|
||||
|
||||
Is the author using a supported platform? We support the latest versions of macOS, Ubuntu, Debian, CentOS, Fedora, and Arch Linux.
|
||||
|
||||
You may close the issue immediately if the author cannot reproduce the issue on a supported platform. For Windows-related problems, leave a comment letting the user know that Windows is not officially supported, but that they may absolutely continue using the issue to communicate with folks from `@jekyll/windows` to further investigate. Additionally, you can point them to Jekyll Talk (https://talk.jekyllrb.com) as a means of getting support from the community.
|
||||
|
||||
If the user is experiencing issues with GitHub Pages or another hosted platform that we cannot reproduce, please direct them to the platform's support channel and close the issue.
|
||||
|
||||
### What they wanted vs. what they got
|
||||
|
||||
An issue without a clear explanation of what the user got and what they were expecting to get is not an issue we can accurately respond to. If the user doesn't provide this information, please ask for clarification and apply the `pending-feedback` label. This information helps us build test cases such that we do not break the behaviour again in the future. The `pending-feedback` label will be removed automatically once the issue author posts a reply.
|
||||
|
||||
Is what they wanted to get something we want to happen? Sometimes a bug report is actually masquerading as a feature request. See the guidance above for handling feature requests.
|
||||
|
||||
### Staleness and automatic closure
|
||||
|
||||
@jekyllbot will automatically mark issues as `stale` if no activity occurs for at least one month. @jekyllbot leaves a comment asking for information about reproducibility in current versions. If no one responds after another month, the issue is automatically closed.
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env ruby
|
||||
STDOUT.sync = true
|
||||
|
||||
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
||||
|
||||
require 'jekyll'
|
||||
require 'mercenary'
|
||||
require "jekyll"
|
||||
require "mercenary"
|
||||
|
||||
Jekyll::PluginManager.require_from_bundler
|
||||
|
||||
@@ -12,22 +12,26 @@ Jekyll::Deprecator.process(ARGV)
|
||||
|
||||
Mercenary.program(:jekyll) do |p|
|
||||
p.version Jekyll::VERSION
|
||||
p.description 'Jekyll is a blog-aware, static site generator in Ruby'
|
||||
p.syntax 'jekyll <subcommand> [options]'
|
||||
p.description "Jekyll is a blog-aware, static site generator in Ruby"
|
||||
p.syntax "jekyll <subcommand> [options]"
|
||||
|
||||
p.option 'source', '-s', '--source [DIR]', 'Source directory (defaults to ./)'
|
||||
p.option 'destination', '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
|
||||
p.option 'safe', '--safe', 'Safe mode (defaults to false)'
|
||||
p.option 'plugins_dir', '-p', '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
|
||||
p.option 'layouts_dir', '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
|
||||
p.option 'profile', '--profile', 'Generate a Liquid rendering profile'
|
||||
p.option "source", "-s", "--source [DIR]", "Source directory (defaults to ./)"
|
||||
p.option "destination", "-d", "--destination [DIR]",
|
||||
"Destination directory (defaults to ./_site)"
|
||||
p.option "safe", "--safe", "Safe mode (defaults to false)"
|
||||
p.option "plugins_dir", "-p", "--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]", Array,
|
||||
"Plugins directory (defaults to ./_plugins)"
|
||||
p.option "layouts_dir", "--layouts DIR", String,
|
||||
"Layouts directory (defaults to ./_layouts)"
|
||||
p.option "profile", "--profile", "Generate a Liquid rendering profile"
|
||||
|
||||
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
|
||||
cmd = g.split('-').last
|
||||
cmd = g.split("-").last
|
||||
p.command(cmd.to_sym) do |c|
|
||||
c.syntax cmd
|
||||
c.action do
|
||||
Jekyll.logger.abort_with "You must install the '#{g}' gem to use the 'jekyll #{cmd}' command."
|
||||
Jekyll.logger.abort_with "You must install the '#{g}' gem" \
|
||||
" to use the 'jekyll #{cmd}' command."
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,6 @@ Feature: Collections
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Collections: <p>Use <code class=\"highlighter-rouge\">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 class=\"highlighter-rouge\">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
|
||||
@@ -77,8 +76,8 @@ Feature: Collections
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
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"
|
||||
Then the _site directory should exist
|
||||
And I should see "Collections: _methods/collection/entries _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 %}"
|
||||
@@ -90,8 +89,8 @@ Feature: Collections
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
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"
|
||||
Then the _site directory should exist
|
||||
And I should see "Collections: _methods/collection/entries _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 %}"
|
||||
@@ -103,11 +102,11 @@ Feature: Collections
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
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"
|
||||
Then the _site directory should exist
|
||||
And I should see "All documents: _methods/collection/entries _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 }}"
|
||||
Given I have an "index.html" page that contains "Second document's output: {{ site.documents[1].output }}"
|
||||
And I have fixture collections
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
@@ -116,8 +115,8 @@ Feature: Collections
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "First document's output: <p>Use <code class=\"highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
|
||||
Then the _site directory should exist
|
||||
And I should see "Second document's output: <p>Use <code class=\"highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
|
||||
|
||||
Scenario: Filter documents by where
|
||||
Given I have an "index.html" page that contains "{% assign items = site.methods | where: 'whatever','foo.bar' %}Item count: {{ items.size }}"
|
||||
@@ -133,7 +132,7 @@ Feature: Collections
|
||||
And I should see "Item count: 2" in "_site/index.html"
|
||||
|
||||
Scenario: Sort by title
|
||||
Given I have an "index.html" page that contains "{% assign items = site.methods | sort: 'title' %}1. of {{ items.size }}: {{ items.first.output }}"
|
||||
Given I have an "index.html" page that contains "{% assign items = site.methods | sort: 'title' %}2. of {{ items.size }}: {{ items[1].output }}"
|
||||
And I have fixture collections
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
@@ -143,10 +142,10 @@ Feature: Collections
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "1. of 7: <p>Page without title.</p>" in "_site/index.html"
|
||||
And I should see "2. of 8: <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 %}"
|
||||
Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{{ methods | map:"title" | join: ", " }}"
|
||||
And I have fixture collections
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
@@ -156,7 +155,7 @@ Feature: Collections
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
Then the _site directory should exist
|
||||
And I should see "Collections: Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, Initialize, Site#generate, YAML with Dots," in "_site/index.html"
|
||||
And I should see "Collections: Collection#entries, Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, Initialize, Site#generate," in "_site/index.html"
|
||||
|
||||
Scenario: Rendered collection with date/dateless filename
|
||||
Given I have an "index.html" page that contains "Collections: {% for method in site.thanksgiving %}{{ method.title }} {% endfor %}"
|
||||
|
||||
@@ -186,3 +186,20 @@ Feature: Create sites
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/2020/12/31/entry1.html" file should exist
|
||||
|
||||
Scenario: Basic site with layouts, posts and related posts
|
||||
Given I have a _layouts directory
|
||||
And I have a page layout that contains "Page {{ page.title }}: {{ content }}"
|
||||
And I have a post layout that contains "Post {{ page.title }}: {{ content }}Related posts: {{ site.related_posts | size }}"
|
||||
And I have an "index.html" page with layout "page" that contains "Site contains {{ site.pages.size }} pages and {{ site.posts.size }} posts; Related posts: {{ site.related_posts | size }}"
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
| entry1 | 2009-03-27 | post | content for entry1. |
|
||||
| entry2 | 2009-04-27 | post | content for entry2. |
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Page : Site contains 1 pages and 2 posts; Related posts: 0" in "_site/index.html"
|
||||
And I should see "Post entry1: <p>content for entry1.</p>\nRelated posts: 1" in "_site/2009/03/27/entry1.html"
|
||||
And I should see "Post entry2: <p>content for entry2.</p>\nRelated posts: 1" in "_site/2009/04/27/entry2.html"
|
||||
|
||||
@@ -63,6 +63,18 @@ Feature: Embed filters
|
||||
And the _site directory should exist
|
||||
And I should see "By <p><em>Obi-wan</em></p>" in "_site/2009/03/27/star-wars.html"
|
||||
|
||||
Scenario: Markdownify a given inline string
|
||||
Given I have a _posts directory
|
||||
And I have a _layouts directory
|
||||
And I have the following post:
|
||||
| title | date | layout | content |
|
||||
| Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
|
||||
And I have a default layout that contains "By {{ '_Obi-wan_' | markdownify:'inline' }}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "By <em>Obi-wan</em>" in "_site/2009/03/27/star-wars.html"
|
||||
|
||||
Scenario: Sort by an arbitrary variable
|
||||
Given I have a _layouts directory
|
||||
And I have the following page:
|
||||
|
||||
@@ -80,6 +80,26 @@ Feature: frontmatter defaults
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about1.html</p>" in "_site/special/2013/10/14/about1.html"
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about2.html</p>" in "_site/special/2013/10/14/about2.html"
|
||||
|
||||
Scenario: Use frontmatter scopes for subdirectories
|
||||
Given I have a _layouts directory
|
||||
And I have a main layout that contains "main: {{ content }}"
|
||||
|
||||
And I have a _posts/en directory
|
||||
And I have the following post under "en":
|
||||
| title | date | content |
|
||||
| helloworld | 2014-09-01 | {{page.lang}} is the current language |
|
||||
And I have a _posts/de directory
|
||||
And I have the following post under "de":
|
||||
| title | date | content |
|
||||
| hallowelt | 2014-09-01 | {{page.lang}} is the current language |
|
||||
|
||||
And I have a configuration file with "defaults" set to "[{scope: {path: "_posts/en"}, values: {layout: "main", lang: "en"}}, {scope: {path: "_posts/de"}, values: {layout: "main", lang: "de"}}]"
|
||||
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "main: <p>en is the current language</p>" in "_site/2014/09/01/helloworld.html"
|
||||
And I should see "main: <p>de is the current language</p>" in "_site/2014/09/01/hallowelt.html"
|
||||
|
||||
Scenario: Override frontmatter defaults by type
|
||||
Given I have a _posts directory
|
||||
And I have the following post:
|
||||
|
||||
33
features/highlighting.feature
Normal file
33
features/highlighting.feature
Normal file
@@ -0,0 +1,33 @@
|
||||
Feature: Syntax Highlighting
|
||||
As a hacker who likes to blog
|
||||
I want to share code snippets in my blog
|
||||
And make them pretty for all the world to see
|
||||
|
||||
Scenario: highlighting an apache configuration
|
||||
Given I have an "index.html" file with content:
|
||||
"""
|
||||
---
|
||||
---
|
||||
|
||||
{% highlight apache %}
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
{% endhighlight %}
|
||||
|
||||
```apache
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
```
|
||||
"""
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
kramdown:
|
||||
input: GFM
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit-status
|
||||
And I should see "<span class="nc">RewriteCond</span>" in "_site/index.html"
|
||||
@@ -235,7 +235,7 @@ Feature: Hooks
|
||||
owner.output = "1 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render, priority: :high do |owner|
|
||||
# high runs last
|
||||
# high runs first
|
||||
owner.output = "2 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render do |owner|
|
||||
@@ -243,13 +243,13 @@ Feature: Hooks
|
||||
owner.output = "3 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render, priority: :low do |owner|
|
||||
# low runs first
|
||||
# low runs last
|
||||
owner.output = "4 #{owner.output.chomp}"
|
||||
end
|
||||
"""
|
||||
And I have a "index.html" page that contains "WRAP ME"
|
||||
When I run jekyll build
|
||||
Then I should see "2 3 1 4 WRAP ME" in "_site/index.html"
|
||||
Then I should see "4 3 1 2 WRAP ME" in "_site/index.html"
|
||||
|
||||
Scenario: Alter a document right after it is initialized
|
||||
Given I have a _plugins directory
|
||||
@@ -333,3 +333,28 @@ Feature: Hooks
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Wrote document 0" in "_site/document-build.log"
|
||||
|
||||
Scenario: Set a custom payload['page'] property
|
||||
Given I have a _plugins directory
|
||||
And I have a "_plugins/ext.rb" file with content:
|
||||
"""
|
||||
Jekyll::Hooks.register :pages, :pre_render do |page, payload|
|
||||
payload['page']['foo'] = "hello world"
|
||||
end
|
||||
"""
|
||||
And I have a _layouts directory
|
||||
And I have a "_layouts/custom.html" file with content:
|
||||
"""
|
||||
---
|
||||
---
|
||||
{{ content }} {% include foo.html %}
|
||||
"""
|
||||
And I have a _includes directory
|
||||
And I have a "_includes/foo.html" file with content:
|
||||
"""
|
||||
{{page.foo}}
|
||||
"""
|
||||
And I have an "index.html" page with layout "custom" that contains "page content"
|
||||
When I run jekyll build
|
||||
Then the "_site/index.html" file should exist
|
||||
And I should see "page content\n hello world" in "_site/index.html"
|
||||
|
||||
@@ -35,3 +35,36 @@ Feature: Layout data
|
||||
When I run jekyll build
|
||||
Then the "_site/index.html" file should exist
|
||||
And I should see "page content\n foo: my custom data" in "_site/index.html"
|
||||
|
||||
Scenario: Inherit custom layout data and clear when not present
|
||||
Given I have a _layouts directory
|
||||
And I have a "_layouts/default.html" file with content:
|
||||
"""
|
||||
---
|
||||
bar: i'm default
|
||||
---
|
||||
{{ content }} foo: '{{ layout.foo }}' bar: '{{ layout.bar }}'
|
||||
"""
|
||||
And I have a "_layouts/special.html" file with content:
|
||||
"""
|
||||
---
|
||||
layout: default
|
||||
foo: my special data
|
||||
bar: im special
|
||||
---
|
||||
{{ content }}
|
||||
"""
|
||||
And I have a "_layouts/page.html" file with content:
|
||||
"""
|
||||
---
|
||||
layout: default
|
||||
bar: im page
|
||||
---
|
||||
{{ content }}
|
||||
"""
|
||||
And I have an "index.html" page with layout "special" that contains "page content"
|
||||
And I have an "jekyll.html" page with layout "page" that contains "page content"
|
||||
When I run jekyll build
|
||||
Then the "_site/index.html" file should exist
|
||||
And I should see "page content\n foo: 'my special data' bar: 'im special'" in "_site/index.html"
|
||||
And I should see "page content\n foo: '' bar: 'im page'" in "_site/jekyll.html"
|
||||
|
||||
@@ -161,8 +161,8 @@ Feature: Site configuration
|
||||
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
||||
And I have an "index.html" page with layout "page" that contains "site index page"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| timezone | America/New_York |
|
||||
| key | value |
|
||||
| timezone | UTC+04:00 |
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
@@ -181,8 +181,8 @@ Feature: Site configuration
|
||||
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
||||
And I have an "index.html" page with layout "page" that contains "site index page"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| timezone | Pacific/Honolulu |
|
||||
| key | value |
|
||||
| timezone | UTC+10:00 |
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Before do
|
||||
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
|
||||
FileUtils.mkdir_p(Paths.test_dir) unless Paths.test_dir.directory?
|
||||
Dir.chdir(Paths.test_dir)
|
||||
end
|
||||
@@ -6,7 +7,7 @@ end
|
||||
#
|
||||
|
||||
After do
|
||||
Paths.test_dir.rmtree if Paths.test_dir.exist?
|
||||
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
|
||||
Paths.output_file.delete if Paths.output_file.exist?
|
||||
Paths.status_file.delete if Paths.status_file.exist?
|
||||
Dir.chdir(Paths.test_dir.parent)
|
||||
@@ -14,24 +15,24 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have a blank site in "(.*)"$} do |path|
|
||||
if !File.exist?(path)
|
||||
Given(%r!^I have a blank site in "(.*)"$!) do |path|
|
||||
unless File.exist?(path)
|
||||
then FileUtils.mkdir_p(path)
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I do not have a "(.*)" directory$} do |path|
|
||||
Given(%r!^I do not have a "(.*)" directory$!) do |path|
|
||||
Paths.test_dir.join(path).directory?
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$} do |file, key, value, text|
|
||||
Given(%r!^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$!) do |file, key, value, text|
|
||||
File.write(file, Jekyll::Utils.strip_heredoc(<<-DATA))
|
||||
---
|
||||
#{key || 'layout'}: #{value || 'nil'}
|
||||
#{key || "layout"}: #{value || "nil"}
|
||||
---
|
||||
|
||||
#{text}
|
||||
@@ -40,13 +41,13 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have an? "(.*)" file that contains "(.*)"$} do |file, text|
|
||||
Given(%r!^I have an? "(.*)" file that contains "(.*)"$!) do |file, text|
|
||||
File.write(file, text)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have an? (.*) (layout|theme) that contains "(.*)"$} do |name, type, text|
|
||||
Given(%r!^I have an? (.*) (layout|theme) that contains "(.*)"$!) do |name, type, text|
|
||||
folder = type == "layout" ? "_layouts" : "_theme"
|
||||
|
||||
destination_file = Pathname.new(File.join(folder, "#{name}.html"))
|
||||
@@ -56,33 +57,33 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have an? "(.*)" file with content:$} do |file, text|
|
||||
Given(%r!^I have an? "(.*)" file with content:$!) do |file, text|
|
||||
File.write(file, text)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have an? (.*) directory$} do |dir|
|
||||
if !File.directory?(dir)
|
||||
Given(%r!^I have an? (.*) directory$!) do |dir|
|
||||
unless File.directory?(dir)
|
||||
then FileUtils.mkdir_p(dir)
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have the following (draft|page|post)s?(?: (in|under) "([^"]+)")?:$} do |status, direction, folder, table|
|
||||
Given(%r!^I have the following (draft|page|post)s?(?: (in|under) "([^"]+)")?:$!) do |status, direction, folder, table|
|
||||
table.hashes.each do |input_hash|
|
||||
title = slug(input_hash["title"])
|
||||
ext = input_hash["type"] || "markdown"
|
||||
filename = filename = "#{title}.#{ext}" if %w(draft page).include?(status)
|
||||
filename = "#{title}.#{ext}" if %w(draft page).include?(status)
|
||||
before, after = location(folder, direction)
|
||||
dest_folder = "_drafts" if status == "draft"
|
||||
dest_folder = "_posts" if status == "post"
|
||||
dest_folder = "_posts" if status == "post"
|
||||
dest_folder = "" if status == "page"
|
||||
|
||||
if status == "post"
|
||||
parsed_date = Time.xmlschema(input_hash['date']) rescue Time.parse(input_hash['date'])
|
||||
filename = "#{parsed_date.strftime('%Y-%m-%d')}-#{title}.#{ext}"
|
||||
parsed_date = Time.xmlschema(input_hash["date"]) rescue Time.parse(input_hash["date"])
|
||||
filename = "#{parsed_date.strftime("%Y-%m-%d")}-#{title}.#{ext}"
|
||||
end
|
||||
|
||||
path = File.join(before, dest_folder, after, filename)
|
||||
@@ -92,19 +93,20 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have a configuration file with "(.*)" set to "(.*)"$} do |key, value|
|
||||
config = if source_dir.join("_config.yml").exist?
|
||||
SafeYAML.load_file(source_dir.join("_config.yml"))
|
||||
else
|
||||
{}
|
||||
end
|
||||
Given(%r!^I have a configuration file with "(.*)" set to "(.*)"$!) do |key, value|
|
||||
config = \
|
||||
if source_dir.join("_config.yml").exist?
|
||||
SafeYAML.load_file(source_dir.join("_config.yml"))
|
||||
else
|
||||
{}
|
||||
end
|
||||
config[key] = YAML.load(value)
|
||||
File.write("_config.yml", YAML.dump(config))
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have a configuration file with:$} do |table|
|
||||
Given(%r!^I have a configuration file with:$!) do |table|
|
||||
table.hashes.each do |row|
|
||||
step %(I have a configuration file with "#{row["key"]}" set to "#{row["value"]}")
|
||||
end
|
||||
@@ -112,7 +114,7 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have a configuration file with "([^\"]*)" set to:$} do |key, table|
|
||||
Given(%r!^I have a configuration file with "([^\"]*)" set to:$!) do |key, table|
|
||||
File.open("_config.yml", "w") do |f|
|
||||
f.write("#{key}:\n")
|
||||
table.hashes.each do |row|
|
||||
@@ -123,20 +125,20 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I have fixture collections$} do
|
||||
Given(%r!^I have fixture collections$!) do
|
||||
FileUtils.cp_r Paths.source_dir.join("test", "source", "_methods"), source_dir
|
||||
FileUtils.cp_r Paths.source_dir.join("test", "source", "_thanksgiving"), source_dir
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given %r{^I wait (\d+) second(s?)$} do |time, plural|
|
||||
Given(%r!^I wait (\d+) second(s?)$!) do |time, _|
|
||||
sleep(time.to_f)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
When %r{^I run jekyll(.*)$} do |args|
|
||||
When(%r!^I run jekyll(.*)$!) do |args|
|
||||
run_jekyll(args)
|
||||
if args.include?("--verbose") || ENV["DEBUG"]
|
||||
$stderr.puts "\n#{jekyll_run_output}\n"
|
||||
@@ -145,16 +147,16 @@ end
|
||||
|
||||
#
|
||||
|
||||
When %r{^I run bundle(.*)$} do |args|
|
||||
When(%r!^I run bundle(.*)$!) do |args|
|
||||
run_bundle(args)
|
||||
if args.include?("--verbose") || ENV['DEBUG']
|
||||
if args.include?("--verbose") || ENV["DEBUG"]
|
||||
$stderr.puts "\n#{jekyll_run_output}\n"
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
When %r{^I change "(.*)" to contain "(.*)"$} do |file, text|
|
||||
When(%r!^I change "(.*)" to contain "(.*)"$!) do |file, text|
|
||||
File.open(file, "a") do |f|
|
||||
f.write(text)
|
||||
end
|
||||
@@ -162,13 +164,13 @@ end
|
||||
|
||||
#
|
||||
|
||||
When %r{^I delete the file "(.*)"$} do |file|
|
||||
When(%r!^I delete the file "(.*)"$!) do |file|
|
||||
File.delete(file)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^the (.*) directory should +(not )?exist$} do |dir, negative|
|
||||
Then(%r!^the (.*) directory should +(not )?exist$!) do |dir, negative|
|
||||
if negative.nil?
|
||||
expect(Pathname.new(dir)).to exist
|
||||
else
|
||||
@@ -177,7 +179,7 @@ Then %r{^the (.*) directory should +(not )?exist$} do |dir, negative|
|
||||
end
|
||||
|
||||
#
|
||||
Then %r{^I should (not )?see "(.*)" in "(.*)"$} do |negative, text, file|
|
||||
Then(%r!^I should (not )?see "(.*)" in "(.*)"$!) do |negative, text, file|
|
||||
step %(the "#{file}" file should exist)
|
||||
regexp = Regexp.new(text, Regexp::MULTILINE)
|
||||
if negative.nil? || negative.empty?
|
||||
@@ -189,20 +191,20 @@ end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should see exactly "(.*)" in "(.*)"$} do |text, file|
|
||||
Then(%r!^I should see exactly "(.*)" in "(.*)"$!) do |text, file|
|
||||
step %(the "#{file}" file should exist)
|
||||
expect(file_contents(file).strip).to eq text
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should see escaped "(.*)" in "(.*)"$} do |text, file|
|
||||
Then(%r!^I should see escaped "(.*)" in "(.*)"$!) do |text, file|
|
||||
step %(I should see "#{Regexp.escape(text)}" in "#{file}")
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^the "(.*)" file should +(not )?exist$} do |file, negative|
|
||||
Then(%r!^the "(.*)" file should +(not )?exist$!) do |file, negative|
|
||||
if negative.nil?
|
||||
expect(Pathname.new(file)).to exist
|
||||
else
|
||||
@@ -212,19 +214,19 @@ end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should see today's time in "(.*)"$} do |file|
|
||||
Then(%r!^I should see today's time in "(.*)"$!) do |file|
|
||||
step %(I should see "#{seconds_agnostic_time(Time.now)}" in "#{file}")
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should see today's date in "(.*)"$} do |file|
|
||||
step %(I should see "#{Date.today.to_s}" in "#{file}")
|
||||
Then(%r!^I should see today's date in "(.*)"$!) do |file|
|
||||
step %(I should see "#{Date.today}" in "#{file}")
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should (not )?see "(.*)" in the build output$} do |negative, text|
|
||||
Then(%r!^I should (not )?see "(.*)" in the build output$!) do |negative, text|
|
||||
if negative.nil? || negative.empty?
|
||||
expect(jekyll_run_output).to match Regexp.new(text)
|
||||
else
|
||||
@@ -234,12 +236,12 @@ end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should get a zero exit(?:\-| )status$} do
|
||||
Then(%r!^I should get a zero exit(?:\-| )status$!) do
|
||||
step %(I should see "EXIT STATUS: 0" in the build output)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then %r{^I should get a non-zero exit(?:\-| )status$} do
|
||||
Then(%r!^I should get a non-zero exit(?:\-| )status$!) do
|
||||
step %(I should not see "EXIT STATUS: 0" in the build output)
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'fileutils'
|
||||
require 'colorator'
|
||||
require 'cucumber/formatter/console'
|
||||
require 'cucumber/formatter/io'
|
||||
require "fileutils"
|
||||
require "colorator"
|
||||
require "cucumber/formatter/console"
|
||||
require "cucumber/formatter/io"
|
||||
|
||||
module Jekyll
|
||||
module Cucumber
|
||||
@@ -17,7 +17,7 @@ module Jekyll
|
||||
:undefined => "\u2718".red,
|
||||
:passed => "\u2714".green,
|
||||
:skipped => "\u203D".blue
|
||||
}
|
||||
}.freeze
|
||||
|
||||
#
|
||||
|
||||
@@ -30,11 +30,12 @@ module Jekyll
|
||||
@options = options
|
||||
@exceptions = []
|
||||
@indent = 0
|
||||
@timings = {}
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def before_features(features)
|
||||
def before_features(_features)
|
||||
print_profile_information
|
||||
end
|
||||
|
||||
@@ -42,33 +43,49 @@ module Jekyll
|
||||
|
||||
def after_features(features)
|
||||
@io.puts
|
||||
print_worst_offenders
|
||||
print_summary(features)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def before_feature(feature)
|
||||
def before_feature(_feature)
|
||||
@exceptions = []
|
||||
@indent = 0
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def tag_name(tag_name); end
|
||||
def comment_line(comment_line); end
|
||||
def after_feature_element(feature_element); end
|
||||
def after_tags(tags); end
|
||||
def feature_element_timing_key(feature_element)
|
||||
"\"#{feature_element.name.to_s.sub("Scenario: ", "")}\" (#{feature_element.location})"
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def before_feature_element(feature_element)
|
||||
@indent = 2
|
||||
@scenario_indent = 2
|
||||
@timings[feature_element_timing_key(feature_element)] = Time.now
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def before_background(background)
|
||||
def after_feature_element(feature_element)
|
||||
@timings[feature_element_timing_key(feature_element)] = Time.now - @timings[feature_element_timing_key(feature_element)]
|
||||
@io.print " (#{@timings[feature_element_timing_key(feature_element)]}s)"
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def tag_name(tag_name); end
|
||||
|
||||
def comment_line(comment_line); end
|
||||
|
||||
def after_tags(tags); end
|
||||
|
||||
#
|
||||
|
||||
def before_background(_background)
|
||||
@scenario_indent = 2
|
||||
@in_background = true
|
||||
@indent = 2
|
||||
@@ -76,15 +93,15 @@ module Jekyll
|
||||
|
||||
#
|
||||
|
||||
def after_background(background)
|
||||
def after_background(_background)
|
||||
@in_background = nil
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def background_name(keyword, name, source_line, indend)
|
||||
def background_name(keyword, name, source_line, indent)
|
||||
print_feature_element_name(
|
||||
keyword, name, source_line, indend
|
||||
keyword, name, source_line, indent
|
||||
)
|
||||
end
|
||||
|
||||
@@ -104,8 +121,9 @@ module Jekyll
|
||||
|
||||
#
|
||||
|
||||
def before_step_result(keyword, step_match, multiline_arg, status, exception, \
|
||||
source_indent, background, file_colon_line)
|
||||
# rubocop:disable Metrics/ParameterLists
|
||||
def before_step_result(_keyword, _step_match, _multiline_arg, status, exception, \
|
||||
_source_indent, background, _file_colon_line)
|
||||
|
||||
@hide_this_step = false
|
||||
if exception
|
||||
@@ -127,10 +145,11 @@ module Jekyll
|
||||
|
||||
#
|
||||
|
||||
def step_name(keyword, step_match, status, source_indent, background, file_colon_line)
|
||||
def step_name(_keyword, _step_match, status, _source_indent, _background, _file_colon_line)
|
||||
@io.print CHARS[status]
|
||||
@io.print " "
|
||||
end
|
||||
# rubocop:enable Metrics/ParameterLists
|
||||
|
||||
#
|
||||
|
||||
@@ -153,7 +172,7 @@ module Jekyll
|
||||
#
|
||||
|
||||
private
|
||||
def print_feature_element_name(keyword, name, source_line, indent)
|
||||
def print_feature_element_name(keyword, name, source_line, _indent)
|
||||
@io.puts
|
||||
|
||||
names = name.empty? ? [name] : name.each_line.to_a
|
||||
@@ -173,6 +192,17 @@ module Jekyll
|
||||
|
||||
#
|
||||
|
||||
def print_worst_offenders
|
||||
@io.puts
|
||||
@io.puts "Worst offenders:"
|
||||
@timings.sort_by { |_f, t| -t }.take(10).each do |(f, t)|
|
||||
@io.puts " #{t}s for #{f}"
|
||||
end
|
||||
@io.puts
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def print_summary(features)
|
||||
@io.puts
|
||||
print_stats(features, @options)
|
||||
|
||||
@@ -7,31 +7,36 @@ require "safe_yaml/load"
|
||||
class Paths
|
||||
SOURCE_DIR = Pathname.new(File.expand_path("../..", __dir__))
|
||||
def self.test_dir; source_dir.join("tmp", "jekyll"); end
|
||||
|
||||
def self.output_file; test_dir.join("jekyll_output.txt"); end
|
||||
|
||||
def self.status_file; test_dir.join("jekyll_status.txt"); end
|
||||
def self.jekyll_bin; source_dir.join("bin", "jekyll"); end
|
||||
|
||||
def self.jekyll_bin; source_dir.join("exe", "jekyll"); end
|
||||
|
||||
def self.source_dir; SOURCE_DIR; end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def file_content_from_hash(input_hash)
|
||||
matter_hash = input_hash.reject { |k, v| k == "content" }
|
||||
matter = matter_hash.map do |k, v| "#{k}: #{v}\n"
|
||||
matter_hash = input_hash.reject { |k, _v| k == "content" }
|
||||
matter = matter_hash.map do |k, v|
|
||||
"#{k}: #{v}\n"
|
||||
end
|
||||
|
||||
matter = matter.join.chomp
|
||||
content = \
|
||||
if !input_hash['input'] || !input_hash['filter']
|
||||
then input_hash['content']
|
||||
else "{{ #{input_hash['input']} | " \
|
||||
"#{input_hash['filter']} }}"
|
||||
end
|
||||
if !input_hash["input"] || !input_hash["filter"]
|
||||
then input_hash["content"]
|
||||
else "{{ #{input_hash["input"]} | " \
|
||||
"#{input_hash["filter"]} }}"
|
||||
end
|
||||
|
||||
Jekyll::Utils.strip_heredoc(<<-EOF)
|
||||
---
|
||||
#{matter.gsub(
|
||||
/\n/, "\n "
|
||||
%r!\n!, "\n "
|
||||
)}
|
||||
---
|
||||
#{content}
|
||||
@@ -78,27 +83,26 @@ end
|
||||
#
|
||||
|
||||
def run_bundle(args)
|
||||
run_in_shell("bundle", *args.strip.split(' '))
|
||||
run_in_shell("bundle", *args.strip.split(" "))
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def run_jekyll(args)
|
||||
args = args.strip.split(" ") # Shellwords?
|
||||
process = run_in_shell(Paths.jekyll_bin.to_s, *args, "--trace")
|
||||
process.exitstatus == 0
|
||||
process = run_in_shell("ruby", Paths.jekyll_bin.to_s, *args, "--trace")
|
||||
process.exitstatus.zero?
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def run_in_shell(*args)
|
||||
i, o, e, p = Open3.popen3(*args)
|
||||
out = o.read.strip
|
||||
err = e.read.strip
|
||||
|
||||
[i, o, e].each do |m|
|
||||
m.close
|
||||
end
|
||||
[i, o, e].each(&:close)
|
||||
|
||||
File.write(Paths.status_file, p.value.exitstatus)
|
||||
File.open(Paths.output_file, "wb") do |f|
|
||||
@@ -110,13 +114,14 @@ def run_in_shell(*args)
|
||||
|
||||
p.value
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
#
|
||||
|
||||
def slug(title = nil)
|
||||
if !title
|
||||
then Time.now.strftime("%s%9N") # nanoseconds since the Epoch
|
||||
else title.downcase.gsub(/[^\w]/, " ").strip.gsub(/\s+/, '-')
|
||||
else title.downcase.gsub(%r![^\w]!, " ").strip.gsub(%r!\s+!, "-")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -124,12 +129,12 @@ end
|
||||
|
||||
def location(folder, direction)
|
||||
if folder
|
||||
before = folder if direction == "in"
|
||||
before = folder if direction == "in"
|
||||
after = folder if direction == "under"
|
||||
end
|
||||
|
||||
[before || '.',
|
||||
after || '.']
|
||||
[before || ".",
|
||||
after || "."]
|
||||
end
|
||||
|
||||
#
|
||||
@@ -149,13 +154,13 @@ def seconds_agnostic_datetime(datetime = Time.now)
|
||||
"#{time}:\\d{2}",
|
||||
Regexp.escape(zone)
|
||||
] \
|
||||
.join("\\ ")
|
||||
.join("\\ ")
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def seconds_agnostic_time(time)
|
||||
time = time.strftime("%H:%M:%S") if time.is_a?(Time)
|
||||
hour, minutes, _ = time.split(":")
|
||||
hour, minutes, = time.split(":")
|
||||
"#{hour}:#{minutes}"
|
||||
end
|
||||
|
||||
72
features/theme.feature
Normal file
72
features/theme.feature
Normal file
@@ -0,0 +1,72 @@
|
||||
Feature: Writing themes
|
||||
As a hacker who likes to share my expertise
|
||||
I want to be able to make a gemified theme
|
||||
In order to share my awesome style skillz with other Jekyllites
|
||||
|
||||
Scenario: Generating a new theme scaffold
|
||||
When I run jekyll new-theme my-cool-theme
|
||||
Then I should get a zero exit status
|
||||
And the my-cool-theme directory should exist
|
||||
|
||||
Scenario: Generating a new theme scaffold with a code of conduct
|
||||
When I run jekyll new-theme my-cool-theme --code-of-conduct
|
||||
Then I should get a zero exit status
|
||||
And the my-cool-theme directory should exist
|
||||
And the "my-cool-theme/CODE_OF_CONDUCT.md" file should exist
|
||||
|
||||
Scenario: A theme with SCSS
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have a css directory
|
||||
And I have a "css/main.scss" page that contains "@import 'test-theme-black';"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see ".sample {\n color: black; }" in "_site/css/main.css"
|
||||
|
||||
Scenario: A theme with an include
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an _includes directory
|
||||
And I have an "_includes/in_project.html" file that contains "I'm in the project."
|
||||
And I have an "index.html" page that contains "{% include in_project.html %} {% include include.html %}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "I'm in the project." in "_site/index.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/index.html"
|
||||
|
||||
Scenario: A theme with a layout
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an _layouts directory
|
||||
And I have an "_layouts/post.html" file that contains "post.html from the project: {{ content }}"
|
||||
And I have an "index.html" page with layout "default" that contains "I'm content."
|
||||
And I have a "post.html" page with layout "post" that contains "I'm more content."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "default.html from test-theme: I'm content." in "_site/index.html"
|
||||
And I should see "post.html from the project: I'm more content." in "_site/post.html"
|
||||
|
||||
Scenario: Complicated site that puts it all together
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
| entry1 | 2016-04-21 | post | I am using a local layout. {% include include.html %} |
|
||||
| entry2 | 2016-04-21 | default | I am using a themed layout. {% include include.html %} {% include in_project.html %} |
|
||||
And I have a _layouts directory
|
||||
And I have a "_layouts/post.html" page with layout "default" that contains "I am a post layout! {{ content }}"
|
||||
And I have an _includes directory
|
||||
And I have an "_includes/in_project.html" file that contains "I am in the project, not the theme."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "I am in the project, not the theme." in "_site/2016/04/21/entry2.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry2.html"
|
||||
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry2.html"
|
||||
And I should see "I am using a themed layout." in "_site/2016/04/21/entry2.html"
|
||||
And I should not see "I am a post layout!" in "_site/2016/04/21/entry2.html"
|
||||
And I should not see "I am in the project, not the theme." in "_site/2016/04/21/entry1.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry1.html"
|
||||
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry1.html"
|
||||
And I should see "I am using a local layout." in "_site/2016/04/21/entry1.html"
|
||||
And I should see "I am a post layout!" in "_site/2016/04/21/entry1.html"
|
||||
@@ -1,22 +0,0 @@
|
||||
# coding: utf-8
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require 'jekyll/version'
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = 'jekyll-docs'
|
||||
spec.version = Jekyll::VERSION
|
||||
spec.authors = ['Parker Moore']
|
||||
spec.email = ['parkrmoore@gmail.com']
|
||||
spec.summary = %q{Offline usage documentation for Jekyll.}
|
||||
spec.homepage = 'http://jekyllrb.com'
|
||||
spec.license = 'MIT'
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0").grep(%r{^site/})
|
||||
spec.require_paths = ['lib']
|
||||
|
||||
spec.add_dependency 'jekyll', Jekyll::VERSION
|
||||
|
||||
spec.add_development_dependency 'bundler', '~> 1.7'
|
||||
spec.add_development_dependency 'rake', '~> 10.0'
|
||||
end
|
||||
@@ -21,8 +21,9 @@ Gem::Specification.new do |s|
|
||||
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.files = all_files.grep(%r{^(exe|lib)/|^.rubocop.yml$})
|
||||
s.executables = all_files.grep(%r{^exe/}) { |f| File.basename(f) }
|
||||
s.bindir = "exe"
|
||||
s.require_paths = ['lib']
|
||||
|
||||
s.rdoc_options = ['--charset=UTF-8']
|
||||
@@ -32,8 +33,10 @@ Gem::Specification.new do |s|
|
||||
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('colorator', '~> 1.0')
|
||||
s.add_runtime_dependency('rouge', '~> 1.7')
|
||||
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
|
||||
s.add_runtime_dependency("pathutil", "~> 0.9")
|
||||
s.add_runtime_dependency('addressable', '~> 2.4')
|
||||
end
|
||||
|
||||
155
lib/jekyll.rb
155
lib/jekyll.rb
@@ -6,77 +6,80 @@ $LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is insta
|
||||
#
|
||||
# Returns nothing.
|
||||
def require_all(path)
|
||||
glob = File.join(File.dirname(__FILE__), path, '*.rb')
|
||||
Dir[glob].each do |f|
|
||||
glob = File.join(File.dirname(__FILE__), path, "*.rb")
|
||||
Dir[glob].sort.each do |f|
|
||||
require f
|
||||
end
|
||||
end
|
||||
|
||||
# rubygems
|
||||
require 'rubygems'
|
||||
require "rubygems"
|
||||
|
||||
# stdlib
|
||||
require 'forwardable'
|
||||
require 'fileutils'
|
||||
require 'time'
|
||||
require 'English'
|
||||
require 'pathname'
|
||||
require 'logger'
|
||||
require 'set'
|
||||
require "pathutil"
|
||||
require "forwardable"
|
||||
require "fileutils"
|
||||
require "time"
|
||||
require "English"
|
||||
require "pathname"
|
||||
require "logger"
|
||||
require "set"
|
||||
|
||||
# 3rd party
|
||||
require 'safe_yaml/load'
|
||||
require 'liquid'
|
||||
require 'kramdown'
|
||||
require 'colorator'
|
||||
require "safe_yaml/load"
|
||||
require "liquid"
|
||||
require "kramdown"
|
||||
require "colorator"
|
||||
|
||||
SafeYAML::OPTIONS[:suppress_warnings] = true
|
||||
|
||||
module Jekyll
|
||||
# internal requires
|
||||
autoload :Cleaner, 'jekyll/cleaner'
|
||||
autoload :Collection, 'jekyll/collection'
|
||||
autoload :Configuration, 'jekyll/configuration'
|
||||
autoload :Convertible, 'jekyll/convertible'
|
||||
autoload :Deprecator, 'jekyll/deprecator'
|
||||
autoload :Document, 'jekyll/document'
|
||||
autoload :Draft, 'jekyll/draft'
|
||||
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 :Hooks, 'jekyll/hooks'
|
||||
autoload :Layout, 'jekyll/layout'
|
||||
autoload :CollectionReader, 'jekyll/readers/collection_reader'
|
||||
autoload :DataReader, 'jekyll/readers/data_reader'
|
||||
autoload :LayoutReader, 'jekyll/readers/layout_reader'
|
||||
autoload :PostReader, 'jekyll/readers/post_reader'
|
||||
autoload :PageReader, 'jekyll/readers/page_reader'
|
||||
autoload :StaticFileReader, 'jekyll/readers/static_file_reader'
|
||||
autoload :LogAdapter, 'jekyll/log_adapter'
|
||||
autoload :Page, 'jekyll/page'
|
||||
autoload :PluginManager, 'jekyll/plugin_manager'
|
||||
autoload :Publisher, 'jekyll/publisher'
|
||||
autoload :Reader, 'jekyll/reader'
|
||||
autoload :Regenerator, 'jekyll/regenerator'
|
||||
autoload :RelatedPosts, 'jekyll/related_posts'
|
||||
autoload :Renderer, 'jekyll/renderer'
|
||||
autoload :LiquidRenderer, 'jekyll/liquid_renderer'
|
||||
autoload :Site, 'jekyll/site'
|
||||
autoload :StaticFile, 'jekyll/static_file'
|
||||
autoload :Stevenson, 'jekyll/stevenson'
|
||||
autoload :URL, 'jekyll/url'
|
||||
autoload :Utils, 'jekyll/utils'
|
||||
autoload :VERSION, 'jekyll/version'
|
||||
autoload :Cleaner, "jekyll/cleaner"
|
||||
autoload :Collection, "jekyll/collection"
|
||||
autoload :Configuration, "jekyll/configuration"
|
||||
autoload :Convertible, "jekyll/convertible"
|
||||
autoload :Deprecator, "jekyll/deprecator"
|
||||
autoload :Document, "jekyll/document"
|
||||
autoload :EntryFilter, "jekyll/entry_filter"
|
||||
autoload :Errors, "jekyll/errors"
|
||||
autoload :Excerpt, "jekyll/excerpt"
|
||||
autoload :External, "jekyll/external"
|
||||
autoload :FrontmatterDefaults, "jekyll/frontmatter_defaults"
|
||||
autoload :Hooks, "jekyll/hooks"
|
||||
autoload :Layout, "jekyll/layout"
|
||||
autoload :CollectionReader, "jekyll/readers/collection_reader"
|
||||
autoload :DataReader, "jekyll/readers/data_reader"
|
||||
autoload :LayoutReader, "jekyll/readers/layout_reader"
|
||||
autoload :PostReader, "jekyll/readers/post_reader"
|
||||
autoload :PageReader, "jekyll/readers/page_reader"
|
||||
autoload :StaticFileReader, "jekyll/readers/static_file_reader"
|
||||
autoload :ThemeAssetsReader, "jekyll/readers/theme_assets_reader"
|
||||
autoload :LogAdapter, "jekyll/log_adapter"
|
||||
autoload :Page, "jekyll/page"
|
||||
autoload :PluginManager, "jekyll/plugin_manager"
|
||||
autoload :Publisher, "jekyll/publisher"
|
||||
autoload :Reader, "jekyll/reader"
|
||||
autoload :Regenerator, "jekyll/regenerator"
|
||||
autoload :RelatedPosts, "jekyll/related_posts"
|
||||
autoload :Renderer, "jekyll/renderer"
|
||||
autoload :LiquidRenderer, "jekyll/liquid_renderer"
|
||||
autoload :Site, "jekyll/site"
|
||||
autoload :StaticFile, "jekyll/static_file"
|
||||
autoload :Stevenson, "jekyll/stevenson"
|
||||
autoload :Theme, "jekyll/theme"
|
||||
autoload :ThemeBuilder, "jekyll/theme_builder"
|
||||
autoload :URL, "jekyll/url"
|
||||
autoload :Utils, "jekyll/utils"
|
||||
autoload :VERSION, "jekyll/version"
|
||||
|
||||
# extensions
|
||||
require 'jekyll/plugin'
|
||||
require 'jekyll/converter'
|
||||
require 'jekyll/generator'
|
||||
require 'jekyll/command'
|
||||
require 'jekyll/liquid_extensions'
|
||||
require "jekyll/plugin"
|
||||
require "jekyll/converter"
|
||||
require "jekyll/generator"
|
||||
require "jekyll/command"
|
||||
require "jekyll/liquid_extensions"
|
||||
require "jekyll/filters"
|
||||
|
||||
class << self
|
||||
# Public: Tells you which Jekyll environment you are building in so you can skip tasks
|
||||
@@ -91,22 +94,22 @@ module Jekyll
|
||||
# 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
|
||||
# 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 = {})
|
||||
config = Configuration[Configuration::DEFAULTS]
|
||||
config = Configuration.new
|
||||
override = Configuration[override].stringify_keys
|
||||
unless override.delete('skip_config_files')
|
||||
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
|
||||
Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |obj|
|
||||
set_timezone(obj["timezone"]) if obj["timezone"]
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Set the TZ environment variable to use the timezone specified
|
||||
@@ -114,9 +117,11 @@ module Jekyll
|
||||
# timezone - the IANA Time Zone
|
||||
#
|
||||
# Returns nothing
|
||||
# rubocop:disable Style/AccessorMethodName
|
||||
def set_timezone(timezone)
|
||||
ENV['TZ'] = timezone
|
||||
ENV["TZ"] = timezone
|
||||
end
|
||||
# rubocop:enable Style/AccessorMethodName
|
||||
|
||||
# Public: Fetch the logger instance for this Jekyll process.
|
||||
#
|
||||
@@ -153,27 +158,31 @@ module Jekyll
|
||||
def sanitized_path(base_directory, questionable_path)
|
||||
return base_directory if base_directory.eql?(questionable_path)
|
||||
|
||||
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
|
||||
clean_path = File.expand_path(questionable_path, "/")
|
||||
clean_path = clean_path.sub(/\A\w\:\//, '/')
|
||||
|
||||
if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/'))
|
||||
return clean_path if clean_path.eql?(base_directory)
|
||||
|
||||
if clean_path.start_with?(base_directory.sub(%r!\z!, "/"))
|
||||
clean_path
|
||||
else
|
||||
clean_path.sub!(%r!\A\w:/!, "/")
|
||||
File.join(base_directory, clean_path)
|
||||
end
|
||||
end
|
||||
|
||||
# Conditional optimizations
|
||||
Jekyll::External.require_if_present('liquid-c')
|
||||
Jekyll::External.require_if_present("liquid-c")
|
||||
end
|
||||
end
|
||||
|
||||
require "jekyll/drops/drop"
|
||||
require_all 'jekyll/commands'
|
||||
require_all 'jekyll/converters'
|
||||
require_all 'jekyll/converters/markdown'
|
||||
require_all 'jekyll/drops'
|
||||
require_all 'jekyll/generators'
|
||||
require_all 'jekyll/tags'
|
||||
require "jekyll/drops/document_drop"
|
||||
require_all "jekyll/commands"
|
||||
require_all "jekyll/converters"
|
||||
require_all "jekyll/converters/markdown"
|
||||
require_all "jekyll/drops"
|
||||
require_all "jekyll/generators"
|
||||
require_all "jekyll/tags"
|
||||
|
||||
require 'jekyll-sass-converter'
|
||||
require "jekyll-sass-converter"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
require 'set'
|
||||
require "set"
|
||||
|
||||
module Jekyll
|
||||
# Handles the cleanup of a site's destination before it is built.
|
||||
class Cleaner
|
||||
HIDDEN_FILE_REGEX = /\/\.{1,2}$/
|
||||
HIDDEN_FILE_REGEX = %r!\/\.{1,2}$!
|
||||
attr_reader :site
|
||||
|
||||
def initialize(site)
|
||||
@@ -32,7 +32,8 @@ module Jekyll
|
||||
[site.regenerator.metadata_file]
|
||||
end
|
||||
|
||||
# Private: The list of existing files, apart from those included in keep_files and hidden files.
|
||||
# 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
|
||||
@@ -77,15 +78,16 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# Private: The list of existing files that will be replaced by a directory during build
|
||||
# Private: The list of existing files that will be replaced by a directory
|
||||
# during build
|
||||
#
|
||||
# Returns a Set with the file paths
|
||||
def replaced_files
|
||||
new_dirs.select { |dir| File.file?(dir) }.to_set
|
||||
end
|
||||
|
||||
# Private: The list of directories that need to be kept because they are parent directories
|
||||
# of files specified in keep_files
|
||||
# Private: The list of directories that need to be kept because they are
|
||||
# parent directories of files specified in keep_files
|
||||
#
|
||||
# Returns a Set with the directory paths
|
||||
def keep_dirs
|
||||
@@ -95,11 +97,12 @@ module Jekyll
|
||||
# Private: Creates a regular expression from the config's keep_files array
|
||||
#
|
||||
# Examples
|
||||
# ['.git','.svn'] creates the following regex: /\/(\.git|\/.svn)/
|
||||
# ['.git','.svn'] with site.dest "/myblog/_site" creates
|
||||
# the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/
|
||||
#
|
||||
# Returns the regular expression
|
||||
def keep_file_regex
|
||||
Regexp.union(site.keep_files)
|
||||
%r!\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,14 +25,15 @@ module Jekyll
|
||||
|
||||
# Override of normal respond_to? to match method_missing's logic for
|
||||
# looking in @data.
|
||||
def respond_to?(method, include_private = false)
|
||||
def respond_to_missing?(method, include_private = false)
|
||||
docs.respond_to?(method.to_sym, include_private) || super
|
||||
end
|
||||
|
||||
# Override of method_missing to check in @data for the key.
|
||||
def method_missing(method, *args, &blck)
|
||||
if docs.respond_to?(method.to_sym)
|
||||
Jekyll.logger.warn "Deprecation:", "#{label}.#{method} should be changed to #{label}.docs.#{method}."
|
||||
Jekyll.logger.warn "Deprecation:", "#{label}.#{method} should be changed to" \
|
||||
"#{label}.docs.#{method}."
|
||||
Jekyll.logger.warn "", "Called by #{caller.first}."
|
||||
docs.public_send(method.to_sym, *args, &blck)
|
||||
else
|
||||
@@ -56,16 +57,9 @@ module Jekyll
|
||||
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
|
||||
if site.publisher.publish?(doc) || !write?
|
||||
docs << doc
|
||||
else
|
||||
Jekyll.logger.debug "Skipped From Publishing:", doc.relative_path
|
||||
end
|
||||
read_document(full_path)
|
||||
else
|
||||
relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.")
|
||||
files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
|
||||
read_static_file(file_path, full_path)
|
||||
end
|
||||
end
|
||||
docs.sort!
|
||||
@@ -78,8 +72,8 @@ module Jekyll
|
||||
def entries
|
||||
return [] unless exists?
|
||||
@entries ||=
|
||||
Utils.safe_glob(collection_dir, ["**", "*.*"]).map do |entry|
|
||||
entry["#{collection_dir}/"] = ''
|
||||
Utils.safe_glob(collection_dir, ["**", "*"]).map do |entry|
|
||||
entry["#{collection_dir}/"] = ""
|
||||
entry
|
||||
end
|
||||
end
|
||||
@@ -94,7 +88,7 @@ module Jekyll
|
||||
Dir.chdir(directory) do
|
||||
entry_filter.filter(entries).reject do |f|
|
||||
path = collection_dir(f)
|
||||
File.directory?(path) || (File.symlink?(f) && site.safe)
|
||||
File.directory?(path) || entry_filter.symlink?(f)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -135,7 +129,7 @@ module Jekyll
|
||||
# Returns false if the directory doesn't exist or if it's a symlink
|
||||
# and we're in safe mode.
|
||||
def exists?
|
||||
File.directory?(directory) && !(File.symlink?(directory) && site.safe)
|
||||
File.directory?(directory) && !entry_filter.symlink?(directory)
|
||||
end
|
||||
|
||||
# The entry filter for this collection.
|
||||
@@ -161,7 +155,7 @@ module Jekyll
|
||||
#
|
||||
# Returns a sanitized version of the label.
|
||||
def sanitize_label(label)
|
||||
label.gsub(/[^a-z0-9_\-\.]/i, '')
|
||||
label.gsub(%r![^a-z0-9_\-\.]!i, "")
|
||||
end
|
||||
|
||||
# Produce a representation of this Collection for use in Liquid.
|
||||
@@ -179,14 +173,14 @@ module Jekyll
|
||||
#
|
||||
# Returns true if the 'write' metadata is true, false otherwise.
|
||||
def write?
|
||||
!!metadata.fetch('output', false)
|
||||
!!metadata.fetch("output", false)
|
||||
end
|
||||
|
||||
# The URL template to render collection's documents at.
|
||||
#
|
||||
# Returns the URL template to render collection's documents at.
|
||||
def url_template
|
||||
@url_template ||= metadata.fetch('permalink') do
|
||||
@url_template ||= metadata.fetch("permalink") do
|
||||
Utils.add_permalink_suffix("/:collection/:path", site.permalink_style)
|
||||
end
|
||||
end
|
||||
@@ -195,11 +189,33 @@ module Jekyll
|
||||
#
|
||||
# Returns the metadata for this collection
|
||||
def extract_metadata
|
||||
if site.config['collections'].is_a?(Hash)
|
||||
site.config['collections'][label] || {}
|
||||
if site.config["collections"].is_a?(Hash)
|
||||
site.config["collections"][label] || {}
|
||||
else
|
||||
{}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def read_document(full_path)
|
||||
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
|
||||
doc.read
|
||||
if site.publisher.publish?(doc) || !write?
|
||||
docs << doc
|
||||
else
|
||||
Jekyll.logger.debug "Skipped From Publishing:", doc.relative_path
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def read_static_file(file_path, full_path)
|
||||
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
|
||||
end
|
||||
|
||||
@@ -46,19 +46,25 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def add_build_options(c)
|
||||
c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||
c.option 'destination', '-d', '--destination DESTINATION', 'The current folder will be generated into DESTINATION'
|
||||
c.option 'source', '-s', '--source SOURCE', 'Custom source directory'
|
||||
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', '--[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 'incremental', '-I', '--incremental', 'Enable incremental rebuild.'
|
||||
c.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]",
|
||||
Array, "Custom configuration file"
|
||||
c.option "destination", "-d", "--destination DESTINATION",
|
||||
"The current folder will be generated into DESTINATION"
|
||||
c.option "source", "-s", "--source SOURCE", "Custom source directory"
|
||||
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", "--[no-]watch", "Watch for changes and rebuild"
|
||||
c.option "baseurl", "-b", "--baseurl URL",
|
||||
"Serve the website from the given base URL"
|
||||
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 "incremental", "-I", "--incremental", "Enable incremental rebuild."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,8 +5,8 @@ module Jekyll
|
||||
# Create the Mercenary command for the Jekyll CLI for this Command
|
||||
def init_with_program(prog)
|
||||
prog.command(:build) do |c|
|
||||
c.syntax 'build [options]'
|
||||
c.description 'Build your site'
|
||||
c.syntax "build [options]"
|
||||
c.description "Build your site"
|
||||
c.alias :b
|
||||
|
||||
add_build_options(c)
|
||||
@@ -27,15 +27,17 @@ module Jekyll
|
||||
options = configuration_from_options(options)
|
||||
site = Jekyll::Site.new(options)
|
||||
|
||||
if options.fetch('skip_initial_build', false)
|
||||
Jekyll.logger.warn "Build Warning:", "Skipping the initial build. This may result in an out-of-date site."
|
||||
if options.fetch("skip_initial_build", false)
|
||||
Jekyll.logger.warn "Build Warning:", "Skipping the initial build." \
|
||||
" This may result in an out-of-date site."
|
||||
else
|
||||
build(site, options)
|
||||
end
|
||||
|
||||
if options.fetch('detach', false)
|
||||
Jekyll.logger.info "Auto-regeneration:", "disabled when running server detached."
|
||||
elsif options.fetch('watch', false)
|
||||
if options.fetch("detach", false)
|
||||
Jekyll.logger.info "Auto-regeneration:",
|
||||
"disabled when running server detached."
|
||||
elsif options.fetch("watch", false)
|
||||
watch(site, options)
|
||||
else
|
||||
Jekyll.logger.info "Auto-regeneration:", "disabled. Use --watch to enable."
|
||||
@@ -50,12 +52,13 @@ module Jekyll
|
||||
# Returns nothing.
|
||||
def build(site, options)
|
||||
t = Time.now
|
||||
source = options['source']
|
||||
destination = options['destination']
|
||||
incremental = options['incremental']
|
||||
source = options["source"]
|
||||
destination = options["destination"]
|
||||
incremental = options["incremental"]
|
||||
Jekyll.logger.info "Source:", source
|
||||
Jekyll.logger.info "Destination:", destination
|
||||
Jekyll.logger.info "Incremental build:", (incremental ? "enabled" : "disabled. Enable with --incremental")
|
||||
Jekyll.logger.info "Incremental build:",
|
||||
(incremental ? "enabled" : "disabled. Enable with --incremental")
|
||||
Jekyll.logger.info "Generating..."
|
||||
process_site(site)
|
||||
Jekyll.logger.info "", "done in #{(Time.now - t).round(3)} seconds."
|
||||
@@ -67,9 +70,25 @@ module Jekyll
|
||||
# options - A Hash of options passed to the command
|
||||
#
|
||||
# Returns nothing.
|
||||
def watch(_site, options)
|
||||
External.require_with_graceful_fail 'jekyll-watch'
|
||||
Jekyll::Watcher.watch(options)
|
||||
def watch(site, options)
|
||||
if Utils::Platforms.windows?
|
||||
Jekyll.logger.warn "", "--watch arg is unsupported on Windows. "
|
||||
Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \
|
||||
"https://github.com/Microsoft/BashOnWindows/issues/216"
|
||||
|
||||
else
|
||||
External.require_with_graceful_fail "jekyll-watch"
|
||||
watch_method = Jekyll::Watcher.method(:watch)
|
||||
if watch_method.parameters.size == 1
|
||||
watch_method.call(
|
||||
options
|
||||
)
|
||||
else
|
||||
watch_method.call(
|
||||
options, site
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end # end of class << self
|
||||
end
|
||||
|
||||
@@ -4,8 +4,9 @@ module Jekyll
|
||||
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.syntax "clean [subcommand]"
|
||||
c.description "Clean the site " \
|
||||
"(removes site output and metadata file) without building."
|
||||
|
||||
add_build_options(c)
|
||||
|
||||
@@ -17,23 +18,21 @@ module Jekyll
|
||||
|
||||
def process(options)
|
||||
options = configuration_from_options(options)
|
||||
destination = options['destination']
|
||||
metadata_file = File.join(options['source'], '.jekyll-metadata')
|
||||
destination = options["destination"]
|
||||
metadata_file = File.join(options["source"], ".jekyll-metadata")
|
||||
sass_cache = File.join(options["source"], ".sass-cache")
|
||||
|
||||
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
|
||||
remove(destination, :checker_func => :directory?)
|
||||
remove(metadata_file, :checker_func => :file?)
|
||||
remove(sass_cache, :checker_func => :directory?)
|
||||
end
|
||||
|
||||
if File.file? metadata_file
|
||||
Jekyll.logger.info "Removing #{metadata_file}..."
|
||||
FileUtils.rm_rf(metadata_file)
|
||||
Jekyll.logger.info "", "done."
|
||||
def remove(filename, checker_func: :file?)
|
||||
if File.public_send(checker_func, filename)
|
||||
Jekyll.logger.info "Cleaner:", "Removing #{filename}..."
|
||||
FileUtils.rm_rf(filename)
|
||||
else
|
||||
Jekyll.logger.info "Nothing to do for #{metadata_file}."
|
||||
Jekyll.logger.info "Cleaner:", "Nothing to do for #{filename}."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,11 +4,12 @@ module Jekyll
|
||||
class << self
|
||||
def init_with_program(prog)
|
||||
prog.command(:doctor) do |c|
|
||||
c.syntax 'doctor'
|
||||
c.description 'Search site and print specific deprecation warnings'
|
||||
c.syntax "doctor"
|
||||
c.description "Search site and print specific deprecation warnings"
|
||||
c.alias(:hyde)
|
||||
|
||||
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||
c.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]", Array,
|
||||
"Custom configuration file"
|
||||
|
||||
c.action do |_, options|
|
||||
Jekyll::Commands::Doctor.process(options)
|
||||
@@ -18,7 +19,9 @@ module Jekyll
|
||||
|
||||
def process(options)
|
||||
site = Jekyll::Site.new(configuration_from_options(options))
|
||||
site.reset
|
||||
site.read
|
||||
site.generate
|
||||
|
||||
if healthy?(site)
|
||||
Jekyll.logger.info "Your test results", "are in. Everything looks fine."
|
||||
@@ -37,7 +40,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def deprecated_relative_permalinks(site)
|
||||
if site.config['relative_permalinks']
|
||||
if site.config["relative_permalinks"]
|
||||
Jekyll::Deprecator.deprecation_message "Your site still uses relative" \
|
||||
" permalinks, which was removed in" \
|
||||
" Jekyll v3.0.0."
|
||||
@@ -62,7 +65,7 @@ module Jekyll
|
||||
def fsnotify_buggy?(_site)
|
||||
return true unless Utils::Platforms.osx?
|
||||
if Dir.pwd != `pwd`.strip
|
||||
Jekyll.logger.error " " + <<-STR.strip.gsub(/\n\s+/, "\n ")
|
||||
Jekyll.logger.error " " + <<-STR.strip.gsub(%r!\n\s+!, "\n ")
|
||||
We have detected that there might be trouble using fsevent on your
|
||||
operating system, you can read https://github.com/thibaudgg/rb-fsevent/wiki/no-fsevents-fired-(OSX-bug)
|
||||
for possible work arounds or you can work around it immediately
|
||||
@@ -78,7 +81,7 @@ module Jekyll
|
||||
def urls_only_differ_by_case(site)
|
||||
urls_only_differ_by_case = false
|
||||
urls = case_insensitive_urls(site.pages + site.docs_to_write, site.dest)
|
||||
urls.each do |case_insensitive_url, real_urls|
|
||||
urls.each do |_case_insensitive_url, real_urls|
|
||||
next unless real_urls.uniq.size > 1
|
||||
urls_only_differ_by_case = true
|
||||
Jekyll.logger.warn "Warning:", "The following URLs only differ" \
|
||||
@@ -102,10 +105,9 @@ module Jekyll
|
||||
end
|
||||
|
||||
def case_insensitive_urls(things, destination)
|
||||
things.inject({}) do |memo, thing|
|
||||
things.each_with_object({}) do |thing, memo|
|
||||
dest = thing.destination(destination)
|
||||
(memo[dest.downcase] ||= []) << dest
|
||||
memo
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,8 +4,8 @@ module Jekyll
|
||||
class << self
|
||||
def init_with_program(prog)
|
||||
prog.command(:help) do |c|
|
||||
c.syntax 'help [subcommand]'
|
||||
c.description 'Show the help message, optionally for a given subcommand.'
|
||||
c.syntax "help [subcommand]"
|
||||
c.description "Show the help message, optionally for a given subcommand."
|
||||
|
||||
c.action do |args, _|
|
||||
cmd = (args.first || "").to_sym
|
||||
@@ -22,7 +22,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
def invalid_command(prog, cmd)
|
||||
Jekyll.logger.error "Error:", "Hmm... we don't know what the '#{cmd}' command is."
|
||||
Jekyll.logger.error "Error:",
|
||||
"Hmm... we don't know what the '#{cmd}' command is."
|
||||
Jekyll.logger.info "Valid commands:", prog.commands.keys.join(", ")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require 'erb'
|
||||
require "erb"
|
||||
|
||||
module Jekyll
|
||||
module Commands
|
||||
@@ -6,11 +6,12 @@ module Jekyll
|
||||
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.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.option "force", "--force", "Force creation even if PATH already exists"
|
||||
c.option "blank", "--blank", "Creates scaffolding but with empty files"
|
||||
c.option "skip-bundle", "--skip-bundle", "Skip 'bundle install'"
|
||||
|
||||
c.action do |args, options|
|
||||
Jekyll::Commands::New.process(args, options)
|
||||
@@ -19,25 +20,22 @@ module Jekyll
|
||||
end
|
||||
|
||||
def process(args, options = {})
|
||||
raise ArgumentError.new('You must specify a path.') if args.empty?
|
||||
raise ArgumentError, "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."
|
||||
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
|
||||
create_site new_blog_path
|
||||
end
|
||||
|
||||
Jekyll.logger.info "New jekyll site installed in #{new_blog_path}."
|
||||
after_install(new_blog_path, options)
|
||||
end
|
||||
|
||||
def create_blank_site(path)
|
||||
@@ -55,17 +53,58 @@ module Jekyll
|
||||
#
|
||||
# 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"
|
||||
"_posts/#{Time.now.strftime("%Y-%m-%d")}-welcome-to-jekyll.markdown"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def gemfile_contents
|
||||
<<-RUBY
|
||||
source "https://rubygems.org"
|
||||
ruby RUBY_VERSION
|
||||
|
||||
# Hello! This is where you manage which Jekyll version is used to run.
|
||||
# When you want to use a different version, change it below, save the
|
||||
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
|
||||
#
|
||||
# bundle exec jekyll serve
|
||||
#
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
gem "jekyll", "#{Jekyll::VERSION}"
|
||||
|
||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "minima", "~> 2.0"
|
||||
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
# gem "github-pages", group: :jekyll_plugins
|
||||
|
||||
# If you have any plugins, put them here!
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-feed", "~> 0.6"
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
def create_site(new_blog_path)
|
||||
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
|
||||
|
||||
File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f|
|
||||
f.write(gemfile_contents)
|
||||
end
|
||||
end
|
||||
|
||||
def preserve_source_location?(path, options)
|
||||
!options["force"] && !Dir["#{path}/**/*"].empty?
|
||||
end
|
||||
|
||||
def create_sample_files(path)
|
||||
FileUtils.cp_r site_template + '/.', path
|
||||
FileUtils.cp_r site_template + "/.", path
|
||||
FileUtils.rm File.expand_path(scaffold_path, path)
|
||||
end
|
||||
|
||||
@@ -76,6 +115,31 @@ module Jekyll
|
||||
def scaffold_path
|
||||
"_posts/0000-00-00-welcome-to-jekyll.markdown.erb"
|
||||
end
|
||||
|
||||
# After a new blog has been created, print a success notification and
|
||||
# then automatically execute bundle install from within the new blog dir
|
||||
# unless the user opts to generate a blank blog or skip 'bundle install'.
|
||||
|
||||
def after_install(path, options = {})
|
||||
Jekyll.logger.info "New jekyll site installed in #{path.cyan}."
|
||||
Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"]
|
||||
|
||||
unless options["blank"] || options["skip-bundle"]
|
||||
bundle_install path
|
||||
end
|
||||
end
|
||||
|
||||
def bundle_install(path)
|
||||
Jekyll::External.require_with_graceful_fail "bundler"
|
||||
Jekyll.logger.info "Running bundle install in #{path.cyan}..."
|
||||
Dir.chdir(path) do
|
||||
if ENV["CI"]
|
||||
system("bundle", "install", "--quiet")
|
||||
else
|
||||
system("bundle", "install")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
38
lib/jekyll/commands/new_theme.rb
Normal file
38
lib/jekyll/commands/new_theme.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
require "erb"
|
||||
|
||||
class Jekyll::Commands::NewTheme < Jekyll::Command
|
||||
class << self
|
||||
def init_with_program(prog)
|
||||
prog.command(:"new-theme") do |c|
|
||||
c.syntax "new-theme NAME"
|
||||
c.description "Creates a new Jekyll theme scaffold"
|
||||
c.option "code_of_conduct", \
|
||||
"-c", "--code-of-conduct", \
|
||||
"Include a Code of Conduct. (defaults to false)"
|
||||
|
||||
c.action do |args, opts|
|
||||
Jekyll::Commands::NewTheme.process(args, opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def process(args, opts)
|
||||
if !args || args.empty?
|
||||
raise Jekyll::Errors::InvalidThemeName, "You must specify a theme name."
|
||||
end
|
||||
|
||||
new_theme_name = args.join("_")
|
||||
theme = Jekyll::ThemeBuilder.new(new_theme_name, opts)
|
||||
if theme.path.exist?
|
||||
Jekyll.logger.abort_with "Conflict:", "#{theme.path} already exists."
|
||||
end
|
||||
|
||||
theme.create!
|
||||
Jekyll.logger.info "Your new Jekyll theme, #{theme.name.cyan}," \
|
||||
" is ready for you in #{theme.path.to_s.cyan}!"
|
||||
Jekyll.logger.info "For help getting started, read #{theme.path}/README.md."
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
end
|
||||
@@ -3,16 +3,17 @@ module Jekyll
|
||||
class Serve < Command
|
||||
class << self
|
||||
COMMAND_OPTIONS = {
|
||||
"ssl_cert" => ["--ssl-cert [CERT]", "X.509 (SSL) certificate."],
|
||||
"host" => ["host", "-H", "--host [HOST]", "Host to bind to"],
|
||||
"open_url" => ["-o", "--open-url", "Launch your browser with your site."],
|
||||
"detach" => ["-B", "--detach", "Run the server in the background (detach)"],
|
||||
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
|
||||
"port" => ["-P", "--port [PORT]", "Port to listen on"],
|
||||
"baseurl" => ["-b", "--baseurl [URL]", "Base URL"],
|
||||
"ssl_cert" => ["--ssl-cert [CERT]", "X.509 (SSL) certificate."],
|
||||
"host" => ["host", "-H", "--host [HOST]", "Host to bind to"],
|
||||
"open_url" => ["-o", "--open-url", "Launch your site in a browser"],
|
||||
"detach" => ["-B", "--detach", "Run the server in the background"],
|
||||
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
|
||||
"port" => ["-P", "--port [PORT]", "Port to listen on"],
|
||||
"show_dir_listing" => ["--show-dir-listing",
|
||||
"Show a directory listing instead of loading your index file."],
|
||||
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
|
||||
"Skips the initial site build which occurs before the server is started."]
|
||||
}
|
||||
}.freeze
|
||||
|
||||
#
|
||||
|
||||
@@ -31,7 +32,10 @@ module Jekyll
|
||||
cmd.action do |_, opts|
|
||||
opts["serving"] = true
|
||||
opts["watch" ] = true unless opts.key?("watch")
|
||||
config = opts["config"]
|
||||
opts["url"] = default_url(opts) if Jekyll.env == "development"
|
||||
Build.process(opts)
|
||||
opts["config"] = config
|
||||
Serve.process(opts)
|
||||
end
|
||||
end
|
||||
@@ -44,11 +48,7 @@ module Jekyll
|
||||
destination = opts["destination"]
|
||||
setup(destination)
|
||||
|
||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
||||
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||
launch_browser server, opts if opts["open_url"]
|
||||
boot_or_detach server, opts
|
||||
start_up_webrick(opts, destination)
|
||||
end
|
||||
|
||||
# Do a base pre-setup of WEBRick so that everything is in place
|
||||
@@ -91,11 +91,24 @@ module Jekyll
|
||||
)
|
||||
}
|
||||
|
||||
opts[:DirectoryIndex] = [] if opts[:JekyllOptions]["show_dir_listing"]
|
||||
|
||||
enable_ssl(opts)
|
||||
enable_logging(opts)
|
||||
opts
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def start_up_webrick(opts, destination)
|
||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
||||
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||
launch_browser server, opts if opts["open_url"]
|
||||
boot_or_detach server, opts
|
||||
end
|
||||
|
||||
# Recreate NondisclosureName under utf-8 circumstance
|
||||
|
||||
private
|
||||
@@ -103,7 +116,7 @@ module Jekyll
|
||||
WEBrick::Config::FileHandler.merge({
|
||||
:FancyIndexing => true,
|
||||
:NondisclosureName => [
|
||||
'.ht*', '~*'
|
||||
".ht*", "~*"
|
||||
]
|
||||
})
|
||||
end
|
||||
@@ -111,27 +124,47 @@ module Jekyll
|
||||
#
|
||||
|
||||
private
|
||||
def server_address(server, opts)
|
||||
address = server.config[:BindAddress]
|
||||
baseurl = "#{opts["baseurl"]}/" if opts["baseurl"]
|
||||
port = server.config[:Port]
|
||||
def server_address(server, options = {})
|
||||
format_url(
|
||||
server.config[:SSLEnable],
|
||||
server.config[:BindAddress],
|
||||
server.config[:Port],
|
||||
options["baseurl"]
|
||||
)
|
||||
end
|
||||
|
||||
"http://#{address}:#{port}#{baseurl}"
|
||||
private
|
||||
def format_url(ssl_enabled, address, port, baseurl = nil)
|
||||
format("%{prefix}://%{address}:%{port}%{baseurl}", {
|
||||
:prefix => ssl_enabled ? "https" : "http",
|
||||
:address => address,
|
||||
:port => port,
|
||||
:baseurl => baseurl ? "#{baseurl}/" : ""
|
||||
})
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def default_url(opts)
|
||||
config = configuration_from_options(opts)
|
||||
format_url(
|
||||
config["ssl_cert"] && config["ssl_key"],
|
||||
config["host"] == "127.0.0.1" ? "localhost" : config["host"],
|
||||
config["port"]
|
||||
)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def launch_browser(server, opts)
|
||||
command =
|
||||
if Utils::Platforms.windows?
|
||||
"start"
|
||||
elsif Utils::Platforms.osx?
|
||||
"open"
|
||||
else
|
||||
"xdg-open"
|
||||
end
|
||||
system command, server_address(server, opts)
|
||||
address = server_address(server, opts)
|
||||
return system "start", address if Utils::Platforms.windows?
|
||||
return system "xdg-open", address if Utils::Platforms.linux?
|
||||
return system "open", address if Utils::Platforms.osx?
|
||||
Jekyll.logger.error "Refusing to launch browser; " \
|
||||
"Platform launcher unknown."
|
||||
end
|
||||
|
||||
# Keep in our area with a thread or detach the server as requested
|
||||
@@ -169,22 +202,27 @@ module Jekyll
|
||||
# forget to add one of the certificates.
|
||||
|
||||
private
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def enable_ssl(opts)
|
||||
return if !opts[:JekyllOptions]["ssl_cert"] && !opts[:JekyllOptions]["ssl_key"]
|
||||
if !opts[:JekyllOptions]["ssl_cert"] || !opts[:JekyllOptions]["ssl_key"]
|
||||
# rubocop:disable Style/RedundantException
|
||||
raise RuntimeError, "--ssl-cert or --ssl-key missing."
|
||||
end
|
||||
|
||||
require "openssl"
|
||||
require "webrick/https"
|
||||
source_key = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_key" ])
|
||||
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
|
||||
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
|
||||
source_key = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], \
|
||||
opts[:JekyllOptions]["ssl_key" ])
|
||||
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], \
|
||||
opts[:JekyllOptions]["ssl_cert"])
|
||||
opts[:SSLCertificate] =
|
||||
OpenSSL::X509::Certificate.new(File.read(source_certificate))
|
||||
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
|
||||
opts[:EnableSSL] = true
|
||||
opts[:SSLEnable] = true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def start_callback(detached)
|
||||
unless detached
|
||||
proc do
|
||||
@@ -195,7 +233,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def mime_types
|
||||
file = File.expand_path('../mime.types', File.dirname(__FILE__))
|
||||
file = File.expand_path("../mime.types", File.dirname(__FILE__))
|
||||
WEBrick::HTTPUtils.load_mime_types(file)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ module Jekyll
|
||||
DEFAULTS = {
|
||||
"Cache-Control" => "private, max-age=0, proxy-revalidate, " \
|
||||
"no-store, no-cache, must-revalidate"
|
||||
}
|
||||
}.freeze
|
||||
|
||||
def initialize(server, root, callbacks)
|
||||
# So we can access them easily.
|
||||
@@ -25,8 +25,7 @@ module Jekyll
|
||||
super || super(req, res, "#{basename}.html")
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
# rubocop:disable Style/MethodName
|
||||
def do_GET(req, res)
|
||||
rtn = super
|
||||
validate_and_ensure_charset(req, res)
|
||||
@@ -38,10 +37,10 @@ module Jekyll
|
||||
|
||||
private
|
||||
def validate_and_ensure_charset(_req, res)
|
||||
key = res.header.keys.grep(/content-type/i).first
|
||||
key = res.header.keys.grep(%r!content-type!i).first
|
||||
typ = res.header[key]
|
||||
|
||||
unless typ =~ /;\s*charset=/
|
||||
unless typ =~ %r!;\s*charset=!
|
||||
res.header[key] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,72 +6,94 @@ module Jekyll
|
||||
# Strings rather than symbols are used for compatibility with YAML.
|
||||
DEFAULTS = Configuration[{
|
||||
# Where things are
|
||||
'source' => Dir.pwd,
|
||||
'destination' => File.join(Dir.pwd, '_site'),
|
||||
'plugins_dir' => '_plugins',
|
||||
'layouts_dir' => '_layouts',
|
||||
'data_dir' => '_data',
|
||||
'includes_dir' => '_includes',
|
||||
'collections' => {},
|
||||
"source" => Dir.pwd,
|
||||
"destination" => File.join(Dir.pwd, "_site"),
|
||||
"plugins_dir" => "_plugins",
|
||||
"layouts_dir" => "_layouts",
|
||||
"data_dir" => "_data",
|
||||
"includes_dir" => "_includes",
|
||||
"collections" => {},
|
||||
|
||||
# Handling Reading
|
||||
'safe' => false,
|
||||
'include' => ['.htaccess'],
|
||||
'exclude' => [],
|
||||
'keep_files' => ['.git', '.svn'],
|
||||
'encoding' => 'utf-8',
|
||||
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
|
||||
"safe" => false,
|
||||
"include" => [".htaccess"],
|
||||
"exclude" => %w(node_modules vendor),
|
||||
"keep_files" => [".git", ".svn"],
|
||||
"encoding" => "utf-8",
|
||||
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
||||
|
||||
# Filtering Content
|
||||
'show_drafts' => nil,
|
||||
'limit_posts' => 0,
|
||||
'future' => false,
|
||||
'unpublished' => false,
|
||||
"show_drafts" => nil,
|
||||
"limit_posts" => 0,
|
||||
"future" => false,
|
||||
"unpublished" => false,
|
||||
|
||||
# Plugins
|
||||
'whitelist' => [],
|
||||
'gems' => [],
|
||||
"whitelist" => [],
|
||||
"gems" => [],
|
||||
|
||||
# Conversion
|
||||
'markdown' => 'kramdown',
|
||||
'highlighter' => 'rouge',
|
||||
'lsi' => false,
|
||||
'excerpt_separator' => "\n\n",
|
||||
'incremental' => false,
|
||||
"markdown" => "kramdown",
|
||||
"highlighter" => "rouge",
|
||||
"lsi" => false,
|
||||
"excerpt_separator" => "\n\n",
|
||||
"incremental" => false,
|
||||
|
||||
# Serving
|
||||
'detach' => false, # default to not detaching the server
|
||||
'port' => '4000',
|
||||
'host' => '127.0.0.1',
|
||||
'baseurl' => '',
|
||||
"detach" => false, # default to not detaching the server
|
||||
"port" => "4000",
|
||||
"host" => "127.0.0.1",
|
||||
"baseurl" => "",
|
||||
"show_dir_listing" => false,
|
||||
|
||||
# Output Configuration
|
||||
'permalink' => 'date',
|
||||
'paginate_path' => '/page:num',
|
||||
'timezone' => nil, # use the local timezone
|
||||
"permalink" => "date",
|
||||
"paginate_path" => "/page:num",
|
||||
"timezone" => nil, # use the local timezone
|
||||
|
||||
'quiet' => false,
|
||||
'verbose' => false,
|
||||
'defaults' => [],
|
||||
"quiet" => false,
|
||||
"verbose" => false,
|
||||
"defaults" => [],
|
||||
|
||||
'rdiscount' => {
|
||||
'extensions' => []
|
||||
"liquid" => {
|
||||
"error_mode" => "warn"
|
||||
},
|
||||
|
||||
'redcarpet' => {
|
||||
'extensions' => []
|
||||
"rdiscount" => {
|
||||
"extensions" => []
|
||||
},
|
||||
|
||||
'kramdown' => {
|
||||
'auto_ids' => true,
|
||||
'toc_levels' => '1..6',
|
||||
'entity_output' => 'as_char',
|
||||
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
||||
'input' => "GFM",
|
||||
'hard_wrap' => false,
|
||||
'footnote_nr' => 1
|
||||
"redcarpet" => {
|
||||
"extensions" => []
|
||||
},
|
||||
|
||||
"kramdown" => {
|
||||
"auto_ids" => true,
|
||||
"toc_levels" => "1..6",
|
||||
"entity_output" => "as_char",
|
||||
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
|
||||
"input" => "GFM",
|
||||
"hard_wrap" => false,
|
||||
"footnote_nr" => 1
|
||||
}
|
||||
}]
|
||||
}.map { |k, v| [k, v.freeze] }].freeze
|
||||
|
||||
class << self
|
||||
# Static: Produce a Configuration ready for use in a Site.
|
||||
# It takes the input, fills in the defaults where values do not
|
||||
# exist, and patches common issues including migrating options for
|
||||
# backwards compatiblity. Except where a key or value is being fixed,
|
||||
# the user configuration will override the defaults.
|
||||
#
|
||||
# user_config - a Hash or Configuration of overrides.
|
||||
#
|
||||
# Returns a Configuration filled with defaults and fixed for common
|
||||
# problems and backwards-compatibility.
|
||||
def from(user_config)
|
||||
Utils.deep_merge_hashes(DEFAULTS, Configuration[user_config].stringify_keys)
|
||||
.fix_common_issues.add_default_collections
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Turn all keys into string
|
||||
#
|
||||
@@ -90,28 +112,29 @@ module Jekyll
|
||||
#
|
||||
# Returns the path to the Jekyll source directory
|
||||
def source(override)
|
||||
get_config_value_with_override('source', override)
|
||||
get_config_value_with_override("source", override)
|
||||
end
|
||||
|
||||
def quiet(override = {})
|
||||
get_config_value_with_override('quiet', override)
|
||||
get_config_value_with_override("quiet", override)
|
||||
end
|
||||
alias_method :quiet?, :quiet
|
||||
|
||||
def verbose(override = {})
|
||||
get_config_value_with_override('verbose', override)
|
||||
get_config_value_with_override("verbose", override)
|
||||
end
|
||||
alias_method :verbose?, :verbose
|
||||
|
||||
def safe_load_file(filename)
|
||||
case File.extname(filename)
|
||||
when /\.toml/i
|
||||
Jekyll::External.require_with_graceful_fail('toml') unless defined?(TOML)
|
||||
when %r!\.toml!i
|
||||
Jekyll::External.require_with_graceful_fail("toml") unless defined?(TOML)
|
||||
TOML.load_file(filename)
|
||||
when /\.ya?ml/i
|
||||
when %r!\.ya?ml!i
|
||||
SafeYAML.load_file(filename) || {}
|
||||
else
|
||||
raise ArgumentError, "No parser for '#{filename}' is available. Use a .toml or .y(a)ml file instead."
|
||||
raise ArgumentError, "No parser for '#{filename}' is available.
|
||||
Use a .toml or .y(a)ml file instead."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -122,12 +145,15 @@ module Jekyll
|
||||
# Returns an Array of config files
|
||||
def config_files(override)
|
||||
# Adjust verbosity quickly
|
||||
Jekyll.logger.adjust_verbosity(:quiet => quiet?(override), :verbose => verbose?(override))
|
||||
Jekyll.logger.adjust_verbosity(
|
||||
:quiet => quiet?(override),
|
||||
:verbose => verbose?(override)
|
||||
)
|
||||
|
||||
# Get configuration from <source>/_config.yml or <source>/<config_file>
|
||||
config_files = override.delete('config')
|
||||
config_files = override.delete("config")
|
||||
if config_files.to_s.empty?
|
||||
default = %w(yml yaml).find(-> { 'yml' }) do |ext|
|
||||
default = %w(yml yaml).find(-> { "yml" }) do |ext|
|
||||
File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}"))
|
||||
end
|
||||
config_files = Jekyll.sanitized_path(source(override), "_config.#{default}")
|
||||
@@ -148,11 +174,12 @@ module Jekyll
|
||||
Jekyll.logger.info "Configuration file:", file
|
||||
next_config
|
||||
rescue SystemCallError
|
||||
if @default_config_file
|
||||
if @default_config_file ||= nil
|
||||
Jekyll.logger.warn "Configuration file:", "none"
|
||||
{}
|
||||
else
|
||||
Jekyll.logger.error "Fatal:", "The configuration file '#{file}' could not be found."
|
||||
Jekyll.logger.error "Fatal:", "The configuration file '#{file}'
|
||||
could not be found."
|
||||
raise LoadError, "The Configuration file '#{file}' could not be found."
|
||||
end
|
||||
end
|
||||
@@ -168,13 +195,14 @@ module Jekyll
|
||||
|
||||
begin
|
||||
files.each do |config_file|
|
||||
next if config_file.nil? || config_file.empty?
|
||||
new_config = read_config_file(config_file)
|
||||
configuration = Utils.deep_merge_hashes(configuration, new_config)
|
||||
end
|
||||
rescue ArgumentError => err
|
||||
Jekyll.logger.warn "WARNING:", "Error reading configuration. " \
|
||||
"Using defaults (and options)."
|
||||
$stderr.puts "#{err}"
|
||||
$stderr.puts err
|
||||
end
|
||||
|
||||
configuration.fix_common_issues.backwards_compatibilize.add_default_collections
|
||||
@@ -196,61 +224,18 @@ module Jekyll
|
||||
def backwards_compatibilize
|
||||
config = clone
|
||||
# Provide backwards-compatibility
|
||||
if config.key?('auto') || config.key?('watch')
|
||||
Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" \
|
||||
" be set from your configuration file(s). Use the"\
|
||||
" --[no-]watch/-w command-line option instead."
|
||||
config.delete('auto')
|
||||
config.delete('watch')
|
||||
end
|
||||
check_auto(config)
|
||||
check_server(config)
|
||||
|
||||
if config.key? 'server'
|
||||
Jekyll::Deprecator.deprecation_message "The 'server' configuration option" \
|
||||
" is no longer accepted. Use the 'jekyll serve'" \
|
||||
" subcommand to serve your site with WEBrick."
|
||||
config.delete('server')
|
||||
end
|
||||
renamed_key "server_port", "port", config
|
||||
renamed_key "plugins", "plugins_dir", config
|
||||
renamed_key "layouts", "layouts_dir", config
|
||||
renamed_key "data_source", "data_dir", config
|
||||
|
||||
renamed_key 'server_port', 'port', config
|
||||
renamed_key 'plugins', 'plugins_dir', config
|
||||
renamed_key 'layouts', 'layouts_dir', config
|
||||
renamed_key 'data_source', 'data_dir', config
|
||||
|
||||
if config.key? 'pygments'
|
||||
Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" \
|
||||
" has been renamed to 'highlighter'. Please update your" \
|
||||
" config file accordingly. The allowed values are 'rouge', " \
|
||||
"'pygments' or null."
|
||||
|
||||
config['highlighter'] = 'pygments' if config['pygments']
|
||||
config.delete('pygments')
|
||||
end
|
||||
|
||||
%w(include exclude).each do |option|
|
||||
config[option] ||= []
|
||||
if config[option].is_a?(String)
|
||||
Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" \
|
||||
" must now be specified as an array, but you specified" \
|
||||
" a string. For now, we've treated the string you provided" \
|
||||
" as a list of comma-separated values."
|
||||
config[option] = csv_to_array(config[option])
|
||||
end
|
||||
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.logger.abort_with "Error:", "You're using the 'maruku' " \
|
||||
"Markdown processor, which has been removed as of 3.0.0. " \
|
||||
"We recommend you switch to Kramdown. To do this, replace " \
|
||||
"`markdown: maruku` with `markdown: kramdown` in your " \
|
||||
"`_config.yml` file."
|
||||
end
|
||||
check_pygments(config)
|
||||
check_include_exclude(config)
|
||||
check_coderay(config)
|
||||
check_maruku(config)
|
||||
|
||||
config
|
||||
end
|
||||
@@ -258,10 +243,12 @@ module Jekyll
|
||||
def fix_common_issues
|
||||
config = clone
|
||||
|
||||
if config.key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 1)
|
||||
Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" \
|
||||
" positive integer or nil. It's currently set to '#{config['paginate'].inspect}'."
|
||||
config['paginate'] = nil
|
||||
if config.key?("paginate") && (!config["paginate"].is_a?(Integer) ||
|
||||
config["paginate"] < 1)
|
||||
|
||||
Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a positive" \
|
||||
" integer or nil. It's currently set to '#{config["paginate"].inspect}'."
|
||||
config["paginate"] = nil
|
||||
end
|
||||
|
||||
config
|
||||
@@ -270,14 +257,22 @@ module Jekyll
|
||||
def add_default_collections
|
||||
config = clone
|
||||
|
||||
return config if config['collections'].nil?
|
||||
# It defaults to `{}`, so this is only if someone sets it to null manually.
|
||||
return config if config["collections"].nil?
|
||||
|
||||
if config['collections'].is_a?(Array)
|
||||
config['collections'] = Hash[config['collections'].map { |c| [c, {}] }]
|
||||
# Ensure we have a hash.
|
||||
if config["collections"].is_a?(Array)
|
||||
config["collections"] = Hash[config["collections"].map { |c| [c, {}] }]
|
||||
end
|
||||
|
||||
config["collections"] = Utils.deep_merge_hashes(
|
||||
{ "posts" => {} }, config["collections"]
|
||||
).tap do |collections|
|
||||
collections["posts"]["output"] = true
|
||||
if config["permalink"]
|
||||
collections["posts"]["permalink"] ||= style_to_permalink(config["permalink"])
|
||||
end
|
||||
end
|
||||
config['collections']['posts'] ||= {}
|
||||
config['collections']['posts']['output'] = true
|
||||
config['collections']['posts']['permalink'] = style_to_permalink(config['permalink'])
|
||||
|
||||
config
|
||||
end
|
||||
@@ -285,14 +280,13 @@ module Jekyll
|
||||
def renamed_key(old, new, config, _ = nil)
|
||||
if config.key?(old)
|
||||
Jekyll::Deprecator.deprecation_message "The '#{old}' configuration" \
|
||||
"option has been renamed to '#{new}'. Please update your config " \
|
||||
"file accordingly."
|
||||
" option has been renamed to '#{new}'. Please update your config" \
|
||||
" file accordingly."
|
||||
config[new] = config.delete(old)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def style_to_permalink(permalink_style)
|
||||
case permalink_style.to_sym
|
||||
when :pretty
|
||||
@@ -314,9 +308,78 @@ module Jekyll
|
||||
# file - the file from which the config was extracted
|
||||
#
|
||||
# Raises an ArgumentError if given config is not a hash
|
||||
private
|
||||
def check_config_is_hash!(extracted_config, file)
|
||||
unless extracted_config.is_a?(Hash)
|
||||
raise ArgumentError.new("Configuration file: (INVALID) #{file}".yellow)
|
||||
raise ArgumentError, "Configuration file: (INVALID) #{file}".yellow
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def check_auto(config)
|
||||
if config.key?("auto") || config.key?("watch")
|
||||
Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" \
|
||||
" be set from your configuration file(s). Use the" \
|
||||
" --[no-]watch/-w command-line option instead."
|
||||
config.delete("auto")
|
||||
config.delete("watch")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def check_server(config)
|
||||
if config.key?("server")
|
||||
Jekyll::Deprecator.deprecation_message "The 'server' configuration option" \
|
||||
" is no longer accepted. Use the 'jekyll serve'" \
|
||||
" subcommand to serve your site with WEBrick."
|
||||
config.delete("server")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def check_pygments(config)
|
||||
if config.key?("pygments")
|
||||
Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" \
|
||||
" has been renamed to 'highlighter'. Please update your" \
|
||||
" config file accordingly. The allowed values are 'rouge', " \
|
||||
"'pygments' or null."
|
||||
|
||||
config["highlighter"] = "pygments" if config["pygments"]
|
||||
config.delete("pygments")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def check_include_exclude(config)
|
||||
%w(include exclude).each do |option|
|
||||
if config[option].is_a?(String)
|
||||
Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" \
|
||||
" must now be specified as an array, but you specified" \
|
||||
" a string. For now, we've treated the string you provided" \
|
||||
" as a list of comma-separated values."
|
||||
config[option] = csv_to_array(config[option])
|
||||
end
|
||||
config[option].map!(&:to_s) if config[option]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def check_coderay(config)
|
||||
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
|
||||
end
|
||||
|
||||
private
|
||||
def check_maruku(config)
|
||||
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku").zero?
|
||||
Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " \
|
||||
"Markdown processor, which has been removed as of 3.0.0. " \
|
||||
"We recommend you switch to Kramdown. To do this, replace " \
|
||||
"`markdown: maruku` with `markdown: kramdown` in your " \
|
||||
"`_config.yml` file."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,9 @@ module Jekyll
|
||||
#
|
||||
# Returns the String prefix.
|
||||
def self.highlighter_prefix(highlighter_prefix = nil)
|
||||
@highlighter_prefix = highlighter_prefix if highlighter_prefix
|
||||
if !defined?(@highlighter_prefix) || !highlighter_prefix.nil?
|
||||
@highlighter_prefix = highlighter_prefix
|
||||
end
|
||||
@highlighter_prefix
|
||||
end
|
||||
|
||||
@@ -20,7 +22,9 @@ module Jekyll
|
||||
#
|
||||
# Returns the String suffix.
|
||||
def self.highlighter_suffix(highlighter_suffix = nil)
|
||||
@highlighter_suffix = highlighter_suffix if highlighter_suffix
|
||||
if !defined?(@highlighter_suffix) || !highlighter_suffix.nil?
|
||||
@highlighter_suffix = highlighter_suffix
|
||||
end
|
||||
@highlighter_suffix
|
||||
end
|
||||
|
||||
|
||||
@@ -6,26 +6,36 @@ module Jekyll
|
||||
safe true
|
||||
|
||||
def setup
|
||||
return if @setup
|
||||
return if @setup ||= false
|
||||
unless (@parser = get_processor)
|
||||
Jekyll.logger.error "Invalid Markdown processor given:", @config["markdown"]
|
||||
Jekyll.logger.info "", "Custom processors are not loaded in safe mode" if @config["safe"]
|
||||
Jekyll.logger.error "", "Available processors are: #{valid_processors.join(", ")}"
|
||||
if @config["safe"]
|
||||
Jekyll.logger.info "", "Custom processors are not loaded in safe mode"
|
||||
end
|
||||
Jekyll.logger.error(
|
||||
"",
|
||||
"Available processors are: #{valid_processors.join(", ")}"
|
||||
)
|
||||
raise Errors::FatalException, "Bailing out; invalid Markdown processor."
|
||||
end
|
||||
|
||||
@setup = true
|
||||
end
|
||||
|
||||
# Rubocop does not allow reader methods to have names starting with `get_`
|
||||
# To ensure compatibility, this check has been disabled on this method
|
||||
#
|
||||
# rubocop:disable Style/AccessorMethodName
|
||||
def get_processor
|
||||
case @config["markdown"].downcase
|
||||
when "redcarpet" then return RedcarpetParser.new(@config)
|
||||
when "kramdown" then return KramdownParser.new(@config)
|
||||
when "rdiscount" then return RDiscountParser.new(@config)
|
||||
else
|
||||
get_custom_processor
|
||||
custom_processor
|
||||
end
|
||||
end
|
||||
# rubocop:enable Style/AccessorMethodName
|
||||
|
||||
# Public: Provides you with a list of processors, the ones we
|
||||
# support internally and the ones that you have provided to us (if you
|
||||
@@ -41,13 +51,13 @@ module Jekyll
|
||||
|
||||
def third_party_processors
|
||||
self.class.constants - \
|
||||
%w(KramdownParser RDiscountParser RedcarpetParser PRIORITIES).map(
|
||||
&:to_sym
|
||||
)
|
||||
%w(KramdownParser RDiscountParser RedcarpetParser PRIORITIES).map(
|
||||
&:to_sym
|
||||
)
|
||||
end
|
||||
|
||||
def extname_list
|
||||
@extname_list ||= @config['markdown_ext'].split(',').map do |e|
|
||||
@extname_list ||= @config["markdown_ext"].split(",").map do |e|
|
||||
".#{e.downcase}"
|
||||
end
|
||||
end
|
||||
@@ -66,7 +76,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
private
|
||||
def get_custom_processor
|
||||
def custom_processor
|
||||
converter_name = @config["markdown"]
|
||||
if custom_class_allowed?(converter_name)
|
||||
self.class.const_get(converter_name).new(@config)
|
||||
@@ -83,7 +93,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def custom_class_allowed?(parser_name)
|
||||
parser_name !~ /[^A-Za-z0-9_]/ && self.class.constants.include?(
|
||||
parser_name !~ %r![^A-Za-z0-9_]! && self.class.constants.include?(
|
||||
parser_name.to_sym
|
||||
)
|
||||
end
|
||||
|
||||
35
lib/jekyll/converters/markdown/inline.rb
Normal file
35
lib/jekyll/converters/markdown/inline.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
class Kramdown::Parser::Inline < Kramdown::Parser::Kramdown
|
||||
def initialize(source, options)
|
||||
super
|
||||
@block_parsers = [:block_html].freeze
|
||||
end
|
||||
end
|
||||
|
||||
module Jekyll
|
||||
module Converters
|
||||
class Markdown
|
||||
class Inline < Converter
|
||||
safe true
|
||||
priority :low
|
||||
|
||||
def initialize(config)
|
||||
Jekyll::External.require_with_graceful_fail "kramdown"
|
||||
@config = config["kramdown"].dup || {}
|
||||
@config[:input] = :Inline
|
||||
end
|
||||
|
||||
def matches(_)
|
||||
false
|
||||
end
|
||||
|
||||
def output_ext(_)
|
||||
nil
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
Kramdown::Document.new(content, @config).to_html.chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -12,18 +12,20 @@ module Jekyll
|
||||
"line_number_start" => 1,
|
||||
"tab_width" => 4,
|
||||
"wrap" => "div"
|
||||
}
|
||||
}.freeze
|
||||
|
||||
def initialize(config)
|
||||
Jekyll::External.require_with_graceful_fail "kramdown"
|
||||
@main_fallback_highlighter = config["highlighter"] || "rogue"
|
||||
@main_fallback_highlighter = config["highlighter"] || "rouge"
|
||||
@config = config["kramdown"] || {}
|
||||
@highlighter = nil
|
||||
setup
|
||||
end
|
||||
|
||||
# Setup and normalize the configuration:
|
||||
# * Create Kramdown if it doesn't exist.
|
||||
# * Set syntax_highlighter, detecting enable_coderay and merging highlighter if none.
|
||||
# * Set syntax_highlighter, detecting enable_coderay and merging
|
||||
# highlighter if none.
|
||||
# * Merge kramdown[coderay] into syntax_highlighter_opts stripping coderay_.
|
||||
# * Make sure `syntax_highlighter_opts` exists.
|
||||
|
||||
@@ -32,22 +34,48 @@ module Jekyll
|
||||
@config["syntax_highlighter_opts"] ||= {}
|
||||
@config["coderay"] ||= {} # XXX: Legacy.
|
||||
modernize_coderay_config
|
||||
make_accessible
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
Kramdown::Document.new(content, @config).to_html
|
||||
end
|
||||
|
||||
# config[kramdown][syntax_higlighter] > config[kramdown][enable_coderay] > config[highlighter]
|
||||
private
|
||||
def make_accessible(hash = @config)
|
||||
proc_ = proc { |hash_, key| hash_[key.to_s] if key.is_a?(Symbol) }
|
||||
hash.default_proc = proc_
|
||||
|
||||
hash.each do |_, val|
|
||||
make_accessible val if val.is_a?(
|
||||
Hash
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# config[kramdown][syntax_higlighter] >
|
||||
# config[kramdown][enable_coderay] >
|
||||
# config[highlighter]
|
||||
# Where `enable_coderay` is now deprecated because Kramdown
|
||||
# supports Rouge now too.
|
||||
|
||||
private
|
||||
def highlighter
|
||||
@highlighter ||= begin
|
||||
if highlighter = @config["syntax_highlighter"] then highlighter
|
||||
elsif @config.key?("enable_coderay") && @config["enable_coderay"]
|
||||
Jekyll::Deprecator.deprecation_message "You are using 'enable_coderay', use syntax_highlighter: coderay in your configuration file."
|
||||
return @highlighter if @highlighter
|
||||
|
||||
if @config["syntax_highlighter"]
|
||||
return @highlighter = @config[
|
||||
"syntax_highlighter"
|
||||
]
|
||||
end
|
||||
|
||||
@highlighter = begin
|
||||
if @config.key?("enable_coderay") && @config["enable_coderay"]
|
||||
Jekyll::Deprecator.deprecation_message(
|
||||
"You are using 'enable_coderay', " \
|
||||
"use syntax_highlighter: coderay in your configuration file."
|
||||
)
|
||||
|
||||
"coderay"
|
||||
else
|
||||
@main_fallback_highlighter
|
||||
@@ -58,8 +86,14 @@ module Jekyll
|
||||
private
|
||||
def strip_coderay_prefix(hash)
|
||||
hash.each_with_object({}) do |(key, val), hsh|
|
||||
cleaned_key = key.gsub(/\Acoderay_/, "")
|
||||
Jekyll::Deprecator.deprecation_message "You are using '#{key}'. Normalizing to #{cleaned_key}." if key != cleaned_key
|
||||
cleaned_key = key.gsub(%r!\Acoderay_!, "")
|
||||
|
||||
if key != cleaned_key
|
||||
Jekyll::Deprecator.deprecation_message(
|
||||
"You are using '#{key}'. Normalizing to #{cleaned_key}."
|
||||
)
|
||||
end
|
||||
|
||||
hsh[cleaned_key] = val
|
||||
end
|
||||
end
|
||||
@@ -70,8 +104,12 @@ module Jekyll
|
||||
|
||||
private
|
||||
def modernize_coderay_config
|
||||
if highlighter == "coderay"
|
||||
Jekyll::Deprecator.deprecation_message "You are using 'kramdown.coderay' in your configuration, please use 'syntax_highlighter_opts' instead."
|
||||
unless @config["coderay"].empty?
|
||||
Jekyll::Deprecator.deprecation_message(
|
||||
"You are using 'kramdown.coderay' in your configuration, " \
|
||||
"please use 'syntax_highlighter_opts' instead."
|
||||
)
|
||||
|
||||
@config["syntax_highlighter_opts"] = begin
|
||||
strip_coderay_prefix(
|
||||
@config["syntax_highlighter_opts"] \
|
||||
|
||||
@@ -5,14 +5,14 @@ module Jekyll
|
||||
def initialize(config)
|
||||
Jekyll::External.require_with_graceful_fail "rdiscount"
|
||||
@config = config
|
||||
@rdiscount_extensions = @config['rdiscount']['extensions'].map(&:to_sym)
|
||||
@rdiscount_extensions = @config["rdiscount"]["extensions"].map(&:to_sym)
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
rd = RDiscount.new(content, *@rdiscount_extensions)
|
||||
html = rd.to_html
|
||||
if @config['rdiscount']['toc_token']
|
||||
html = replace_generated_toc(rd, html, @config['rdiscount']['toc_token'])
|
||||
if @config["rdiscount"]["toc_token"]
|
||||
html = replace_generated_toc(rd, html, @config["rdiscount"]["toc_token"])
|
||||
end
|
||||
html
|
||||
end
|
||||
@@ -21,7 +21,7 @@ module Jekyll
|
||||
def replace_generated_toc(rd, html, toc_token)
|
||||
if rd.generate_toc && html.include?(toc_token)
|
||||
utf8_toc = rd.toc_content
|
||||
utf8_toc.force_encoding('utf-8') if utf8_toc.respond_to?(:force_encoding)
|
||||
utf8_toc.force_encoding("utf-8") if utf8_toc.respond_to?(:force_encoding)
|
||||
html.gsub(toc_token, utf8_toc)
|
||||
else
|
||||
html
|
||||
|
||||
@@ -1,102 +1,108 @@
|
||||
module Jekyll
|
||||
module Converters
|
||||
class Markdown
|
||||
class RedcarpetParser
|
||||
module CommonMethods
|
||||
def add_code_tags(code, lang)
|
||||
code = code.to_s
|
||||
code = code.sub(/<pre>/, "<pre><code class=\"language-#{lang}\" data-lang=\"#{lang}\">")
|
||||
code = code.sub(/<\/pre>/, "</code></pre>")
|
||||
code
|
||||
end
|
||||
class Jekyll::Converters::Markdown::RedcarpetParser
|
||||
module CommonMethods
|
||||
def add_code_tags(code, lang)
|
||||
code = code.to_s
|
||||
code = code.sub(
|
||||
%r!<pre>!,
|
||||
"<pre><code class=\"language-#{lang}\" data-lang=\"#{lang}\">"
|
||||
)
|
||||
code = code.sub(%r!</pre>!, "</code></pre>")
|
||||
code
|
||||
end
|
||||
end
|
||||
|
||||
module WithPygments
|
||||
include CommonMethods
|
||||
def block_code(code, lang)
|
||||
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" }
|
||||
}
|
||||
),
|
||||
lang
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
module WithoutHighlighting
|
||||
require "cgi"
|
||||
|
||||
include CommonMethods
|
||||
|
||||
def code_wrap(code)
|
||||
"<figure class=\"highlight\"><pre>#{CGI.escapeHTML(code)}</pre></figure>"
|
||||
end
|
||||
|
||||
def block_code(code, lang)
|
||||
lang = lang && lang.split.first || "text"
|
||||
add_code_tags(code_wrap(code), lang)
|
||||
end
|
||||
end
|
||||
|
||||
module WithRouge
|
||||
def block_code(code, lang)
|
||||
code = "<pre>#{super}</pre>"
|
||||
|
||||
output = "<div class=\"highlight\">"
|
||||
output << add_code_tags(code, lang)
|
||||
output << "</div>"
|
||||
end
|
||||
|
||||
protected
|
||||
def rouge_formatter(_lexer)
|
||||
Rouge::Formatters::HTML.new(:wrap => false)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(config)
|
||||
Jekyll::External.require_with_graceful_fail("redcarpet")
|
||||
@config = config
|
||||
@redcarpet_extensions = {}
|
||||
@config["redcarpet"]["extensions"].each do |e|
|
||||
@redcarpet_extensions[e.to_sym] = true
|
||||
end
|
||||
|
||||
@renderer ||= class_with_proper_highlighter(@config["highlighter"])
|
||||
end
|
||||
|
||||
def class_with_proper_highlighter(highlighter)
|
||||
Class.new(Redcarpet::Render::HTML) do
|
||||
case highlighter
|
||||
when "pygments"
|
||||
include WithPygments
|
||||
when "rouge"
|
||||
Jekyll::External.require_with_graceful_fail(%w(
|
||||
rouge rouge/plugins/redcarpet
|
||||
))
|
||||
|
||||
unless Gem::Version.new(Rouge.version) > Gem::Version.new("1.3.0")
|
||||
abort "Please install Rouge 1.3.0 or greater and try running Jekyll again."
|
||||
end
|
||||
|
||||
module WithPygments
|
||||
include CommonMethods
|
||||
def block_code(code, lang)
|
||||
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' }),
|
||||
lang
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
module WithoutHighlighting
|
||||
require 'cgi'
|
||||
|
||||
include CommonMethods
|
||||
|
||||
def code_wrap(code)
|
||||
"<figure class=\"highlight\"><pre>#{CGI::escapeHTML(code)}</pre></figure>"
|
||||
end
|
||||
|
||||
def block_code(code, lang)
|
||||
lang = lang && lang.split.first || "text"
|
||||
add_code_tags(code_wrap(code), lang)
|
||||
end
|
||||
end
|
||||
|
||||
module WithRouge
|
||||
def block_code(code, lang)
|
||||
code = "<pre>#{super}</pre>"
|
||||
|
||||
output = "<div class=\"highlight\">"
|
||||
output << add_code_tags(code, lang)
|
||||
output << "</div>"
|
||||
end
|
||||
|
||||
protected
|
||||
def rouge_formatter(_lexer)
|
||||
Rouge::Formatters::HTML.new(:wrap => false)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(config)
|
||||
External.require_with_graceful_fail("redcarpet")
|
||||
@config = config
|
||||
@redcarpet_extensions = {}
|
||||
@config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true }
|
||||
|
||||
@renderer ||= class_with_proper_highlighter(@config['highlighter'])
|
||||
end
|
||||
|
||||
def class_with_proper_highlighter(highlighter)
|
||||
case highlighter
|
||||
when "pygments"
|
||||
Class.new(Redcarpet::Render::HTML) do
|
||||
include WithPygments
|
||||
end
|
||||
when "rouge"
|
||||
Class.new(Redcarpet::Render::HTML) do
|
||||
Jekyll::External.require_with_graceful_fail(%w(
|
||||
rouge
|
||||
rouge/plugins/redcarpet
|
||||
))
|
||||
|
||||
unless Gem::Version.new(Rouge.version) > Gem::Version.new("1.3.0")
|
||||
abort "Please install Rouge 1.3.0 or greater and try running Jekyll again."
|
||||
end
|
||||
|
||||
include Rouge::Plugins::Redcarpet
|
||||
include CommonMethods
|
||||
include WithRouge
|
||||
end
|
||||
else
|
||||
Class.new(Redcarpet::Render::HTML) do
|
||||
include WithoutHighlighting
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
@redcarpet_extensions[:fenced_code_blocks] = !@redcarpet_extensions[:no_fenced_code_blocks]
|
||||
@renderer.send :include, Redcarpet::Render::SmartyPants if @redcarpet_extensions[:smart]
|
||||
markdown = Redcarpet::Markdown.new(@renderer.new(@redcarpet_extensions), @redcarpet_extensions)
|
||||
markdown.render(content)
|
||||
end
|
||||
include Rouge::Plugins::Redcarpet
|
||||
include CommonMethods
|
||||
include WithRouge
|
||||
else
|
||||
include WithoutHighlighting
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
@redcarpet_extensions[:fenced_code_blocks] = \
|
||||
!@redcarpet_extensions[:no_fenced_code_blocks]
|
||||
if @redcarpet_extensions[:smart]
|
||||
@renderer.send :include, Redcarpet::Render::SmartyPants
|
||||
end
|
||||
markdown = Redcarpet::Markdown.new(
|
||||
@renderer.new(@redcarpet_extensions),
|
||||
@redcarpet_extensions
|
||||
)
|
||||
markdown.render(content)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
require 'set'
|
||||
require "set"
|
||||
|
||||
# Convertible provides methods for converting a pagelike item
|
||||
# from a certain type of markup into actual content
|
||||
@@ -20,18 +20,12 @@ module Jekyll
|
||||
module Convertible
|
||||
# Returns the contents as a String.
|
||||
def to_s
|
||||
content || ''
|
||||
content || ""
|
||||
end
|
||||
|
||||
# Whether the file is published or not, as indicated in YAML front-matter
|
||||
def published?
|
||||
!(data.key?('published') && data['published'] == false)
|
||||
end
|
||||
|
||||
# Returns merged option hash for File.read of self.site (if exists)
|
||||
# and a given param
|
||||
def merged_file_read_opts(opts)
|
||||
(site ? site.file_read_opts : {}).merge(opts)
|
||||
!(data.key?("published") && data["published"] == false)
|
||||
end
|
||||
|
||||
# Read the YAML frontmatter.
|
||||
@@ -41,19 +35,20 @@ module Jekyll
|
||||
# opts - optional parameter to File.read, default at site configs
|
||||
#
|
||||
# Returns nothing.
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def read_yaml(base, name, opts = {})
|
||||
filename = File.join(base, name)
|
||||
|
||||
begin
|
||||
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 = File.read(@path || site.in_source_dir(base, name),
|
||||
Utils.merged_file_read_opts(site, opts))
|
||||
if content =~ Document::YAML_FRONT_MATTER_REGEXP
|
||||
self.content = $POSTMATCH
|
||||
self.data = SafeYAML.load(Regexp.last_match(1))
|
||||
end
|
||||
rescue SyntaxError => e
|
||||
Jekyll.logger.warn "YAML Exception reading #{filename}: #{e.message}"
|
||||
rescue Exception => e
|
||||
rescue => e
|
||||
Jekyll.logger.warn "Error reading file #{filename}: #{e.message}"
|
||||
end
|
||||
|
||||
@@ -64,15 +59,17 @@ module Jekyll
|
||||
|
||||
self.data
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
def validate_data!(filename)
|
||||
unless self.data.is_a?(Hash)
|
||||
raise Errors::InvalidYAMLFrontMatterError, "Invalid YAML front matter in #{filename}"
|
||||
raise Errors::InvalidYAMLFrontMatterError,
|
||||
"Invalid YAML front matter in #{filename}"
|
||||
end
|
||||
end
|
||||
|
||||
def validate_permalink!(filename)
|
||||
if self.data['permalink'] && self.data['permalink'].size == 0
|
||||
if self.data["permalink"] && self.data["permalink"].empty?
|
||||
raise Errors::InvalidPermalinkError, "Invalid permalink in #{filename}"
|
||||
end
|
||||
end
|
||||
@@ -81,15 +78,7 @@ module Jekyll
|
||||
#
|
||||
# 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 while converting '#{path}':"
|
||||
Jekyll.logger.error("", e.to_s)
|
||||
raise e
|
||||
end
|
||||
end
|
||||
_renderer.transform
|
||||
end
|
||||
|
||||
# Determine the extension depending on content_type.
|
||||
@@ -97,7 +86,7 @@ module Jekyll
|
||||
# Returns the String extension for the output file.
|
||||
# e.g. ".html" for an HTML output file.
|
||||
def output_ext
|
||||
Jekyll::Renderer.new(site, self).output_ext
|
||||
_renderer.output_ext
|
||||
end
|
||||
|
||||
# Determine which converter to use based on this convertible's
|
||||
@@ -105,7 +94,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the Converter instance.
|
||||
def converters
|
||||
@converters ||= site.converters.select { |c| c.matches(ext) }.sort
|
||||
_renderer.converters
|
||||
end
|
||||
|
||||
# Render Liquid in the content
|
||||
@@ -116,14 +105,9 @@ module Jekyll
|
||||
#
|
||||
# Returns the converted content
|
||||
def render_liquid(content, payload, info, path)
|
||||
site.liquid_renderer.file(path).parse(content).render!(payload, info)
|
||||
rescue Tags::IncludeTagError => e
|
||||
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{e.path}, included in #{path || self.path}"
|
||||
raise e
|
||||
rescue Exception => e
|
||||
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{path || self.path}"
|
||||
raise e
|
||||
_renderer.render_liquid(content, payload, info, path)
|
||||
end
|
||||
# rubocop: enable RescueException
|
||||
|
||||
# Convert this Convertible's data to a Hash suitable for use by Liquid.
|
||||
#
|
||||
@@ -174,7 +158,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if extname == .coffee, false otherwise.
|
||||
def coffeescript_file?
|
||||
'.coffee'.eql?(ext)
|
||||
".coffee" == ext
|
||||
end
|
||||
|
||||
# Determine whether the file should be rendered with Liquid.
|
||||
@@ -208,37 +192,10 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def render_all_layouts(layouts, payload, info)
|
||||
# recursively render layouts
|
||||
layout = layouts[data["layout"]]
|
||||
|
||||
Jekyll.logger.warn("Build Warning:", "Layout '#{data["layout"]}' requested in #{path} does not exist.") if invalid_layout? layout
|
||||
|
||||
used = Set.new([layout])
|
||||
|
||||
while layout
|
||||
Jekyll.logger.debug "Rendering Layout:", path
|
||||
payload["content"] = output
|
||||
payload["layout"] = Utils.deep_merge_hashes(payload["layout"] || {}, layout.data)
|
||||
|
||||
self.output = render_liquid(layout.content,
|
||||
payload,
|
||||
info,
|
||||
File.join(site.config['layouts_dir'], layout.name))
|
||||
|
||||
# Add layout to dependency tree
|
||||
site.regenerator.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
|
||||
else
|
||||
used << layout
|
||||
end
|
||||
end
|
||||
end
|
||||
_renderer.layouts = layouts
|
||||
self.output = _renderer.place_in_layouts(output, payload, info)
|
||||
ensure
|
||||
@_renderer = nil # this will allow the modifications above to disappear
|
||||
end
|
||||
|
||||
# Add any necessary layouts to this convertible document.
|
||||
@@ -248,29 +205,15 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def do_layout(payload, layouts)
|
||||
Jekyll.logger.debug "Rendering:", self.relative_path
|
||||
self.output = _renderer.tap do |renderer|
|
||||
renderer.layouts = layouts
|
||||
renderer.payload = payload
|
||||
end.run
|
||||
|
||||
Jekyll.logger.debug "Pre-Render Hooks:", self.relative_path
|
||||
Jekyll::Hooks.trigger hook_owner, :pre_render, self, payload
|
||||
info = { :filters => [Jekyll::Filters], :registers => { :site => site, :page => payload["page"] } }
|
||||
|
||||
# render and transform content (this becomes the final content of the object)
|
||||
payload["highlighter_prefix"] = converters.first.highlighter_prefix
|
||||
payload["highlighter_suffix"] = converters.first.highlighter_suffix
|
||||
|
||||
if render_with_liquid?
|
||||
Jekyll.logger.debug "Rendering Liquid:", self.relative_path
|
||||
self.content = render_liquid(content, payload, info, path)
|
||||
end
|
||||
Jekyll.logger.debug "Rendering Markup:", self.relative_path
|
||||
self.content = transform
|
||||
|
||||
# output keeps track of what will finally be written
|
||||
self.output = content
|
||||
|
||||
render_all_layouts(layouts, payload, info) if place_in_layout?
|
||||
Jekyll.logger.debug "Post-Render Hooks:", self.relative_path
|
||||
Jekyll::Hooks.trigger hook_owner, :post_render, self
|
||||
ensure
|
||||
@_renderer = nil # this will allow the modifications above to disappear
|
||||
end
|
||||
|
||||
# Write the generated page file to the destination directory.
|
||||
@@ -281,9 +224,7 @@ module Jekyll
|
||||
def write(dest)
|
||||
path = destination(dest)
|
||||
FileUtils.mkdir_p(File.dirname(path))
|
||||
File.open(path, 'wb') do |f|
|
||||
f.write(output)
|
||||
end
|
||||
File.write(path, output, :mode => "wb")
|
||||
Jekyll::Hooks.trigger hook_owner, :post_write, self
|
||||
end
|
||||
|
||||
@@ -299,5 +240,10 @@ module Jekyll
|
||||
data[property]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def _renderer
|
||||
@_renderer ||= Jekyll::Renderer.new(site, self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,20 +9,24 @@ module Jekyll
|
||||
'serve' subcommand."
|
||||
arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \
|
||||
use the 'build' subcommand."
|
||||
arg_is_present? args, "--auto", "The switch '--auto' has been replaced with '--watch'."
|
||||
arg_is_present? args, "--auto", "The switch '--auto' has been replaced with \
|
||||
'--watch'."
|
||||
arg_is_present? args, "--no-auto", "To disable auto-replication, simply leave off \
|
||||
the '--watch' switch."
|
||||
arg_is_present? args, "--pygments", "The 'pygments'settings has been removed in \
|
||||
favour of 'highlighter'."
|
||||
arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in your \
|
||||
arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in \
|
||||
your config files."
|
||||
arg_is_present? args, "--url", "The 'url' setting can only be set in your \
|
||||
config files."
|
||||
arg_is_present? args, "--url", "The 'url' setting can only be set in your config files."
|
||||
no_subcommand(args)
|
||||
end
|
||||
|
||||
def no_subcommand(args)
|
||||
if args.size > 0 && args.first =~ /^--/ && !%w(--help --version).include?(args.first)
|
||||
deprecation_message "Jekyll now uses subcommands instead of just switches. Run `jekyll --help` to find out more."
|
||||
unless args.empty? ||
|
||||
args.first !~ %r(!/^--/!) || %w(--help --version).include?(args.first)
|
||||
deprecation_message "Jekyll now uses subcommands instead of just switches. \
|
||||
Run `jekyll help` to find out more."
|
||||
abort
|
||||
end
|
||||
end
|
||||
@@ -39,7 +43,8 @@ module Jekyll
|
||||
|
||||
def defaults_deprecate_type(old, current)
|
||||
Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'."
|
||||
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'."
|
||||
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \
|
||||
'type: #{current}'."
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -7,9 +7,9 @@ module Jekyll
|
||||
attr_reader :path, :site, :extname, :collection
|
||||
attr_accessor :content, :output
|
||||
|
||||
YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
DATELESS_FILENAME_MATCHER = /^(.+\/)*(.*)(\.[^.]+)$/
|
||||
DATE_FILENAME_MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
|
||||
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m
|
||||
DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$!
|
||||
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$!
|
||||
|
||||
# Create a new Document.
|
||||
#
|
||||
@@ -51,24 +51,18 @@ module Jekyll
|
||||
#
|
||||
# Returns the merged data.
|
||||
def merge_data!(other, source: "YAML front matter")
|
||||
if other.key?('categories') && !other['categories'].nil?
|
||||
if other['categories'].is_a?(String)
|
||||
other['categories'] = other['categories'].split(" ").map(&:strip)
|
||||
end
|
||||
other['categories'] = (data['categories'] || []) | other['categories']
|
||||
end
|
||||
merge_categories!(other)
|
||||
Utils.deep_merge_hashes!(data, other)
|
||||
if data.key?('date') && !data['date'].is_a?(Time)
|
||||
data['date'] = Utils.parse_date(
|
||||
data['date'].to_s,
|
||||
"Document '#{relative_path}' does not have a valid date in the #{source}."
|
||||
)
|
||||
end
|
||||
merge_date!(source)
|
||||
data
|
||||
end
|
||||
|
||||
def date
|
||||
data['date'] ||= site.time
|
||||
data["date"] ||= (draft? ? source_file_mtime : site.time)
|
||||
end
|
||||
|
||||
def source_file_mtime
|
||||
@source_file_mtime ||= File.mtime(path)
|
||||
end
|
||||
|
||||
# Returns whether the document is a draft. This is only the case if
|
||||
@@ -77,7 +71,8 @@ module Jekyll
|
||||
#
|
||||
# Returns whether the document is a draft.
|
||||
def draft?
|
||||
data['draft'] ||= relative_path.index(collection.relative_directory).nil? && collection.label == "posts"
|
||||
data["draft"] ||= relative_path.index(collection.relative_directory).nil? &&
|
||||
collection.label == "posts"
|
||||
end
|
||||
|
||||
# The path to the document, relative to the site source.
|
||||
@@ -85,7 +80,7 @@ module Jekyll
|
||||
# Returns a String path which represents the relative path
|
||||
# from the site source to this document
|
||||
def relative_path
|
||||
@relative_path ||= Pathname.new(path).relative_path_from(Pathname.new(site.source)).to_s
|
||||
@relative_path ||= Pathutil.new(path).relative_path_from(site.source).to_s
|
||||
end
|
||||
|
||||
# The output extension of the document.
|
||||
@@ -99,7 +94,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the basename without the file extname.
|
||||
def basename_without_ext
|
||||
@basename_without_ext ||= File.basename(path, '.*')
|
||||
@basename_without_ext ||= File.basename(path, ".*")
|
||||
end
|
||||
|
||||
# The base filename of the document.
|
||||
@@ -152,7 +147,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if extname == .coffee, false otherwise.
|
||||
def coffeescript_file?
|
||||
'.coffee'.eql?(extname)
|
||||
".coffee" == extname
|
||||
end
|
||||
|
||||
# Determine whether the file should be rendered with Liquid.
|
||||
@@ -191,7 +186,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the permalink or nil if no permalink was set in the data.
|
||||
def permalink
|
||||
data && data.is_a?(Hash) && data['permalink']
|
||||
data && data.is_a?(Hash) && data["permalink"]
|
||||
end
|
||||
|
||||
# The computed URL for the document. See `Jekyll::URL#to_s` for more details.
|
||||
@@ -199,9 +194,9 @@ module Jekyll
|
||||
# Returns the computed URL for the document.
|
||||
def url
|
||||
@url = URL.new({
|
||||
:template => url_template,
|
||||
:template => url_template,
|
||||
:placeholders => url_placeholders,
|
||||
:permalink => permalink
|
||||
:permalink => permalink
|
||||
}).to_s
|
||||
end
|
||||
|
||||
@@ -217,8 +212,11 @@ module Jekyll
|
||||
def destination(base_directory)
|
||||
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.end_with?("/")
|
||||
path << output_ext unless path.end_with? output_ext
|
||||
if url.end_with? "/"
|
||||
path = File.join(path, "index.html")
|
||||
else
|
||||
path << output_ext unless path.end_with? output_ext
|
||||
end
|
||||
path
|
||||
end
|
||||
|
||||
@@ -230,28 +228,17 @@ module Jekyll
|
||||
def write(dest)
|
||||
path = destination(dest)
|
||||
FileUtils.mkdir_p(File.dirname(path))
|
||||
File.open(path, 'wb') do |f|
|
||||
f.write(output)
|
||||
end
|
||||
File.write(path, output, :mode => "wb")
|
||||
|
||||
trigger_hooks(:post_write)
|
||||
end
|
||||
|
||||
# Returns merged option hash for File.read of self.site (if exists)
|
||||
# and a given param
|
||||
#
|
||||
# opts - override options
|
||||
#
|
||||
# Return the file read options hash.
|
||||
def merged_file_read_opts(opts)
|
||||
site ? site.file_read_opts.merge(opts) : opts
|
||||
end
|
||||
|
||||
# Whether the file is published or not, as indicated in YAML front-matter
|
||||
#
|
||||
# Returns true if the 'published' key is specified in the YAML front-matter and not `false`.
|
||||
# Returns 'false' if the 'published' key is specified in the
|
||||
# YAML front-matter and is 'false'. Otherwise returns 'true'.
|
||||
def published?
|
||||
!(data.key?('published') && data['published'] == false)
|
||||
!(data.key?("published") && data["published"] == false)
|
||||
end
|
||||
|
||||
# Read in the file and assign the content and data based on the file contents.
|
||||
@@ -266,75 +253,18 @@ module Jekyll
|
||||
@data = SafeYAML.load_file(path)
|
||||
else
|
||||
begin
|
||||
defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
|
||||
merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
|
||||
|
||||
self.content = File.read(path, merged_file_read_opts(opts))
|
||||
if content =~ YAML_FRONT_MATTER_REGEXP
|
||||
self.content = $POSTMATCH
|
||||
data_file = SafeYAML.load(Regexp.last_match(1))
|
||||
merge_data!(data_file, source: "YAML front matter") if data_file
|
||||
end
|
||||
|
||||
post_read
|
||||
merge_defaults
|
||||
read_content(opts)
|
||||
read_post_data
|
||||
rescue SyntaxError => e
|
||||
Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{e.message}"
|
||||
rescue Exception => e
|
||||
if e.is_a? Jekyll::Errors::FatalException
|
||||
raise e
|
||||
end
|
||||
rescue => e
|
||||
raise e if e.is_a? Jekyll::Errors::FatalException
|
||||
Jekyll.logger.error "Error:", "could not read file #{path}: #{e.message}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def post_read
|
||||
if relative_path =~ DATE_FILENAME_MATCHER
|
||||
date, slug, ext = $2, $3, $4
|
||||
if !data['date'] || data['date'].to_i == site.time.to_i
|
||||
merge_data!({"date" => date}, source: "filename")
|
||||
end
|
||||
elsif relative_path =~ DATELESS_FILENAME_MATCHER
|
||||
slug, ext = $2, $3
|
||||
end
|
||||
|
||||
# Try to ensure the user gets a title.
|
||||
data["title"] ||= Utils.titleize_slug(slug)
|
||||
# Only overwrite slug & ext if they aren't specified.
|
||||
data['slug'] ||= slug
|
||||
data['ext'] ||= ext
|
||||
|
||||
populate_categories
|
||||
populate_tags
|
||||
generate_excerpt
|
||||
end
|
||||
|
||||
# Add superdirectories of the special_dir to categories.
|
||||
# In the case of es/_posts, 'es' is added as a category.
|
||||
# In the case of _posts/es, 'es' is NOT added as a category.
|
||||
#
|
||||
# Returns nothing.
|
||||
def categories_from_path(special_dir)
|
||||
superdirs = relative_path.sub(/#{special_dir}(.*)/, '').split(File::SEPARATOR).reject do |c|
|
||||
c.empty? || c.eql?(special_dir) || c.eql?(basename)
|
||||
end
|
||||
merge_data!({ 'categories' => superdirs }, source: "file path")
|
||||
end
|
||||
|
||||
def populate_categories
|
||||
merge_data!({
|
||||
'categories' => (
|
||||
Array(data['categories']) + Utils.pluralized_array_from_hash(data, 'category', 'categories')
|
||||
).map(&:to_s).flatten.uniq
|
||||
})
|
||||
end
|
||||
|
||||
def populate_tags
|
||||
merge_data!({
|
||||
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
|
||||
})
|
||||
end
|
||||
|
||||
# Create a Liquid-understandable version of this Document.
|
||||
#
|
||||
# Returns a Hash representing this Document's data.
|
||||
@@ -354,7 +284,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the content of the document
|
||||
def to_s
|
||||
output || content || 'NO CONTENT'
|
||||
output || content || "NO CONTENT"
|
||||
end
|
||||
|
||||
# Compare this document against another document.
|
||||
@@ -364,8 +294,8 @@ module Jekyll
|
||||
# equal or greater than the other doc's path. See String#<=> for more details.
|
||||
def <=>(other)
|
||||
return nil unless other.respond_to?(:data)
|
||||
cmp = data['date'] <=> other.data['date']
|
||||
cmp = path <=> other.path if cmp.nil? || cmp == 0
|
||||
cmp = data["date"] <=> other.data["date"]
|
||||
cmp = path <=> other.path if cmp.nil? || cmp.zero?
|
||||
cmp
|
||||
end
|
||||
|
||||
@@ -383,7 +313,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the document excerpt_separator
|
||||
def excerpt_separator
|
||||
(data['excerpt_separator'] || site.config['excerpt_separator']).to_s
|
||||
(data["excerpt_separator"] || site.config["excerpt_separator"]).to_s
|
||||
end
|
||||
|
||||
# Whether to generate an excerpt
|
||||
@@ -397,8 +327,6 @@ module Jekyll
|
||||
pos = collection.docs.index { |post| post.equal?(self) }
|
||||
if pos && pos < collection.docs.length - 1
|
||||
collection.docs[pos + 1]
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -406,8 +334,6 @@ module Jekyll
|
||||
pos = collection.docs.index { |post| post.equal?(self) }
|
||||
if pos && pos > 0
|
||||
collection.docs[pos - 1]
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -417,7 +343,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def id
|
||||
@id ||= File.join(File.dirname(url), (data['slug'] || basename_without_ext).to_s)
|
||||
@id ||= File.join(File.dirname(url), (data["slug"] || basename_without_ext).to_s)
|
||||
end
|
||||
|
||||
# Calculate related posts.
|
||||
@@ -436,15 +362,125 @@ module Jekyll
|
||||
# Override of method_missing to check in @data for the key.
|
||||
def method_missing(method, *args, &blck)
|
||||
if data.key?(method.to_s)
|
||||
Jekyll.logger.warn "Deprecation:", "Document##{method} is now a key in the #data hash."
|
||||
Jekyll.logger.warn "", "Called by #{caller.first}."
|
||||
Jekyll::Deprecator.deprecation_message "Document##{method} is now a key "\
|
||||
"in the #data hash."
|
||||
Jekyll::Deprecator.deprecation_message "Called by #{caller.first}."
|
||||
data[method.to_s]
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
private # :nodoc:
|
||||
def respond_to_missing?(method, *)
|
||||
data.key?(method.to_s) || super
|
||||
end
|
||||
|
||||
private
|
||||
def merge_categories!(other)
|
||||
if other.key?("categories") && !other["categories"].nil?
|
||||
if other["categories"].is_a?(String)
|
||||
other["categories"] = other["categories"].split(%r!\s+!).map(&:strip)
|
||||
end
|
||||
other["categories"] = (data["categories"] || []) | other["categories"]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def merge_date!(source)
|
||||
if data.key?("date") && !data["date"].is_a?(Time)
|
||||
data["date"] = Utils.parse_date(
|
||||
data["date"].to_s,
|
||||
"Document '#{relative_path}' does not have a valid date in the #{source}."
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def merge_defaults
|
||||
defaults = @site.frontmatter_defaults.all(
|
||||
relative_path,
|
||||
collection.label.to_sym
|
||||
)
|
||||
merge_data!(defaults, :source => "front matter defaults") unless defaults.empty?
|
||||
end
|
||||
|
||||
private
|
||||
def read_content(opts)
|
||||
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
|
||||
if content =~ YAML_FRONT_MATTER_REGEXP
|
||||
self.content = $POSTMATCH
|
||||
data_file = SafeYAML.load(Regexp.last_match(1))
|
||||
merge_data!(data_file, :source => "YAML front matter") if data_file
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def read_post_data
|
||||
populate_title
|
||||
populate_categories
|
||||
populate_tags
|
||||
generate_excerpt
|
||||
end
|
||||
|
||||
private
|
||||
def populate_title
|
||||
if relative_path =~ DATE_FILENAME_MATCHER
|
||||
date, slug, ext = Regexp.last_match.captures
|
||||
modify_date(date)
|
||||
elsif relative_path =~ DATELESS_FILENAME_MATCHER
|
||||
slug, ext = Regexp.last_match.captures
|
||||
end
|
||||
|
||||
# Try to ensure the user gets a title.
|
||||
data["title"] ||= Utils.titleize_slug(slug)
|
||||
# Only overwrite slug & ext if they aren't specified.
|
||||
data["slug"] ||= slug
|
||||
data["ext"] ||= ext
|
||||
end
|
||||
|
||||
private
|
||||
def modify_date(date)
|
||||
if !data["date"] || data["date"].to_i == site.time.to_i
|
||||
merge_data!({ "date" => date }, :source => "filename")
|
||||
end
|
||||
end
|
||||
|
||||
# Add superdirectories of the special_dir to categories.
|
||||
# In the case of es/_posts, 'es' is added as a category.
|
||||
# In the case of _posts/es, 'es' is NOT added as a category.
|
||||
#
|
||||
# Returns nothing.
|
||||
private
|
||||
def categories_from_path(special_dir)
|
||||
superdirs = relative_path.sub(%r!#{special_dir}(.*)!, "")
|
||||
.split(File::SEPARATOR)
|
||||
.reject do |c|
|
||||
c.empty? || c == special_dir || c == basename
|
||||
end
|
||||
merge_data!({ "categories" => superdirs }, :source => "file path")
|
||||
end
|
||||
|
||||
private
|
||||
def populate_categories
|
||||
merge_data!({
|
||||
"categories" => (
|
||||
Array(data["categories"]) + Utils.pluralized_array_from_hash(
|
||||
data,
|
||||
"category",
|
||||
"categories"
|
||||
)
|
||||
).map(&:to_s).flatten.uniq
|
||||
})
|
||||
end
|
||||
|
||||
private
|
||||
def populate_tags
|
||||
merge_data!({
|
||||
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
|
||||
})
|
||||
end
|
||||
|
||||
private
|
||||
def generate_excerpt
|
||||
if generate_excerpt?
|
||||
data["excerpt"] ||= Jekyll::Excerpt.new(self)
|
||||
|
||||
@@ -5,10 +5,12 @@ module Jekyll
|
||||
class DocumentDrop < Drop
|
||||
extend Forwardable
|
||||
|
||||
NESTED_OBJECT_FIELD_BLACKLIST = %w(
|
||||
content output excerpt next previous
|
||||
).freeze
|
||||
|
||||
mutable false
|
||||
|
||||
def_delegator :@obj, :next_doc, :next
|
||||
def_delegator :@obj, :previous_doc, :previous
|
||||
def_delegator :@obj, :relative_path, :path
|
||||
def_delegators :@obj, :id, :output, :content, :to_s, :relative_path, :url
|
||||
|
||||
@@ -17,7 +19,47 @@ module Jekyll
|
||||
end
|
||||
|
||||
def excerpt
|
||||
fallback_data['excerpt'].to_s
|
||||
fallback_data["excerpt"].to_s
|
||||
end
|
||||
|
||||
def <=>(other)
|
||||
return nil unless other.is_a? DocumentDrop
|
||||
cmp = self["date"] <=> other["date"]
|
||||
cmp = self["path"] <=> other["path"] if cmp.nil? || cmp.zero?
|
||||
cmp
|
||||
end
|
||||
|
||||
def previous
|
||||
@obj.previous_doc.to_liquid
|
||||
end
|
||||
|
||||
def next
|
||||
@obj.next_doc.to_liquid
|
||||
end
|
||||
|
||||
# Generate a Hash for use in generating JSON.
|
||||
# This is useful if fields need to be cleared before the JSON can generate.
|
||||
#
|
||||
# state - the JSON::State object which determines the state of current processing.
|
||||
#
|
||||
# Returns a Hash ready for JSON generation.
|
||||
def hash_for_json(state = nil)
|
||||
to_h.tap do |hash|
|
||||
if state && state.depth >= 2
|
||||
hash["previous"] = collapse_document(hash["previous"]) if hash["previous"]
|
||||
hash["next"] = collapse_document(hash["next"]) if hash["next"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Generate a Hash which breaks the recursive chain.
|
||||
# Certain fields which are normally available are omitted.
|
||||
#
|
||||
# Returns a Hash with only non-recursive fields present.
|
||||
def collapse_document(doc)
|
||||
doc.keys.each_with_object({}) do |(key, _), result|
|
||||
result[key] = doc[key] unless NESTED_OBJECT_FIELD_BLACKLIST.include?(key)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
module Jekyll
|
||||
module Drops
|
||||
class Drop < Liquid::Drop
|
||||
NON_CONTENT_METHODS = [:[], :[]=, :inspect, :to_h, :fallback_data].freeze
|
||||
include Enumerable
|
||||
|
||||
NON_CONTENT_METHODS = [:fallback_data, :collapse_document].freeze
|
||||
|
||||
# Get or set whether the drop class is mutable.
|
||||
# Mutability determines whether or not pre-defined fields may be
|
||||
@@ -13,11 +15,11 @@ module Jekyll
|
||||
#
|
||||
# Returns the mutability of the class
|
||||
def self.mutable(is_mutable = nil)
|
||||
if is_mutable
|
||||
@is_mutable = is_mutable
|
||||
else
|
||||
@is_mutable = false
|
||||
end
|
||||
@is_mutable = if is_mutable
|
||||
is_mutable
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def self.mutable?
|
||||
@@ -86,7 +88,9 @@ module Jekyll
|
||||
# Returns an Array of strings which represent method-specific keys.
|
||||
def content_methods
|
||||
@content_methods ||= (
|
||||
self.class.instance_methods(false) - NON_CONTENT_METHODS
|
||||
self.class.instance_methods \
|
||||
- Jekyll::Drops::Drop.instance_methods \
|
||||
- NON_CONTENT_METHODS
|
||||
).map(&:to_s).reject do |method|
|
||||
method.end_with?("=")
|
||||
end
|
||||
@@ -98,8 +102,8 @@ module Jekyll
|
||||
#
|
||||
# Returns true if the given key is present
|
||||
def key?(key)
|
||||
if self.class.mutable && @mutations.key?(key)
|
||||
true
|
||||
if self.class.mutable
|
||||
@mutations.key?(key)
|
||||
else
|
||||
respond_to?(key) || fallback_data.key?(key)
|
||||
end
|
||||
@@ -134,10 +138,28 @@ module Jekyll
|
||||
#
|
||||
# Returns a pretty generation of the hash representation of the Drop.
|
||||
def inspect
|
||||
require 'json'
|
||||
require "json"
|
||||
JSON.pretty_generate to_h
|
||||
end
|
||||
|
||||
# Generate a Hash for use in generating JSON.
|
||||
# This is useful if fields need to be cleared before the JSON can generate.
|
||||
#
|
||||
# Returns a Hash ready for JSON generation.
|
||||
def hash_for_json(*)
|
||||
to_h
|
||||
end
|
||||
|
||||
# Generate a JSON representation of the Drop.
|
||||
#
|
||||
# state - the JSON::State object which determines the state of current processing.
|
||||
#
|
||||
# Returns a JSON representation of the Drop in a String.
|
||||
def to_json(state = nil)
|
||||
require "json"
|
||||
JSON.generate(hash_for_json(state), state)
|
||||
end
|
||||
|
||||
# Collects all the keys and passes each to the block in turn.
|
||||
#
|
||||
# block - a block which accepts one argument, the key
|
||||
@@ -147,6 +169,12 @@ module Jekyll
|
||||
keys.each(&block)
|
||||
end
|
||||
|
||||
def each
|
||||
each_key.each do |key|
|
||||
yield key, self[key]
|
||||
end
|
||||
end
|
||||
|
||||
def merge(other, &block)
|
||||
self.dup.tap do |me|
|
||||
if block.nil?
|
||||
@@ -171,6 +199,17 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Imitate Hash.fetch method in Drop
|
||||
#
|
||||
# Returns value if key is present in Drop, otherwise returns default value
|
||||
# KeyError is raised if key is not present and no default value given
|
||||
def fetch(key, default = nil, &block)
|
||||
return self[key] if key?(key)
|
||||
raise KeyError, %(key not found: "#{key}") if default.nil? && block.nil?
|
||||
return yield(key) unless block.nil?
|
||||
return default unless default.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
15
lib/jekyll/drops/excerpt_drop.rb
Normal file
15
lib/jekyll/drops/excerpt_drop.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
module Jekyll
|
||||
module Drops
|
||||
class ExcerptDrop < DocumentDrop
|
||||
def layout
|
||||
@obj.doc.data["layout"]
|
||||
end
|
||||
|
||||
def excerpt
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -16,6 +16,18 @@ module Jekyll
|
||||
def environment
|
||||
Jekyll.env
|
||||
end
|
||||
|
||||
def to_h
|
||||
@to_h ||= {
|
||||
"version" => version,
|
||||
"environment" => environment
|
||||
}
|
||||
end
|
||||
|
||||
def to_json(state = nil)
|
||||
require "json"
|
||||
JSON.generate(to_h, state)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,11 +24,13 @@ module Jekyll
|
||||
end
|
||||
|
||||
def html_pages
|
||||
@site_html_pages ||= @obj.pages.select { |page| page.html? || page.url.end_with?("/") }
|
||||
@site_html_pages ||= @obj.pages.select do |page|
|
||||
page.html? || page.url.end_with?("/")
|
||||
end
|
||||
end
|
||||
|
||||
def collections
|
||||
@site_collections ||= @obj.collections.values.map(&:to_liquid)
|
||||
@site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -19,20 +19,20 @@ module Jekyll
|
||||
end
|
||||
|
||||
def title
|
||||
Utils.slugify(@obj.data['slug'], :mode => "pretty", :cased => true) ||
|
||||
Utils.slugify(@obj.data["slug"], :mode => "pretty", :cased => true) ||
|
||||
Utils.slugify(@obj.basename_without_ext, :mode => "pretty", :cased => true)
|
||||
end
|
||||
|
||||
def slug
|
||||
Utils.slugify(@obj.data['slug']) || Utils.slugify(@obj.basename_without_ext)
|
||||
Utils.slugify(@obj.data["slug"]) || Utils.slugify(@obj.basename_without_ext)
|
||||
end
|
||||
|
||||
def categories
|
||||
category_set = Set.new
|
||||
Array(@obj.data['categories']).each do |category|
|
||||
Array(@obj.data["categories"]).each do |category|
|
||||
category_set << category.to_s.downcase
|
||||
end
|
||||
category_set.to_a.join('/')
|
||||
category_set.to_a.join("/")
|
||||
end
|
||||
|
||||
def year
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
module Jekyll
|
||||
class EntryFilter
|
||||
SPECIAL_LEADING_CHARACTERS = ['.', '_', '#'].freeze
|
||||
|
||||
attr_reader :site
|
||||
SPECIAL_LEADING_CHARACTERS = [
|
||||
".", "_", "#", "~"
|
||||
].freeze
|
||||
|
||||
def initialize(site, base_directory = nil)
|
||||
@site = site
|
||||
@base_directory = derive_base_directory(@site, base_directory.to_s.dup)
|
||||
@base_directory = derive_base_directory(
|
||||
@site, base_directory.to_s.dup
|
||||
)
|
||||
end
|
||||
|
||||
def base_directory
|
||||
@@ -14,14 +17,14 @@ module Jekyll
|
||||
end
|
||||
|
||||
def derive_base_directory(site, base_dir)
|
||||
if base_dir.start_with?(site.source)
|
||||
base_dir[site.source] = ""
|
||||
end
|
||||
base_dir[site.source] = "" if base_dir.start_with?(site.source)
|
||||
base_dir
|
||||
end
|
||||
|
||||
def relative_to_source(entry)
|
||||
File.join(base_directory, entry)
|
||||
File.join(
|
||||
base_directory, entry
|
||||
)
|
||||
end
|
||||
|
||||
def filter(entries)
|
||||
@@ -33,7 +36,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
def included?(entry)
|
||||
glob_include?(site.include, entry)
|
||||
glob_include?(site.include,
|
||||
entry)
|
||||
end
|
||||
|
||||
def special?(entry)
|
||||
@@ -42,30 +46,75 @@ module Jekyll
|
||||
end
|
||||
|
||||
def backup?(entry)
|
||||
entry[-1..-1] == '~'
|
||||
entry[-1..-1] == "~"
|
||||
end
|
||||
|
||||
def excluded?(entry)
|
||||
excluded = glob_include?(site.exclude, relative_to_source(entry))
|
||||
Jekyll.logger.debug "EntryFilter:", "excluded #{relative_to_source(entry)}" if excluded
|
||||
if excluded
|
||||
Jekyll.logger.debug(
|
||||
"EntryFilter:",
|
||||
"excluded #{relative_to_source(entry)}"
|
||||
)
|
||||
end
|
||||
excluded
|
||||
end
|
||||
|
||||
# --
|
||||
# Check if a file is a symlink.
|
||||
# NOTE: This can be converted to allowing even in safe,
|
||||
# since we use Pathutil#in_path? now.
|
||||
# --
|
||||
def symlink?(entry)
|
||||
File.symlink?(entry) && site.safe
|
||||
site.safe && File.symlink?(entry) && symlink_outside_site_source?(entry)
|
||||
end
|
||||
|
||||
def ensure_leading_slash(path)
|
||||
path[0..0] == "/" ? path : "/#{path}"
|
||||
# --
|
||||
# NOTE: Pathutil#in_path? gets the realpath.
|
||||
# @param [<Anything>] entry the entry you want to validate.
|
||||
# Check if a path is outside of our given root.
|
||||
# --
|
||||
def symlink_outside_site_source?(entry)
|
||||
!Pathutil.new(entry).in_path?(
|
||||
site.in_source_dir
|
||||
)
|
||||
end
|
||||
|
||||
# --
|
||||
# Check if an entry matches a specific pattern and return true,false.
|
||||
# Returns true if path matches against any glob pattern.
|
||||
# Look for more detail about glob pattern in method File::fnmatch.
|
||||
# --
|
||||
def glob_include?(enum, e)
|
||||
entry = ensure_leading_slash(e)
|
||||
entry = Pathutil.new(site.in_source_dir).join(e)
|
||||
enum.any? do |exp|
|
||||
item = ensure_leading_slash(exp)
|
||||
File.fnmatch?(item, entry) || entry.start_with?(item)
|
||||
# Users who send a Regexp knows what they want to
|
||||
# exclude, so let them send a Regexp to exclude files,
|
||||
# we will not bother caring if it works or not, it's
|
||||
# on them at this point.
|
||||
|
||||
if exp.is_a?(Regexp)
|
||||
entry =~ exp
|
||||
|
||||
else
|
||||
item = Pathutil.new(site.in_source_dir).join(exp)
|
||||
|
||||
# If it's a directory they want to exclude, AKA
|
||||
# ends with a "/" then we will go on to check and
|
||||
# see if the entry falls within that path and
|
||||
# exclude it if that's the case.
|
||||
|
||||
if e.end_with?("/")
|
||||
entry.in_path?(
|
||||
item
|
||||
)
|
||||
|
||||
else
|
||||
File.fnmatch?(item, entry) ||
|
||||
entry.to_path.start_with?(
|
||||
item
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,9 +2,16 @@ module Jekyll
|
||||
module Errors
|
||||
FatalException = Class.new(::RuntimeError)
|
||||
|
||||
InvalidThemeName = Class.new(FatalException)
|
||||
|
||||
DropMutationException = Class.new(FatalException)
|
||||
InvalidPermalinkError = Class.new(FatalException)
|
||||
InvalidYAMLFrontMatterError = Class.new(FatalException)
|
||||
MissingDependencyException = Class.new(FatalException)
|
||||
|
||||
InvalidDateError = Class.new(FatalException)
|
||||
InvalidPostNameError = Class.new(FatalException)
|
||||
PostURLError = Class.new(FatalException)
|
||||
InvalidURLError = Class.new(FatalException)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,8 @@ module Jekyll
|
||||
attr_writer :output
|
||||
|
||||
def_delegators :@doc, :site, :name, :ext, :relative_path, :extname,
|
||||
:render_with_liquid?, :collection, :related_posts
|
||||
:render_with_liquid?, :collection, :related_posts,
|
||||
:url, :next_doc, :previous_doc
|
||||
|
||||
# Initialize this Excerpt instance.
|
||||
#
|
||||
@@ -59,10 +60,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def to_liquid
|
||||
doc.data['excerpt'] = nil
|
||||
@to_liquid ||= doc.to_liquid
|
||||
doc.data['excerpt'] = self
|
||||
@to_liquid
|
||||
Jekyll::Drops::ExcerptDrop.new(self)
|
||||
end
|
||||
|
||||
# Returns the shorthand String identifier of this doc.
|
||||
@@ -120,7 +118,7 @@ module Jekyll
|
||||
if tail.empty?
|
||||
head
|
||||
else
|
||||
"" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n")
|
||||
"" << head << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,13 +17,13 @@ module Jekyll
|
||||
#
|
||||
# names - a string gem name or array of gem names
|
||||
#
|
||||
def require_if_present(names, &block)
|
||||
def require_if_present(names)
|
||||
Array(names).each do |name|
|
||||
begin
|
||||
require name
|
||||
rescue LoadError
|
||||
Jekyll.logger.debug "Couldn't load #{name}. Skipping."
|
||||
block.call(name) if block
|
||||
yield(name) if block_given?
|
||||
false
|
||||
end
|
||||
end
|
||||
@@ -39,7 +39,7 @@ module Jekyll
|
||||
def require_with_graceful_fail(names)
|
||||
Array(names).each do |name|
|
||||
begin
|
||||
Jekyll.logger.debug "Requiring:", "#{name}"
|
||||
Jekyll.logger.debug "Requiring:", name.to_s
|
||||
require name
|
||||
rescue LoadError => e
|
||||
Jekyll.logger.error "Dependency Error:", <<-MSG
|
||||
@@ -50,7 +50,7 @@ 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)
|
||||
raise Jekyll::Errors::MissingDependencyException, name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,29 +1,37 @@
|
||||
require 'uri'
|
||||
require 'json'
|
||||
require 'date'
|
||||
require "uri"
|
||||
require "json"
|
||||
require "date"
|
||||
require "liquid"
|
||||
|
||||
require_all "jekyll/filters"
|
||||
|
||||
module Jekyll
|
||||
module Filters
|
||||
include URLFilters
|
||||
# Convert a Markdown string into HTML output.
|
||||
#
|
||||
# input - The Markdown String to convert.
|
||||
#
|
||||
# Returns the HTML formatted String.
|
||||
def markdownify(input)
|
||||
def markdownify(input, mode = nil)
|
||||
site = @context.registers[:site]
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
|
||||
converter.convert(input)
|
||||
if mode.to_s == "inline"
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown::Inline)
|
||||
else
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
|
||||
end
|
||||
converter.convert(input.to_s)
|
||||
end
|
||||
|
||||
# Convert a Markdown string into HTML output.
|
||||
# Convert quotes into smart quotes.
|
||||
#
|
||||
# input - The Markdown String to convert.
|
||||
# input - The String to convert.
|
||||
#
|
||||
# Returns the HTML formatted String.
|
||||
# Returns the smart-quotified String.
|
||||
def smartify(input)
|
||||
site = @context.registers[:site]
|
||||
converter = site.find_converter_instance(Jekyll::Converters::SmartyPants)
|
||||
converter.convert(input)
|
||||
converter.convert(input.to_s)
|
||||
end
|
||||
|
||||
# Convert a Sass string into CSS output.
|
||||
@@ -55,7 +63,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the given filename or title as a lowercase URL String.
|
||||
# See Utils.slugify for more detail.
|
||||
def slugify(input, mode=nil)
|
||||
def slugify(input, mode = nil)
|
||||
Utils.slugify(input, :mode => mode)
|
||||
end
|
||||
|
||||
@@ -117,7 +125,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the escaped String.
|
||||
def xml_escape(input)
|
||||
CGI.escapeHTML(input.to_s)
|
||||
input.to_s.encode(:xml => :attr).gsub(%r!\A"|"\Z!, "")
|
||||
end
|
||||
|
||||
# CGI escape a string for use in a URL. Replaces any special characters
|
||||
@@ -132,7 +140,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the escaped String.
|
||||
def cgi_escape(input)
|
||||
CGI::escape(input)
|
||||
CGI.escape(input)
|
||||
end
|
||||
|
||||
# URI escape a string.
|
||||
@@ -149,6 +157,15 @@ module Jekyll
|
||||
URI.escape(input)
|
||||
end
|
||||
|
||||
# Replace any whitespace in the input string with a single space
|
||||
#
|
||||
# input - The String on which to operate.
|
||||
#
|
||||
# Returns the formatted String
|
||||
def normalize_whitespace(input)
|
||||
input.to_s.gsub(%r!\s+!, " ").strip
|
||||
end
|
||||
|
||||
# Count the number of words in the input string.
|
||||
#
|
||||
# input - The String on which to operate.
|
||||
@@ -179,7 +196,7 @@ module Jekyll
|
||||
when 2
|
||||
"#{array[0]} #{connector} #{array[1]}"
|
||||
else
|
||||
"#{array[0...-1].join(', ')}, #{connector} #{array[-1]}"
|
||||
"#{array[0...-1].join(", ")}, #{connector} #{array[-1]}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -202,11 +219,14 @@ module Jekyll
|
||||
# "items" => [...] } # all the items where `property` == "larry"
|
||||
def group_by(input, property)
|
||||
if groupable?(input)
|
||||
input.group_by do |item|
|
||||
item_property(item, property).to_s
|
||||
end.inject([]) do |memo, i|
|
||||
memo << { "name" => i.first, "items" => i.last }
|
||||
end
|
||||
input.group_by { |item| item_property(item, property).to_s }
|
||||
.each_with_object([]) do |item, array|
|
||||
array << {
|
||||
"name" => item.first,
|
||||
"items" => item.last,
|
||||
"size" => item.last.size
|
||||
}
|
||||
end
|
||||
else
|
||||
input
|
||||
end
|
||||
@@ -220,9 +240,42 @@ module Jekyll
|
||||
#
|
||||
# Returns the filtered array of objects
|
||||
def where(input, property, value)
|
||||
return input unless input.is_a?(Enumerable)
|
||||
return input unless input.respond_to?(:select)
|
||||
input = input.values if input.is_a?(Hash)
|
||||
input.select { |object| item_property(object, property).to_s == value.to_s }
|
||||
input.select do |object|
|
||||
Array(item_property(object, property)).map(&:to_s).include?(value.to_s)
|
||||
end || []
|
||||
end
|
||||
|
||||
# Filters an array of objects against an expression
|
||||
#
|
||||
# input - the object array
|
||||
# variable - the variable to assign each item to in the expression
|
||||
# expression - a Liquid comparison expression passed in as a string
|
||||
#
|
||||
# Returns the filtered array of objects
|
||||
def where_exp(input, variable, expression)
|
||||
return input unless input.respond_to?(:select)
|
||||
input = input.values if input.is_a?(Hash) # FIXME
|
||||
|
||||
condition = parse_condition(expression)
|
||||
@context.stack do
|
||||
input.select do |object|
|
||||
@context[variable] = object
|
||||
condition.evaluate(@context)
|
||||
end
|
||||
end || []
|
||||
end
|
||||
|
||||
# Convert the input into integer
|
||||
#
|
||||
# input - the object string
|
||||
#
|
||||
# Returns the integer value
|
||||
def to_integer(input)
|
||||
return 1 if input == true
|
||||
return 0 if input == false
|
||||
input.to_i
|
||||
end
|
||||
|
||||
# Sort an array of objects
|
||||
@@ -234,33 +287,21 @@ module Jekyll
|
||||
# Returns the filtered array of objects
|
||||
def sort(input, property = nil, nils = "first")
|
||||
if input.nil?
|
||||
raise ArgumentError.new("Cannot sort a null object.")
|
||||
raise ArgumentError, "Cannot sort a null object."
|
||||
end
|
||||
if property.nil?
|
||||
input.sort
|
||||
else
|
||||
case
|
||||
when nils == "first"
|
||||
if nils == "first"
|
||||
order = - 1
|
||||
when nils == "last"
|
||||
elsif nils == "last"
|
||||
order = + 1
|
||||
else
|
||||
raise ArgumentError.new("Invalid nils order: " \
|
||||
"'#{nils}' is not a valid nils order. It must be 'first' or 'last'.")
|
||||
raise ArgumentError, "Invalid nils order: " \
|
||||
"'#{nils}' is not a valid nils order. It must be 'first' or 'last'."
|
||||
end
|
||||
|
||||
input.sort do |apple, orange|
|
||||
apple_property = item_property(apple, property)
|
||||
orange_property = item_property(orange, property)
|
||||
|
||||
if !apple_property.nil? && orange_property.nil?
|
||||
- order
|
||||
elsif apple_property.nil? && !orange_property.nil?
|
||||
+ order
|
||||
else
|
||||
apple_property <=> orange_property
|
||||
end
|
||||
end
|
||||
sort_input(input, property, order)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -308,14 +349,30 @@ module Jekyll
|
||||
#
|
||||
# Returns a String representation of the object.
|
||||
def inspect(input)
|
||||
CGI.escapeHTML(input.inspect)
|
||||
xml_escape(input.inspect)
|
||||
end
|
||||
|
||||
private
|
||||
def sort_input(input, property, order)
|
||||
input.sort do |apple, orange|
|
||||
apple_property = item_property(apple, property)
|
||||
orange_property = item_property(orange, property)
|
||||
|
||||
if !apple_property.nil? && orange_property.nil?
|
||||
- order
|
||||
elsif apple_property.nil? && !orange_property.nil?
|
||||
+ order
|
||||
else
|
||||
apple_property <=> orange_property
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def time(input)
|
||||
case input
|
||||
when Time
|
||||
input
|
||||
input.clone
|
||||
when Date
|
||||
input.to_time
|
||||
when String
|
||||
@@ -323,15 +380,17 @@ module Jekyll
|
||||
when Numeric
|
||||
Time.at(input)
|
||||
else
|
||||
Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime."
|
||||
exit(1)
|
||||
raise Errors::InvalidDateError,
|
||||
"Invalid Date: '#{input.inspect}' is not a valid datetime."
|
||||
end.localtime
|
||||
end
|
||||
|
||||
private
|
||||
def groupable?(element)
|
||||
element.respond_to?(:group_by)
|
||||
end
|
||||
|
||||
private
|
||||
def item_property(item, property)
|
||||
if item.respond_to?(:to_liquid)
|
||||
item.to_liquid[property.to_s]
|
||||
@@ -342,6 +401,7 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def as_liquid(item)
|
||||
case item
|
||||
when Hash
|
||||
@@ -363,5 +423,26 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Parse a string to a Liquid Condition
|
||||
private
|
||||
def parse_condition(exp)
|
||||
parser = Liquid::Parser.new(exp)
|
||||
left_expr = parser.expression
|
||||
operator = parser.consume?(:comparison)
|
||||
condition =
|
||||
if operator
|
||||
Liquid::Condition.new(left_expr, operator, parser.expression)
|
||||
else
|
||||
Liquid::Condition.new(left_expr)
|
||||
end
|
||||
parser.consume(:end_of_string)
|
||||
|
||||
condition
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(
|
||||
Jekyll::Filters
|
||||
)
|
||||
|
||||
40
lib/jekyll/filters/url_filters.rb
Normal file
40
lib/jekyll/filters/url_filters.rb
Normal file
@@ -0,0 +1,40 @@
|
||||
require "addressable/uri"
|
||||
|
||||
module Jekyll
|
||||
module Filters
|
||||
module URLFilters
|
||||
# Produces an absolute URL based on site.url and site.baseurl.
|
||||
#
|
||||
# input - the URL to make absolute.
|
||||
#
|
||||
# Returns the absolute URL as a String.
|
||||
def absolute_url(input)
|
||||
return if input.nil?
|
||||
site = @context.registers[:site]
|
||||
return relative_url(input).to_s if site.config["url"].nil?
|
||||
Addressable::URI.parse(site.config["url"] + relative_url(input)).normalize.to_s
|
||||
end
|
||||
|
||||
# Produces a URL relative to the domain root based on site.baseurl.
|
||||
#
|
||||
# input - the URL to make relative to the domain root
|
||||
#
|
||||
# Returns a URL relative to the domain root as a String.
|
||||
def relative_url(input)
|
||||
return if input.nil?
|
||||
site = @context.registers[:site]
|
||||
return ensure_leading_slash(input.to_s) if site.config["baseurl"].nil?
|
||||
Addressable::URI.parse(
|
||||
ensure_leading_slash(site.config["baseurl"]) + ensure_leading_slash(input.to_s)
|
||||
).normalize.to_s
|
||||
end
|
||||
|
||||
private
|
||||
def ensure_leading_slash(input)
|
||||
return input if input.nil? || input.empty? || input.start_with?("/")
|
||||
"/#{input}"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -11,37 +11,42 @@ module Jekyll
|
||||
end
|
||||
|
||||
def update_deprecated_types(set)
|
||||
return set unless set.key?('scope') && set['scope'].key?('type')
|
||||
return set unless set.key?("scope") && set["scope"].key?("type")
|
||||
|
||||
set['scope']['type'] =
|
||||
case set['scope']['type']
|
||||
when 'page'
|
||||
Deprecator.defaults_deprecate_type('page', 'pages')
|
||||
'pages'
|
||||
when 'post'
|
||||
Deprecator.defaults_deprecate_type('post', 'posts')
|
||||
'posts'
|
||||
when 'draft'
|
||||
Deprecator.defaults_deprecate_type('draft', 'drafts')
|
||||
'drafts'
|
||||
set["scope"]["type"] =
|
||||
case set["scope"]["type"]
|
||||
when "page"
|
||||
Deprecator.defaults_deprecate_type("page", "pages")
|
||||
"pages"
|
||||
when "post"
|
||||
Deprecator.defaults_deprecate_type("post", "posts")
|
||||
"posts"
|
||||
when "draft"
|
||||
Deprecator.defaults_deprecate_type("draft", "drafts")
|
||||
"drafts"
|
||||
else
|
||||
set['scope']['type']
|
||||
set["scope"]["type"]
|
||||
end
|
||||
|
||||
set
|
||||
end
|
||||
|
||||
def ensure_time!(set)
|
||||
return set unless set.key?('values') && set['values'].key?('date')
|
||||
return set if set['values']['date'].is_a?(Time)
|
||||
set['values']['date'] = Utils.parse_date(set['values']['date'], "An invalid date format was found in a front-matter default set: #{set}")
|
||||
return set unless set.key?("values") && set["values"].key?("date")
|
||||
return set if set["values"]["date"].is_a?(Time)
|
||||
set["values"]["date"] = Utils.parse_date(
|
||||
set["values"]["date"],
|
||||
"An invalid date format was found in a front-matter default set: #{set}"
|
||||
)
|
||||
set
|
||||
end
|
||||
|
||||
# Finds a default value for a given setting, filtered by path and type
|
||||
#
|
||||
# path - the path (relative to the source) of the page, post or :draft the default is used in
|
||||
# type - a symbol indicating whether a :page, a :post or a :draft calls this method
|
||||
# path - the path (relative to the source) of the page,
|
||||
# post or :draft the default is used in
|
||||
# type - a symbol indicating whether a :page,
|
||||
# a :post or a :draft calls this method
|
||||
#
|
||||
# Returns the default value or nil if none was found
|
||||
def find(path, type, setting)
|
||||
@@ -49,9 +54,9 @@ module Jekyll
|
||||
old_scope = nil
|
||||
|
||||
matching_sets(path, type).each do |set|
|
||||
if set['values'].key?(setting) && has_precedence?(old_scope, set['scope'])
|
||||
value = set['values'][setting]
|
||||
old_scope = set['scope']
|
||||
if set["values"].key?(setting) && has_precedence?(old_scope, set["scope"])
|
||||
value = set["values"][setting]
|
||||
old_scope = set["scope"]
|
||||
end
|
||||
end
|
||||
value
|
||||
@@ -67,11 +72,11 @@ module Jekyll
|
||||
defaults = {}
|
||||
old_scope = nil
|
||||
matching_sets(path, type).each do |set|
|
||||
if has_precedence?(old_scope, set['scope'])
|
||||
defaults = Utils.deep_merge_hashes(defaults, set['values'])
|
||||
old_scope = set['scope']
|
||||
if has_precedence?(old_scope, set["scope"])
|
||||
defaults = Utils.deep_merge_hashes(defaults, set["values"])
|
||||
old_scope = set["scope"]
|
||||
else
|
||||
defaults = Utils.deep_merge_hashes(set['values'], defaults)
|
||||
defaults = Utils.deep_merge_hashes(set["values"], defaults)
|
||||
end
|
||||
end
|
||||
defaults
|
||||
@@ -91,11 +96,11 @@ module Jekyll
|
||||
end
|
||||
|
||||
def applies_path?(scope, path)
|
||||
return true if !scope.key?('path') || scope['path'].empty?
|
||||
return true if !scope.key?("path") || scope["path"].empty?
|
||||
|
||||
scope_path = Pathname.new(scope['path'])
|
||||
Pathname.new(sanitize_path(path)).ascend do |path|
|
||||
if path.to_s == scope_path.to_s
|
||||
scope_path = Pathname.new(scope["path"])
|
||||
Pathname.new(sanitize_path(path)).ascend do |ascended_path|
|
||||
if ascended_path.to_s == scope_path.to_s
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -113,7 +118,7 @@ module Jekyll
|
||||
# Returns true if either of the above conditions are satisfied,
|
||||
# otherwise returns false
|
||||
def applies_type?(scope, type)
|
||||
!scope.key?('type') || scope['type'].eql?(type.to_s)
|
||||
!scope.key?("type") || scope["type"].eql?(type.to_s)
|
||||
end
|
||||
|
||||
# Checks if a given set of default values is valid
|
||||
@@ -122,7 +127,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if the set is valid and can be used in this class
|
||||
def valid?(set)
|
||||
set.is_a?(Hash) && set['values'].is_a?(Hash)
|
||||
set.is_a?(Hash) && set["values"].is_a?(Hash)
|
||||
end
|
||||
|
||||
# Determines if a new scope has precedence over an old one
|
||||
@@ -131,27 +136,29 @@ module Jekyll
|
||||
# new_scope - the new scope hash
|
||||
#
|
||||
# Returns true if the new scope has precedence over the older
|
||||
# rubocop: disable PredicateName
|
||||
def has_precedence?(old_scope, new_scope)
|
||||
return true if old_scope.nil?
|
||||
|
||||
new_path = sanitize_path(new_scope['path'])
|
||||
old_path = sanitize_path(old_scope['path'])
|
||||
new_path = sanitize_path(new_scope["path"])
|
||||
old_path = sanitize_path(old_scope["path"])
|
||||
|
||||
if new_path.length != old_path.length
|
||||
new_path.length >= old_path.length
|
||||
elsif new_scope.key? 'type'
|
||||
elsif new_scope.key?("type")
|
||||
true
|
||||
else
|
||||
!old_scope.key? 'type'
|
||||
!old_scope.key? "type"
|
||||
end
|
||||
end
|
||||
# rubocop: enable PredicateName
|
||||
|
||||
# Collects a list of sets that match the given path and type
|
||||
#
|
||||
# Returns an array of hashes
|
||||
def matching_sets(path, type)
|
||||
valid_sets.select do |set|
|
||||
!set.key?('scope') || applies?(set['scope'], path, type)
|
||||
!set.key?("scope") || applies?(set["scope"], path, type)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -162,7 +169,7 @@ module Jekyll
|
||||
#
|
||||
# Returns an array of hashes
|
||||
def valid_sets
|
||||
sets = @site.config['defaults']
|
||||
sets = @site.config["defaults"]
|
||||
return [] unless sets.is_a?(Array)
|
||||
|
||||
sets.map do |set|
|
||||
@@ -170,7 +177,7 @@ module Jekyll
|
||||
ensure_time!(update_deprecated_types(set))
|
||||
else
|
||||
Jekyll.logger.warn "Defaults:", "An invalid front-matter default set was found:"
|
||||
Jekyll.logger.warn "#{set}"
|
||||
Jekyll.logger.warn set.to_s
|
||||
nil
|
||||
end
|
||||
end.compact
|
||||
@@ -181,7 +188,7 @@ module Jekyll
|
||||
if path.nil? || path.empty?
|
||||
""
|
||||
else
|
||||
path.gsub(/\A\//, '').gsub(/([^\/])\z/, '\1')
|
||||
path.gsub(%r!\A/|(?<=[^/])\z!, "".freeze)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,37 +4,38 @@ module Jekyll
|
||||
|
||||
# compatibility layer for octopress-hooks users
|
||||
PRIORITY_MAP = {
|
||||
:low => 10,
|
||||
:low => 10,
|
||||
:normal => 20,
|
||||
:high => 30
|
||||
:high => 30
|
||||
}.freeze
|
||||
|
||||
# initial empty hooks
|
||||
@registry = {
|
||||
:site => {
|
||||
:site => {
|
||||
:after_init => [],
|
||||
:after_reset => [],
|
||||
:post_read => [],
|
||||
:pre_render => [],
|
||||
:post_read => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
:post_write => []
|
||||
:post_write => []
|
||||
},
|
||||
:pages => {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:pages => {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
:post_write => []
|
||||
:post_write => []
|
||||
},
|
||||
:posts => {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:posts => {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
:post_write => []
|
||||
:post_write => []
|
||||
},
|
||||
:documents => {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
:post_write => []
|
||||
:post_write => []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,17 +54,17 @@ module Jekyll
|
||||
|
||||
# Ensure the priority is a Fixnum
|
||||
def self.priority_value(priority)
|
||||
return priority if priority.is_a?(Fixnum)
|
||||
return priority if priority.is_a?(Integer)
|
||||
PRIORITY_MAP[priority] || DEFAULT_PRIORITY
|
||||
end
|
||||
|
||||
# register a single hook to be called later, internal API
|
||||
def self.register_one(owner, event, priority, &block)
|
||||
@registry[owner] ||={
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
:post_write => []
|
||||
:post_write => []
|
||||
}
|
||||
|
||||
unless @registry[owner][event]
|
||||
@@ -79,7 +80,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def self.insert_hook(owner, event, priority, &block)
|
||||
@hook_priority[block] = "#{priority}.#{@hook_priority.size}".to_f
|
||||
@hook_priority[block] = [-priority, @hook_priority.size]
|
||||
@registry[owner][event] << block
|
||||
end
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ module Jekyll
|
||||
# Gets the path to this layout.
|
||||
attr_reader :path
|
||||
|
||||
# Gets the path to this layout relative to its base
|
||||
attr_reader :relative_path
|
||||
|
||||
# Gets/Sets the extension of this layout.
|
||||
attr_accessor :ext
|
||||
|
||||
@@ -29,7 +32,15 @@ module Jekyll
|
||||
@site = site
|
||||
@base = base
|
||||
@name = name
|
||||
@path = site.in_source_dir(base, name)
|
||||
|
||||
if site.theme && site.theme.layouts_path.eql?(base)
|
||||
@base_dir = site.theme.root
|
||||
@path = site.in_theme_dir(base, name)
|
||||
else
|
||||
@base_dir = site.source
|
||||
@path = site.in_source_dir(base, name)
|
||||
end
|
||||
@relative_path = @path.sub(@base_dir, "")
|
||||
|
||||
self.data = {}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
require 'jekyll/liquid_renderer/file'
|
||||
require 'jekyll/liquid_renderer/table'
|
||||
require "jekyll/liquid_renderer/file"
|
||||
require "jekyll/liquid_renderer/table"
|
||||
|
||||
module Jekyll
|
||||
class LiquidRenderer
|
||||
def initialize(site)
|
||||
@site = site
|
||||
Liquid::Template.error_mode = @site.config["liquid"]["error_mode"].to_sym
|
||||
reset
|
||||
end
|
||||
|
||||
@@ -13,7 +14,10 @@ module Jekyll
|
||||
end
|
||||
|
||||
def file(filename)
|
||||
filename = @site.in_source_dir(filename).sub(/\A#{Regexp.escape(@site.source)}\//, '')
|
||||
filename = @site.in_source_dir(filename).sub(
|
||||
%r!\A#{Regexp.escape(@site.source)}/!,
|
||||
""
|
||||
)
|
||||
|
||||
LiquidRenderer::File.new(self, filename).tap do
|
||||
@stats[filename] ||= {}
|
||||
@@ -35,5 +39,12 @@ module Jekyll
|
||||
def stats_table(n = 50)
|
||||
LiquidRenderer::Table.new(@stats).to_s(n)
|
||||
end
|
||||
|
||||
def self.format_error(e, path)
|
||||
if e.is_a? Tags::IncludeTagError
|
||||
return "#{e.message} in #{e.path}, included in #{path}"
|
||||
end
|
||||
"#{e.message} in #{path}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ module Jekyll
|
||||
|
||||
def parse(content)
|
||||
measure_time do
|
||||
@template = Liquid::Template.parse(content)
|
||||
@template = Liquid::Template.parse(content, :line_numbers => true)
|
||||
end
|
||||
|
||||
self
|
||||
@@ -30,6 +30,10 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
def warnings
|
||||
@template.warnings
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def measure_bytes
|
||||
|
||||
@@ -31,8 +31,8 @@ module Jekyll
|
||||
str = ""
|
||||
|
||||
row_data.each_index do |cell_index|
|
||||
str << '-' * widths[cell_index]
|
||||
str << '-+-' unless cell_index == row_data.length-1
|
||||
str << "-" * widths[cell_index]
|
||||
str << "-+-" unless cell_index == row_data.length-1
|
||||
end
|
||||
|
||||
str << "\n"
|
||||
@@ -40,16 +40,16 @@ module Jekyll
|
||||
end
|
||||
|
||||
def generate_row(row_data, widths)
|
||||
str = ''
|
||||
str = ""
|
||||
|
||||
row_data.each_with_index do |cell_data, cell_index|
|
||||
if cell_index == 0
|
||||
str << cell_data.ljust(widths[cell_index], ' ')
|
||||
else
|
||||
str << cell_data.rjust(widths[cell_index], ' ')
|
||||
end
|
||||
str << if cell_index.zero?
|
||||
cell_data.ljust(widths[cell_index], " ")
|
||||
else
|
||||
cell_data.rjust(widths[cell_index], " ")
|
||||
end
|
||||
|
||||
str << ' | ' unless cell_index == row_data.length-1
|
||||
str << " | " unless cell_index == row_data.length-1
|
||||
end
|
||||
|
||||
str << "\n"
|
||||
@@ -79,7 +79,7 @@ module Jekyll
|
||||
row << filename
|
||||
row << file_stats[:count].to_s
|
||||
row << format_bytes(file_stats[:bytes])
|
||||
row << "%.3f" % file_stats[:time]
|
||||
row << format("%.3f", file_stats[:time])
|
||||
table << row
|
||||
end
|
||||
|
||||
@@ -88,7 +88,7 @@ module Jekyll
|
||||
|
||||
def format_bytes(bytes)
|
||||
bytes /= 1024.0
|
||||
"%.2fK" % bytes
|
||||
format("%.2fK", bytes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ module Jekyll
|
||||
:info => ::Logger::INFO,
|
||||
:warn => ::Logger::WARN,
|
||||
:error => ::Logger::ERROR
|
||||
}
|
||||
}.freeze
|
||||
|
||||
# Public: Create a new instance of a log writer
|
||||
#
|
||||
@@ -98,7 +98,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the formatted message
|
||||
def message(topic, message)
|
||||
msg = formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ')
|
||||
msg = formatted_topic(topic) + message.to_s.gsub(%r!\s+!, " ")
|
||||
messages << msg
|
||||
msg
|
||||
end
|
||||
|
||||
@@ -9,6 +9,8 @@ module Jekyll
|
||||
|
||||
alias_method :extname, :ext
|
||||
|
||||
FORWARD_SLASH = "/".freeze
|
||||
|
||||
# Attributes for Liquid templates
|
||||
ATTRIBUTES_FOR_LIQUID = %w(
|
||||
content
|
||||
@@ -16,16 +18,16 @@ module Jekyll
|
||||
name
|
||||
path
|
||||
url
|
||||
)
|
||||
).freeze
|
||||
|
||||
# A set of extensions that are considered HTML or HTML-like so we
|
||||
# should not alter them, this includes .xhtml through XHTM5.
|
||||
|
||||
HTML_EXTENSIONS = %W(
|
||||
HTML_EXTENSIONS = %w(
|
||||
.html
|
||||
.xhtml
|
||||
.htm
|
||||
)
|
||||
).freeze
|
||||
|
||||
# Initialize a new Page.
|
||||
#
|
||||
@@ -38,6 +40,11 @@ module Jekyll
|
||||
@base = base
|
||||
@dir = dir
|
||||
@name = name
|
||||
@path = if site.in_theme_dir(base) == base # we're in a theme
|
||||
site.in_theme_dir(base, dir, name)
|
||||
else
|
||||
site.in_source_dir(base, dir, name)
|
||||
end
|
||||
|
||||
process(name)
|
||||
read_yaml(File.join(base, dir), name)
|
||||
@@ -55,7 +62,12 @@ module Jekyll
|
||||
#
|
||||
# Returns the String destination directory.
|
||||
def dir
|
||||
url[-1, 1] == '/' ? url : File.dirname(url)
|
||||
if url.end_with?(FORWARD_SLASH)
|
||||
url
|
||||
else
|
||||
url_dir = File.dirname(url)
|
||||
url_dir.end_with?(FORWARD_SLASH) ? url_dir : "#{url_dir}/"
|
||||
end
|
||||
end
|
||||
|
||||
# The full path and filename of the post. Defined in the YAML of the post
|
||||
@@ -63,7 +75,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the String permalink or nil if none has been set.
|
||||
def permalink
|
||||
data.nil? ? nil : data['permalink']
|
||||
data.nil? ? nil : data["permalink"]
|
||||
end
|
||||
|
||||
# The template of the permalink.
|
||||
@@ -84,9 +96,9 @@ module Jekyll
|
||||
# Returns the String url.
|
||||
def url
|
||||
@url ||= URL.new({
|
||||
:template => template,
|
||||
:template => template,
|
||||
:placeholders => url_placeholders,
|
||||
:permalink => permalink
|
||||
:permalink => permalink
|
||||
}).to_s
|
||||
end
|
||||
|
||||
@@ -127,12 +139,12 @@ module Jekyll
|
||||
#
|
||||
# Returns the path to the source file
|
||||
def path
|
||||
data.fetch('path') { relative_path.sub(/\A\//, '') }
|
||||
data.fetch("path") { relative_path }
|
||||
end
|
||||
|
||||
# The path to the page source file, relative to the site source
|
||||
def relative_path
|
||||
File.join(*[@dir, @name].map(&:to_s).reject(&:empty?))
|
||||
File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A\/!, "")
|
||||
end
|
||||
|
||||
# Obtain destination path.
|
||||
@@ -159,7 +171,7 @@ module Jekyll
|
||||
|
||||
# Returns the Boolean of whether this Page is an index file or not.
|
||||
def index?
|
||||
basename == 'index'
|
||||
basename == "index"
|
||||
end
|
||||
|
||||
def trigger_hooks(hook_name, *args)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
module Jekyll
|
||||
class Plugin
|
||||
PRIORITIES = {
|
||||
:low => -10,
|
||||
:low => -10,
|
||||
:highest => 100,
|
||||
:lowest => -100,
|
||||
:normal => 0,
|
||||
:high => 10
|
||||
}
|
||||
:lowest => -100,
|
||||
:normal => 0,
|
||||
:high => 10
|
||||
}.freeze
|
||||
|
||||
#
|
||||
|
||||
@@ -60,7 +60,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the safety Boolean.
|
||||
def self.safe(safe = nil)
|
||||
if safe
|
||||
if !defined?(@safe) || !safe.nil?
|
||||
@safe = safe
|
||||
end
|
||||
@safe || false
|
||||
|
||||
@@ -24,22 +24,25 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def require_gems
|
||||
Jekyll::External.require_with_graceful_fail(site.gems.select { |gem| plugin_allowed?(gem) })
|
||||
Jekyll::External.require_with_graceful_fail(
|
||||
site.gems.select { |gem| plugin_allowed?(gem) }
|
||||
)
|
||||
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(', ')}")
|
||||
|
||||
Bundler.setup
|
||||
required_gems = Bundler.require(:jekyll_plugins)
|
||||
message = "Required #{required_gems.map(&:name).join(", ")}"
|
||||
Jekyll.logger.debug("PluginManager:", message)
|
||||
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.
|
||||
@@ -57,7 +60,7 @@ module Jekyll
|
||||
# Returns an array of strings, each string being the name of a gem name
|
||||
# that is allowed to be used.
|
||||
def whitelist
|
||||
@whitelist ||= Array[site.config['whitelist']].flatten
|
||||
@whitelist ||= Array[site.config["whitelist"]].flatten
|
||||
end
|
||||
|
||||
# Require all .rb files if safe mode is off
|
||||
@@ -76,16 +79,17 @@ module Jekyll
|
||||
#
|
||||
# Returns an Array of plugin search paths
|
||||
def plugins_path
|
||||
if site.config['plugins_dir'] == Jekyll::Configuration::DEFAULTS['plugins_dir']
|
||||
[site.in_source_dir(site.config['plugins_dir'])]
|
||||
if site.config["plugins_dir"].eql? Jekyll::Configuration::DEFAULTS["plugins_dir"]
|
||||
[site.in_source_dir(site.config["plugins_dir"])]
|
||||
else
|
||||
Array(site.config['plugins_dir']).map { |d| File.expand_path(d) }
|
||||
Array(site.config["plugins_dir"]).map { |d| File.expand_path(d) }
|
||||
end
|
||||
end
|
||||
|
||||
def deprecation_checks
|
||||
pagination_included = (site.config['gems'] || []).include?('jekyll-paginate') || defined?(Jekyll::Paginate)
|
||||
if site.config['paginate'] && !pagination_included
|
||||
pagination_included = (site.config["gems"] || []).include?("jekyll-paginate") ||
|
||||
defined?(Jekyll::Paginate)
|
||||
if site.config["paginate"] && !pagination_included
|
||||
Jekyll::Deprecator.deprecation_message "You appear to have pagination " \
|
||||
"turned on, but you haven't included the `jekyll-paginate` gem. " \
|
||||
"Ensure you have `gems: [jekyll-paginate]` in your configuration file."
|
||||
|
||||
@@ -8,14 +8,14 @@ module Jekyll
|
||||
can_be_published?(thing) && !hidden_in_the_future?(thing)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def can_be_published?(thing)
|
||||
thing.data.fetch('published', true) || @site.unpublished
|
||||
end
|
||||
|
||||
def hidden_in_the_future?(thing)
|
||||
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def can_be_published?(thing)
|
||||
thing.data.fetch("published", true) || @site.unpublished
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# encoding: UTF-8
|
||||
require 'csv'
|
||||
require "csv"
|
||||
|
||||
module Jekyll
|
||||
class Reader
|
||||
@@ -16,8 +16,9 @@ module Jekyll
|
||||
@site.layouts = LayoutReader.new(site).read
|
||||
read_directories
|
||||
sort_files!
|
||||
@site.data = DataReader.new(site).read(site.config['data_dir'])
|
||||
@site.data = DataReader.new(site).read(site.config["data_dir"])
|
||||
CollectionReader.new(site).read
|
||||
ThemeAssetsReader.new(site).read
|
||||
end
|
||||
|
||||
# Sorts posts, pages, and static files.
|
||||
@@ -34,13 +35,15 @@ module Jekyll
|
||||
# dir - The String relative path of the directory to read. Default: ''.
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_directories(dir = '')
|
||||
def read_directories(dir = "")
|
||||
base = site.in_source_dir(dir)
|
||||
|
||||
dot = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) }
|
||||
dot = Dir.chdir(base) { filter_entries(Dir.entries("."), base) }
|
||||
dot_dirs = dot.select { |file| File.directory?(@site.in_source_dir(base, file)) }
|
||||
dot_files = (dot - dot_dirs)
|
||||
dot_pages = dot_files.select { |file| Utils.has_yaml_header?(@site.in_source_dir(base, file)) }
|
||||
dot_pages = dot_files.select do |file|
|
||||
Utils.has_yaml_header?(@site.in_source_dir(base, file))
|
||||
end
|
||||
dot_static_files = dot_files - dot_pages
|
||||
|
||||
retrieve_posts(dir)
|
||||
@@ -71,7 +74,9 @@ module Jekyll
|
||||
dot_dirs.map do |file|
|
||||
dir_path = site.in_source_dir(dir, file)
|
||||
rel_path = File.join(dir, file)
|
||||
@site.reader.read_directories(rel_path) unless @site.dest.sub(/\/$/, '') == dir_path
|
||||
unless @site.dest.sub(%r!/$!, "") == dir_path
|
||||
@site.reader.read_directories(rel_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -119,7 +124,7 @@ module Jekyll
|
||||
def get_entries(dir, subfolder)
|
||||
base = site.in_source_dir(dir, subfolder)
|
||||
return [] unless File.exist?(base)
|
||||
entries = Dir.chdir(base) { filter_entries(Dir['**/*'], base) }
|
||||
entries = Dir.chdir(base) { filter_entries(Dir["**/*"], base) }
|
||||
entries.delete_if { |e| File.directory?(site.in_source_dir(base, e)) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,7 @@ module Jekyll
|
||||
def initialize(site)
|
||||
@site = site
|
||||
@content = {}
|
||||
@entry_filter = EntryFilter.new(site)
|
||||
end
|
||||
|
||||
# Read all the files in <source>/<dir>/_drafts and create a new Draft
|
||||
@@ -26,20 +27,20 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def read_data_to(dir, data)
|
||||
return unless File.directory?(dir) && (!site.safe || !File.symlink?(dir))
|
||||
return unless File.directory?(dir) && !@entry_filter.symlink?(dir)
|
||||
|
||||
entries = Dir.chdir(dir) do
|
||||
Dir['*.{yaml,yml,json,csv}'] + Dir['*'].select { |fn| File.directory?(fn) }
|
||||
Dir["*.{yaml,yml,json,csv}"] + Dir["*"].select { |fn| File.directory?(fn) }
|
||||
end
|
||||
|
||||
entries.each do |entry|
|
||||
path = @site.in_source_dir(dir, entry)
|
||||
next if File.symlink?(path) && site.safe
|
||||
next if @entry_filter.symlink?(path)
|
||||
|
||||
key = sanitize_filename(File.basename(entry, '.*'))
|
||||
if File.directory?(path)
|
||||
read_data_to(path, data[key] = {})
|
||||
read_data_to(path, data[sanitize_filename(entry)] = {})
|
||||
else
|
||||
key = sanitize_filename(File.basename(entry, ".*"))
|
||||
data[key] = read_data_file(path)
|
||||
end
|
||||
end
|
||||
@@ -50,20 +51,19 @@ module Jekyll
|
||||
# Returns the contents of the data file.
|
||||
def read_data_file(path)
|
||||
case File.extname(path).downcase
|
||||
when '.csv'
|
||||
when ".csv"
|
||||
CSV.read(path, {
|
||||
:headers => true,
|
||||
:encoding => site.config['encoding']
|
||||
}).map(&:to_hash)
|
||||
:headers => true,
|
||||
:encoding => site.config["encoding"]
|
||||
}).map(&:to_hash)
|
||||
else
|
||||
SafeYAML.load_file(path)
|
||||
end
|
||||
end
|
||||
|
||||
def sanitize_filename(name)
|
||||
name.gsub!(/[^\w\s-]+/, '')
|
||||
name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
|
||||
name.gsub(/\s+/, '_')
|
||||
name.gsub!(%r![^\w\s-]+|(?<=^|\b\s)\s+(?=$|\s?\b)!, "".freeze)
|
||||
name.gsub(%r!\s+!, "_")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,8 +7,14 @@ module Jekyll
|
||||
end
|
||||
|
||||
def read
|
||||
layout_entries.each do |f|
|
||||
@layouts[layout_name(f)] = Layout.new(site, layout_directory, f)
|
||||
layout_entries.each do |layout_file|
|
||||
@layouts[layout_name(layout_file)] = \
|
||||
Layout.new(site, layout_directory, layout_file)
|
||||
end
|
||||
|
||||
theme_layout_entries.each do |layout_file|
|
||||
@layouts[layout_name(layout_file)] ||= \
|
||||
Layout.new(site, theme_layout_directory, layout_file)
|
||||
end
|
||||
|
||||
@layouts
|
||||
@@ -18,12 +24,24 @@ module Jekyll
|
||||
@layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source)
|
||||
end
|
||||
|
||||
def theme_layout_directory
|
||||
@theme_layout_directory ||= site.theme.layouts_path if site.theme
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def layout_entries
|
||||
entries_in layout_directory
|
||||
end
|
||||
|
||||
def theme_layout_entries
|
||||
theme_layout_directory ? entries_in(theme_layout_directory) : []
|
||||
end
|
||||
|
||||
def entries_in(dir)
|
||||
entries = []
|
||||
within(layout_directory) do
|
||||
entries = EntryFilter.new(site).filter(Dir['**/*.*'])
|
||||
within(dir) do
|
||||
entries = EntryFilter.new(site).filter(Dir["**/*.*"])
|
||||
end
|
||||
entries
|
||||
end
|
||||
@@ -38,15 +56,13 @@ module Jekyll
|
||||
end
|
||||
|
||||
def layout_directory_inside_source
|
||||
site.in_source_dir(site.config['layouts_dir'])
|
||||
site.in_source_dir(site.config["layouts_dir"])
|
||||
end
|
||||
|
||||
def layout_directory_in_cwd
|
||||
dir = Jekyll.sanitized_path(Dir.pwd, site.config['layouts_dir'])
|
||||
dir = Jekyll.sanitized_path(Dir.pwd, site.config["layouts_dir"])
|
||||
if File.directory?(dir) && !site.safe
|
||||
dir
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,9 @@ module Jekyll
|
||||
#
|
||||
# Returns an array of static pages.
|
||||
def read(files)
|
||||
files.map { |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
|
||||
files.map do |page|
|
||||
@unfiltered_content << Page.new(@site, @site.source, @dir, page)
|
||||
end
|
||||
@unfiltered_content.select { |page| site.publisher.publish?(page) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_drafts(dir)
|
||||
read_publishable(dir, '_drafts', Document::DATELESS_FILENAME_MATCHER)
|
||||
read_publishable(dir, "_drafts", Document::DATELESS_FILENAME_MATCHER)
|
||||
end
|
||||
|
||||
# Read all the files in <source>/<dir>/_posts and create a new Document
|
||||
@@ -22,7 +22,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_posts(dir)
|
||||
read_publishable(dir, '_posts', Document::DATE_FILENAME_MATCHER)
|
||||
read_publishable(dir, "_posts", Document::DATE_FILENAME_MATCHER)
|
||||
end
|
||||
|
||||
# Read all the files in <source>/<dir>/<magic_dir> and create a new
|
||||
@@ -32,11 +32,14 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_publishable(dir, magic_dir, matcher)
|
||||
read_content(dir, magic_dir, matcher).tap do |docs|
|
||||
docs.each(&:read)
|
||||
end.select do |doc|
|
||||
site.publisher.publish?(doc)
|
||||
end
|
||||
read_content(dir, magic_dir, matcher).tap { |docs| docs.each(&:read) }
|
||||
.select do |doc|
|
||||
site.publisher.publish?(doc).tap do |will_publish|
|
||||
if !will_publish && site.publisher.hidden_in_the_future?(doc)
|
||||
Jekyll.logger.debug "Skipping:", "#{doc.relative_path} has a future date"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Read all the content files from <source>/<dir>/magic_dir
|
||||
@@ -53,7 +56,7 @@ module Jekyll
|
||||
next unless entry =~ matcher
|
||||
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
|
||||
Document.new(path, {
|
||||
:site => @site,
|
||||
:site => @site,
|
||||
:collection => @site.posts
|
||||
})
|
||||
end.reject(&:nil?)
|
||||
|
||||
@@ -14,7 +14,9 @@ module Jekyll
|
||||
#
|
||||
# Returns an array of static files.
|
||||
def read(files)
|
||||
files.map { |file| @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file) }
|
||||
files.map do |file|
|
||||
@unfiltered_content << StaticFile.new(@site, @site.source, @dir, file)
|
||||
end
|
||||
@unfiltered_content
|
||||
end
|
||||
end
|
||||
|
||||
47
lib/jekyll/readers/theme_assets_reader.rb
Normal file
47
lib/jekyll/readers/theme_assets_reader.rb
Normal file
@@ -0,0 +1,47 @@
|
||||
module Jekyll
|
||||
class ThemeAssetsReader
|
||||
attr_reader :site
|
||||
def initialize(site)
|
||||
@site = site
|
||||
end
|
||||
|
||||
def read
|
||||
return unless site.theme && site.theme.assets_path
|
||||
|
||||
Find.find(site.theme.assets_path) do |path|
|
||||
next if File.directory?(path)
|
||||
if File.symlink?(path)
|
||||
Jekyll.logger.warn "Theme reader:", "Ignored symlinked asset: #{path}"
|
||||
else
|
||||
read_theme_asset(path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def read_theme_asset(path)
|
||||
base = site.theme.root
|
||||
dir = File.dirname(path.sub("#{site.theme.root}/", ""))
|
||||
name = File.basename(path)
|
||||
|
||||
if Utils.has_yaml_header?(path)
|
||||
append_unless_exists site.pages,
|
||||
Jekyll::Page.new(site, base, dir, name)
|
||||
else
|
||||
append_unless_exists site.static_files,
|
||||
Jekyll::StaticFile.new(site, base, dir, name)
|
||||
end
|
||||
end
|
||||
|
||||
def append_unless_exists(haystack, new_item)
|
||||
if haystack.any? { |file| file.relative_path == new_item.relative_path }
|
||||
Jekyll.logger.debug "Theme:",
|
||||
"Ignoring #{new_item.relative_path} in theme due to existing file " \
|
||||
"with that path in site."
|
||||
return
|
||||
end
|
||||
|
||||
haystack << new_item
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,8 @@
|
||||
module Jekyll
|
||||
class Regenerator
|
||||
attr_reader :site, :metadata, :cache
|
||||
attr_accessor :disabled
|
||||
private :disabled, :disabled=
|
||||
|
||||
def initialize(site)
|
||||
@site = site
|
||||
@@ -18,18 +20,14 @@ module Jekyll
|
||||
def regenerate?(document)
|
||||
case document
|
||||
when Page
|
||||
document.asset_file? || document.data['regenerate'] ||
|
||||
source_modified_or_dest_missing?(
|
||||
site.in_source_dir(document.relative_path), document.destination(@site.dest)
|
||||
)
|
||||
regenerate_page?(document)
|
||||
when Document
|
||||
!document.write? || document.data['regenerate'] ||
|
||||
source_modified_or_dest_missing?(
|
||||
document.path, document.destination(@site.dest)
|
||||
)
|
||||
regenerate_document?(document)
|
||||
else
|
||||
source_path = document.respond_to?(:path) ? document.path : nil
|
||||
dest_path = document.respond_to?(:destination) ? document.destination(@site.dest) : nil
|
||||
source_path = document.respond_to?(:path) ? document.path : nil
|
||||
dest_path = if document.respond_to?(:destination)
|
||||
document.destination(@site.dest)
|
||||
end
|
||||
source_modified_or_dest_missing?(source_path, dest_path)
|
||||
end
|
||||
end
|
||||
@@ -42,7 +40,7 @@ module Jekyll
|
||||
|
||||
metadata[path] = {
|
||||
"mtime" => File.mtime(path),
|
||||
"deps" => []
|
||||
"deps" => []
|
||||
}
|
||||
cache[path] = true
|
||||
end
|
||||
@@ -92,30 +90,21 @@ module Jekyll
|
||||
return cache[path]
|
||||
end
|
||||
|
||||
# Check path that exists in metadata
|
||||
data = metadata[path]
|
||||
if data
|
||||
data["deps"].each do |dependency|
|
||||
if modified?(dependency)
|
||||
return cache[dependency] = cache[path] = true
|
||||
end
|
||||
end
|
||||
if File.exist?(path) && data["mtime"].eql?(File.mtime(path))
|
||||
return cache[path] = false
|
||||
else
|
||||
return add(path)
|
||||
end
|
||||
if metadata[path]
|
||||
# If we have seen this file before,
|
||||
# check if it or one of its dependencies has been modified
|
||||
existing_file_modified?(path)
|
||||
else
|
||||
# If we have not seen this file before, add it to the metadata and regenerate it
|
||||
add(path)
|
||||
end
|
||||
|
||||
# Path does not exist in metadata, add it
|
||||
return add(path)
|
||||
end
|
||||
|
||||
# Add a dependency of a path
|
||||
#
|
||||
# Returns nothing.
|
||||
def add_dependency(path, dependency)
|
||||
return if metadata[path].nil? || @disabled
|
||||
return if metadata[path].nil? || disabled
|
||||
|
||||
unless metadata[path]["deps"].include? dependency
|
||||
metadata[path]["deps"] << dependency
|
||||
@@ -137,15 +126,15 @@ module Jekyll
|
||||
#
|
||||
# Returns the String path of the file.
|
||||
def metadata_file
|
||||
site.in_source_dir('.jekyll-metadata')
|
||||
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.incremental? if @disabled.nil?
|
||||
@disabled
|
||||
self.disabled = !site.incremental? if disabled.nil?
|
||||
disabled
|
||||
end
|
||||
|
||||
private
|
||||
@@ -171,5 +160,40 @@ module Jekyll
|
||||
{}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def regenerate_page?(document)
|
||||
document.asset_file? || document.data["regenerate"] ||
|
||||
source_modified_or_dest_missing?(
|
||||
site.in_source_dir(document.relative_path), document.destination(@site.dest)
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
def regenerate_document?(document)
|
||||
!document.write? || document.data["regenerate"] ||
|
||||
source_modified_or_dest_missing?(
|
||||
document.path, document.destination(@site.dest)
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
def existing_file_modified?(path)
|
||||
# If one of this file dependencies have been modified,
|
||||
# set the regeneration bit for both the dependency and the file to true
|
||||
metadata[path]["deps"].each do |dependency|
|
||||
if modified?(dependency)
|
||||
return cache[dependency] = cache[path] = true
|
||||
end
|
||||
end
|
||||
|
||||
if File.exist?(path) && metadata[path]["mtime"].eql?(File.mtime(path))
|
||||
# If this file has not been modified, set the regeneration bit to false
|
||||
cache[path] = false
|
||||
else
|
||||
# If it has been modified, set it to true
|
||||
add(path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ module Jekyll
|
||||
def initialize(post)
|
||||
@post = post
|
||||
@site = post.site
|
||||
Jekyll::External.require_with_graceful_fail('classifier-reborn') if site.lsi
|
||||
Jekyll::External.require_with_graceful_fail("classifier-reborn") if site.lsi
|
||||
end
|
||||
|
||||
def build
|
||||
|
||||
@@ -2,12 +2,32 @@
|
||||
|
||||
module Jekyll
|
||||
class Renderer
|
||||
attr_reader :document, :site, :payload
|
||||
attr_reader :document, :site
|
||||
attr_writer :layouts, :payload
|
||||
|
||||
def initialize(site, document, site_payload = nil)
|
||||
@site = site
|
||||
@document = document
|
||||
@payload = site_payload || site.site_payload
|
||||
@payload = site_payload
|
||||
end
|
||||
|
||||
# Fetches the payload used in Liquid rendering.
|
||||
# It can be written with #payload=(new_payload)
|
||||
# Falls back to site.site_payload if no payload is set.
|
||||
#
|
||||
# Returns a Jekyll::Drops::UnifiedPayloadDrop
|
||||
def payload
|
||||
@payload ||= site.site_payload
|
||||
end
|
||||
|
||||
# The list of layouts registered for this Renderer.
|
||||
# It can be written with #layouts=(new_layouts)
|
||||
# Falls back to site.layouts if no layouts are registered.
|
||||
#
|
||||
# Returns a Hash of String => Jekyll::Layout identified
|
||||
# as basename without the extension name.
|
||||
def layouts
|
||||
@layouts || site.layouts
|
||||
end
|
||||
|
||||
# Determine which converters to use based on this document's
|
||||
@@ -15,7 +35,7 @@ module Jekyll
|
||||
#
|
||||
# Returns an array of Converter instances.
|
||||
def converters
|
||||
@converters ||= site.converters.select { |c| c.matches(document.extname) }
|
||||
@converters ||= site.converters.select { |c| c.matches(document.extname) }.sort
|
||||
end
|
||||
|
||||
# Determine the extname the outputted file should have
|
||||
@@ -38,20 +58,21 @@ module Jekyll
|
||||
payload["paginator"] = document.pager.to_liquid
|
||||
end
|
||||
|
||||
if document.is_a?(Document) && document.collection.label == 'posts'
|
||||
payload['site']['related_posts'] = document.related_posts
|
||||
if document.is_a?(Document) && document.collection.label == "posts"
|
||||
payload["site"]["related_posts"] = document.related_posts
|
||||
else
|
||||
payload["site"]["related_posts"] = nil
|
||||
end
|
||||
|
||||
# render and transform content (this becomes the final content of the object)
|
||||
payload['highlighter_prefix'] = converters.first.highlighter_prefix
|
||||
payload['highlighter_suffix'] = converters.first.highlighter_suffix
|
||||
payload["highlighter_prefix"] = converters.first.highlighter_prefix
|
||||
payload["highlighter_suffix"] = converters.first.highlighter_suffix
|
||||
|
||||
Jekyll.logger.debug "Pre-Render Hooks:", document.relative_path
|
||||
document.trigger_hooks(:pre_render, payload)
|
||||
|
||||
info = {
|
||||
:filters => [Jekyll::Filters],
|
||||
:registers => { :site => site, :page => payload['page'] }
|
||||
:registers => { :site => site, :page => payload["page"] }
|
||||
}
|
||||
|
||||
output = document.content
|
||||
@@ -87,7 +108,9 @@ module Jekyll
|
||||
begin
|
||||
converter.convert output
|
||||
rescue => e
|
||||
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error while 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
|
||||
@@ -103,14 +126,19 @@ module Jekyll
|
||||
#
|
||||
# Returns the content, rendered by Liquid.
|
||||
def render_liquid(content, payload, info, path = nil)
|
||||
site.liquid_renderer.file(path).parse(content).render!(payload, info)
|
||||
rescue Tags::IncludeTagError => e
|
||||
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{e.path}, included in #{path || document.relative_path}"
|
||||
raise e
|
||||
template = site.liquid_renderer.file(path).parse(content)
|
||||
template.warnings.each do |e|
|
||||
Jekyll.logger.warn "Liquid Warning:",
|
||||
LiquidRenderer.format_error(e, path || document.relative_path)
|
||||
end
|
||||
template.render!(payload, info)
|
||||
# rubocop: disable RescueException
|
||||
rescue Exception => e
|
||||
Jekyll.logger.error "Liquid Exception:", "#{e.message} in #{path || document.relative_path}"
|
||||
Jekyll.logger.error "Liquid Exception:",
|
||||
LiquidRenderer.format_error(e, path || document.relative_path)
|
||||
raise e
|
||||
end
|
||||
# rubocop: enable RescueException
|
||||
|
||||
# Checks if the layout specified in the document actually exists
|
||||
#
|
||||
@@ -118,7 +146,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if the layout is invalid, false if otherwise
|
||||
def invalid_layout?(layout)
|
||||
!document.data["layout"].nil? && layout.nil?
|
||||
!document.data["layout"].nil? && layout.nil? && !(document.is_a? Jekyll::Excerpt)
|
||||
end
|
||||
|
||||
# Render layouts and place given content inside.
|
||||
@@ -129,22 +157,28 @@ module Jekyll
|
||||
# Returns the content placed in the Liquid-rendered layouts
|
||||
def place_in_layouts(content, payload, info)
|
||||
output = content.dup
|
||||
layout = site.layouts[document.data["layout"]]
|
||||
layout = layouts[document.data["layout"]]
|
||||
|
||||
Jekyll.logger.warn("Build Warning:", "Layout '#{document.data["layout"]}' requested in #{document.relative_path} does not exist.") if invalid_layout? layout
|
||||
Jekyll.logger.warn(
|
||||
"Build Warning:",
|
||||
"Layout '#{document.data["layout"]}' requested in "\
|
||||
"#{document.relative_path} does not exist."
|
||||
) if invalid_layout? layout
|
||||
|
||||
used = Set.new([layout])
|
||||
used = Set.new([layout])
|
||||
|
||||
# Reset the payload layout data to ensure it starts fresh for each page.
|
||||
payload["layout"] = nil
|
||||
|
||||
while layout
|
||||
payload['content'] = output
|
||||
payload['page'] = document.to_liquid
|
||||
payload['layout'] = Utils.deep_merge_hashes(payload['layout'] || {}, layout.data)
|
||||
payload["content"] = output
|
||||
payload["layout"] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
|
||||
|
||||
output = render_liquid(
|
||||
layout.content,
|
||||
payload,
|
||||
info,
|
||||
File.join(site.config['layouts_dir'], layout.name)
|
||||
layout.relative_path
|
||||
)
|
||||
|
||||
# Add layout to dependency tree
|
||||
@@ -153,12 +187,9 @@ module Jekyll
|
||||
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
|
||||
else
|
||||
used << layout
|
||||
end
|
||||
if (layout = layouts[layout.data["layout"]])
|
||||
break if used.include?(layout)
|
||||
used << layout
|
||||
end
|
||||
end
|
||||
|
||||
@@ -168,7 +199,7 @@ module Jekyll
|
||||
private
|
||||
|
||||
def permalink_ext
|
||||
if document.permalink
|
||||
if document.permalink && !document.permalink.end_with?("/")
|
||||
permalink_ext = File.extname(document.permalink)
|
||||
permalink_ext unless permalink_ext.empty?
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# encoding: UTF-8
|
||||
require 'csv'
|
||||
require "csv"
|
||||
|
||||
module Jekyll
|
||||
class Site
|
||||
@@ -8,15 +8,40 @@ module Jekyll
|
||||
: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
|
||||
:gems, :plugin_manager, :theme
|
||||
|
||||
attr_accessor :converters, :generators, :reader
|
||||
attr_reader :regenerator, :liquid_renderer
|
||||
attr_reader :regenerator, :liquid_renderer, :includes_load_paths
|
||||
|
||||
# Public: Initialize a new Site.
|
||||
#
|
||||
# config - A Hash containing site configuration details.
|
||||
def initialize(config)
|
||||
# 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
|
||||
|
||||
self.config = config
|
||||
|
||||
@reader = Reader.new(self)
|
||||
@regenerator = Regenerator.new(self)
|
||||
@liquid_renderer = LiquidRenderer.new(self)
|
||||
|
||||
Jekyll.sites << self
|
||||
|
||||
reset
|
||||
setup
|
||||
|
||||
Jekyll::Hooks.trigger :site, :after_init, self
|
||||
end
|
||||
|
||||
# Public: Set the site's configuration. This handles side-effects caused by
|
||||
# changing values in the configuration.
|
||||
#
|
||||
# config - a Jekyll::Configuration, containing the new configuration.
|
||||
#
|
||||
# Returns the new configuration.
|
||||
def config=(config)
|
||||
@config = config.clone
|
||||
|
||||
%w(safe lsi highlighter baseurl exclude include future unpublished
|
||||
@@ -24,29 +49,14 @@ module Jekyll
|
||||
self.send("#{opt}=", config[opt])
|
||||
end
|
||||
|
||||
# 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
|
||||
configure_plugins
|
||||
configure_theme
|
||||
configure_include_paths
|
||||
configure_file_read_opts
|
||||
|
||||
@reader = Jekyll::Reader.new(self)
|
||||
self.permalink_style = config["permalink"].to_sym
|
||||
|
||||
# Initialize incremental regenerator
|
||||
@regenerator = Regenerator.new(self)
|
||||
|
||||
@liquid_renderer = LiquidRenderer.new(self)
|
||||
|
||||
self.plugin_manager = Jekyll::PluginManager.new(self)
|
||||
self.plugins = plugin_manager.plugins_path
|
||||
|
||||
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
|
||||
@config
|
||||
end
|
||||
|
||||
# Public: Read, process, and write this Site to output.
|
||||
@@ -63,7 +73,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def print_stats
|
||||
if @config['profile']
|
||||
if @config["profile"]
|
||||
puts @liquid_renderer.stats_table
|
||||
end
|
||||
end
|
||||
@@ -72,7 +82,11 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def reset
|
||||
self.time = (config['time'] ? Utils.parse_date(config['time'].to_s, "Invalid time in _config.yml.") : Time.now)
|
||||
if config["time"]
|
||||
self.time = Utils.parse_date(config["time"].to_s, "Invalid time in _config.yml.")
|
||||
else
|
||||
self.time = Time.now
|
||||
end
|
||||
self.layouts = {}
|
||||
self.pages = []
|
||||
self.static_files = []
|
||||
@@ -106,18 +120,23 @@ module Jekyll
|
||||
dest_pathname = Pathname.new(dest)
|
||||
Pathname.new(source).ascend do |path|
|
||||
if path == dest_pathname
|
||||
raise Errors::FatalException.new "Destination directory cannot be or contain the Source directory."
|
||||
raise(
|
||||
Errors::FatalException,
|
||||
"Destination directory cannot be or contain the Source directory."
|
||||
)
|
||||
end
|
||||
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.
|
||||
# If config['collections'] is set, a new instance is created
|
||||
# for each item in the collection, a new hash is returned otherwise.
|
||||
#
|
||||
# Returns a Hash containing collection name-to-instance pairs.
|
||||
def collections
|
||||
@collections ||= Hash[collection_names.map { |coll| [coll, Jekyll::Collection.new(self, coll)] } ]
|
||||
@collections ||= Hash[collection_names.map do |coll|
|
||||
[coll, Jekyll::Collection.new(self, coll)]
|
||||
end]
|
||||
end
|
||||
|
||||
# The list of collection names.
|
||||
@@ -125,11 +144,11 @@ module Jekyll
|
||||
# Returns an array of collection names from the configuration,
|
||||
# or an empty array if the `collections` key is not set.
|
||||
def collection_names
|
||||
case config['collections']
|
||||
case config["collections"]
|
||||
when Hash
|
||||
config['collections'].keys
|
||||
config["collections"].keys
|
||||
when Array
|
||||
config['collections']
|
||||
config["collections"]
|
||||
when nil
|
||||
[]
|
||||
else
|
||||
@@ -151,7 +170,10 @@ module Jekyll
|
||||
# Returns nothing.
|
||||
def generate
|
||||
generators.each do |generator|
|
||||
start = Time.now
|
||||
generator.generate(self)
|
||||
Jekyll.logger.debug "Generating:",
|
||||
"#{generator.class} finished in #{Time.now - start} seconds."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -165,25 +187,10 @@ module Jekyll
|
||||
|
||||
Jekyll::Hooks.trigger :site, :pre_render, self, payload
|
||||
|
||||
collections.each do |_, collection|
|
||||
collection.docs.each do |document|
|
||||
if regenerator.regenerate?(document)
|
||||
document.output = Jekyll::Renderer.new(self, document, payload).run
|
||||
document.trigger_hooks(:post_render)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pages.flatten.each do |page|
|
||||
if regenerator.regenerate?(page)
|
||||
page.output = Jekyll::Renderer.new(self, page, payload).run
|
||||
page.trigger_hooks(:post_render)
|
||||
end
|
||||
end
|
||||
render_docs(payload)
|
||||
render_pages(payload)
|
||||
|
||||
Jekyll::Hooks.trigger :site, :post_render, self, payload
|
||||
rescue Errno::ENOENT
|
||||
# ignore missing layout dir
|
||||
end
|
||||
|
||||
# Remove orphaned files and empty directories in destination.
|
||||
@@ -205,7 +212,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def posts
|
||||
collections['posts'] ||= Collection.new(self, 'posts')
|
||||
collections["posts"] ||= Collection.new(self, "posts")
|
||||
end
|
||||
|
||||
# Construct a Hash of Posts indexed by the specified Post attribute.
|
||||
@@ -225,17 +232,19 @@ module Jekyll
|
||||
# Build a hash map based on the specified post attribute ( post attr =>
|
||||
# array of posts ) then sort each array in reverse order.
|
||||
hash = Hash.new { |h, key| h[key] = [] }
|
||||
posts.docs.each { |p| p.data[post_attr].each { |t| hash[t] << p } if p.data[post_attr] }
|
||||
posts.docs.each do |p|
|
||||
p.data[post_attr].each { |t| hash[t] << p } if p.data[post_attr]
|
||||
end
|
||||
hash.values.each { |posts| posts.sort!.reverse! }
|
||||
hash
|
||||
end
|
||||
|
||||
def tags
|
||||
post_attr_hash('tags')
|
||||
post_attr_hash("tags")
|
||||
end
|
||||
|
||||
def categories
|
||||
post_attr_hash('categories')
|
||||
post_attr_hash("categories")
|
||||
end
|
||||
|
||||
# Prepare site data for site payload. The method maintains backward compatibility
|
||||
@@ -243,7 +252,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the Hash to be hooked to site.data.
|
||||
def site_data
|
||||
config['data'] || data
|
||||
config["data"] || data
|
||||
end
|
||||
|
||||
# The Hash payload containing site-wide data.
|
||||
@@ -262,6 +271,7 @@ module Jekyll
|
||||
def site_payload
|
||||
Drops::UnifiedPayloadDrop.new self
|
||||
end
|
||||
alias_method :to_liquid, :site_payload
|
||||
|
||||
# Get the implementation class for the given Converter.
|
||||
# Returns the Converter instance implementing the given Converter.
|
||||
@@ -288,7 +298,7 @@ module Jekyll
|
||||
#
|
||||
# Returns
|
||||
def relative_permalinks_are_deprecated
|
||||
if config['relative_permalinks']
|
||||
if config["relative_permalinks"]
|
||||
Jekyll.logger.abort_with "Since v3.0, permalinks for pages" \
|
||||
" in subfolders must be relative to the" \
|
||||
" site source directory, not the parent" \
|
||||
@@ -333,7 +343,7 @@ module Jekyll
|
||||
#
|
||||
# Returns a Boolean: true for a full rebuild, false for normal build
|
||||
def incremental?(override = {})
|
||||
override['incremental'] || config['incremental']
|
||||
override["incremental"] || config["incremental"]
|
||||
end
|
||||
|
||||
# Returns the publisher or creates a new publisher if it doesn't
|
||||
@@ -356,6 +366,19 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Prefix a given path with the theme directory.
|
||||
#
|
||||
# paths - (optional) path elements to a file or directory within the
|
||||
# theme directory
|
||||
#
|
||||
# Returns a path which is prefixed with the theme root directory.
|
||||
def in_theme_dir(*paths)
|
||||
return nil unless theme
|
||||
paths.reduce(theme.root) 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
|
||||
@@ -368,11 +391,10 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Limits the current posts; removes the posts which exceed the limit_posts
|
||||
#
|
||||
# Returns nothing
|
||||
private
|
||||
def limit_posts!
|
||||
if limit_posts > 0
|
||||
limit = posts.docs.length < limit_posts ? posts.docs.length : limit_posts
|
||||
@@ -384,8 +406,64 @@ module Jekyll
|
||||
# already exist.
|
||||
#
|
||||
# Returns The Cleaner
|
||||
private
|
||||
def site_cleaner
|
||||
@site_cleaner ||= Cleaner.new(self)
|
||||
end
|
||||
|
||||
private
|
||||
def configure_plugins
|
||||
self.plugin_manager = Jekyll::PluginManager.new(self)
|
||||
self.plugins = plugin_manager.plugins_path
|
||||
end
|
||||
|
||||
private
|
||||
def configure_theme
|
||||
self.theme = nil
|
||||
return if config["theme"].nil?
|
||||
|
||||
self.theme =
|
||||
if config["theme"].is_a?(String)
|
||||
Jekyll::Theme.new(config["theme"])
|
||||
else
|
||||
Jekyll.logger.warn "Theme:", "value of 'theme' in config should be " \
|
||||
"String to use gem-based themes, but got #{config["theme"].class}"
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def configure_include_paths
|
||||
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
|
||||
@includes_load_paths << theme.includes_path if self.theme
|
||||
end
|
||||
|
||||
private
|
||||
def configure_file_read_opts
|
||||
self.file_read_opts = {}
|
||||
self.file_read_opts[:encoding] = config["encoding"] if config["encoding"]
|
||||
end
|
||||
|
||||
private
|
||||
def render_docs(payload)
|
||||
collections.each do |_, collection|
|
||||
collection.docs.each do |document|
|
||||
if regenerator.regenerate?(document)
|
||||
document.output = Jekyll::Renderer.new(self, document, payload).run
|
||||
document.trigger_hooks(:post_render)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def render_pages(payload)
|
||||
pages.flatten.each do |page|
|
||||
if regenerator.regenerate?(page)
|
||||
page.output = Jekyll::Renderer.new(self, page, payload).run
|
||||
page.trigger_hooks(:post_render)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
module Jekyll
|
||||
class StaticFile
|
||||
# The cache of last modification times [path] -> mtime.
|
||||
@@mtimes = {}
|
||||
attr_reader :relative_path, :extname, :name
|
||||
|
||||
attr_reader :relative_path, :extname
|
||||
class << self
|
||||
# The cache of last modification times [path] -> mtime.
|
||||
def mtimes
|
||||
@mtimes ||= {}
|
||||
end
|
||||
|
||||
def reset_cache
|
||||
@mtimes = nil
|
||||
end
|
||||
end
|
||||
|
||||
# Initialize a new StaticFile.
|
||||
#
|
||||
@@ -11,6 +19,7 @@ module Jekyll
|
||||
# base - The String path to the <source>.
|
||||
# dir - The String path between <source> and the file.
|
||||
# name - The String filename of the file.
|
||||
# rubocop: disable ParameterLists
|
||||
def initialize(site, base, dir, name, collection = nil)
|
||||
@site = site
|
||||
@base = base
|
||||
@@ -20,6 +29,7 @@ module Jekyll
|
||||
@relative_path = File.join(*[@dir, @name].compact)
|
||||
@extname = File.extname(@name)
|
||||
end
|
||||
# rubocop: enable ParameterLists
|
||||
|
||||
# Returns source file path.
|
||||
def path
|
||||
@@ -56,7 +66,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if modified since last write.
|
||||
def modified?
|
||||
@@mtimes[path] != mtime
|
||||
self.class.mtimes[path] != mtime
|
||||
end
|
||||
|
||||
# Whether to write the file to the filesystem
|
||||
@@ -64,7 +74,7 @@ module Jekyll
|
||||
# Returns true unless the defaults for the destination path from
|
||||
# _config.yml contain `published: false`.
|
||||
def write?
|
||||
defaults.fetch('published', true)
|
||||
defaults.fetch("published", true)
|
||||
end
|
||||
|
||||
# Write the static file to the destination directory (if modified).
|
||||
@@ -76,26 +86,19 @@ module Jekyll
|
||||
dest_path = destination(dest)
|
||||
|
||||
return false if File.exist?(dest_path) && !modified?
|
||||
@@mtimes[path] = mtime
|
||||
self.class.mtimes[path] = mtime
|
||||
|
||||
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||
FileUtils.rm(dest_path) if File.exist?(dest_path)
|
||||
FileUtils.cp(path, dest_path)
|
||||
File.utime(@@mtimes[path], @@mtimes[path], dest_path)
|
||||
copy_file(dest_path)
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
# Reset the mtimes cache (for testing purposes).
|
||||
#
|
||||
# Returns nothing.
|
||||
def self.reset_cache
|
||||
@@mtimes = {}
|
||||
nil
|
||||
end
|
||||
|
||||
def to_liquid
|
||||
{
|
||||
"basename" => File.basename(name, extname),
|
||||
"name" => name,
|
||||
"extname" => extname,
|
||||
"modified_time" => modified_time,
|
||||
"path" => File.join("", relative_path)
|
||||
@@ -105,11 +108,11 @@ module Jekyll
|
||||
def placeholders
|
||||
{
|
||||
:collection => @collection.label,
|
||||
:path => relative_path[
|
||||
:path => relative_path[
|
||||
@collection.relative_directory.size..relative_path.size],
|
||||
:output_ext => '',
|
||||
:name => '',
|
||||
:title => ''
|
||||
:output_ext => "",
|
||||
:name => "",
|
||||
:title => ""
|
||||
}
|
||||
end
|
||||
|
||||
@@ -121,10 +124,10 @@ module Jekyll
|
||||
relative_path
|
||||
else
|
||||
::Jekyll::URL.new({
|
||||
:template => @collection.url_template,
|
||||
:template => @collection.url_template,
|
||||
:placeholders => placeholders
|
||||
})
|
||||
end.to_s.gsub(/\/$/, '')
|
||||
end.to_s.gsub(%r!/$!, "")
|
||||
end
|
||||
|
||||
# Returns the type of the collection if present, nil otherwise.
|
||||
@@ -137,5 +140,18 @@ module Jekyll
|
||||
def defaults
|
||||
@defaults ||= @site.frontmatter_defaults.all url, type
|
||||
end
|
||||
|
||||
private
|
||||
def copy_file(dest_path)
|
||||
if @site.safe || Jekyll.env == "production"
|
||||
FileUtils.cp(path, dest_path)
|
||||
else
|
||||
FileUtils.copy_entry(path, dest_path)
|
||||
end
|
||||
|
||||
unless File.symlink?(dest_path)
|
||||
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,13 +6,13 @@ module Jekyll
|
||||
@default_formatter = Formatter.new
|
||||
@logdev = $stdout
|
||||
@formatter = proc do |_, _, _, msg|
|
||||
"#{msg}"
|
||||
msg.to_s
|
||||
end
|
||||
end
|
||||
|
||||
def add(severity, message = nil, progname = nil, &block)
|
||||
def add(severity, message = nil, progname = nil)
|
||||
severity ||= UNKNOWN
|
||||
@logdev = set_logdevice(severity)
|
||||
@logdev = logdevice(severity)
|
||||
|
||||
if @logdev.nil? || severity < @level
|
||||
return true
|
||||
@@ -27,7 +27,8 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
@logdev.puts(
|
||||
format_message(format_severity(severity), Time.now, progname, message))
|
||||
format_message(format_severity(severity), Time.now, progname, message)
|
||||
)
|
||||
true
|
||||
end
|
||||
|
||||
@@ -47,7 +48,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
|
||||
def set_logdevice(severity)
|
||||
def logdevice(severity)
|
||||
if severity > INFO
|
||||
$stderr
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user