mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
459 Commits
3.4-stable
...
url-drop-o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed2d30dc88 | ||
|
|
3088032128 | ||
|
|
56436f46fe | ||
|
|
34967978c2 | ||
|
|
b35c0d8607 | ||
|
|
a6efa48883 | ||
|
|
12832af98e | ||
|
|
f8d06f20aa | ||
|
|
143367c5ca | ||
|
|
592daf4ce2 | ||
|
|
82c219a2e7 | ||
|
|
590dd6cf80 | ||
|
|
8f1959bbc4 | ||
|
|
8a017b5a2a | ||
|
|
96724af03e | ||
|
|
4493f2a58b | ||
|
|
93169f60c3 | ||
|
|
7b255baac2 | ||
|
|
188bc71713 | ||
|
|
897cdbb427 | ||
|
|
ec84bec6d6 | ||
|
|
819491b99c | ||
|
|
00a1d70e8f | ||
|
|
66c39d3bf9 | ||
|
|
e25c4af590 | ||
|
|
1a592c5757 | ||
|
|
a54906c78a | ||
|
|
56546a28fd | ||
|
|
c0c1185c56 | ||
|
|
c2b240e9b5 | ||
|
|
da65e94728 | ||
|
|
2b28f9fd57 | ||
|
|
026f8280e0 | ||
|
|
33cb629079 | ||
|
|
f904a7201e | ||
|
|
848bd4edcc | ||
|
|
c7d98cae26 | ||
|
|
59a42230c7 | ||
|
|
fa2aa394d6 | ||
|
|
355436f1ee | ||
|
|
e946bbf331 | ||
|
|
735411e27f | ||
|
|
74373baa55 | ||
|
|
2253b9dd85 | ||
|
|
e059a18ef0 | ||
|
|
a641568da8 | ||
|
|
409a36e6c0 | ||
|
|
b0136fccfa | ||
|
|
17370b5992 | ||
|
|
9f7815786b | ||
|
|
b089e44016 | ||
|
|
5c95201c98 | ||
|
|
f91b614793 | ||
|
|
4f4d42444a | ||
|
|
a0cf395246 | ||
|
|
00cca72c7b | ||
|
|
141b1afd50 | ||
|
|
605a14412d | ||
|
|
6aa8f741c9 | ||
|
|
e836de3205 | ||
|
|
17c888dcab | ||
|
|
374de56062 | ||
|
|
f1410c7e23 | ||
|
|
19a84584c9 | ||
|
|
7a85376246 | ||
|
|
ca39b15255 | ||
|
|
285fe73b2e | ||
|
|
e24fd073fe | ||
|
|
0f0dab0239 | ||
|
|
3a52866cce | ||
|
|
ffbccb63ba | ||
|
|
82809bbc6d | ||
|
|
3a527bcecf | ||
|
|
483951be75 | ||
|
|
056cebd16b | ||
|
|
0dcc7cb20e | ||
|
|
5380b4fd83 | ||
|
|
9eba49cd61 | ||
|
|
2207223559 | ||
|
|
9f302b34ae | ||
|
|
e3917b6fa2 | ||
|
|
88e7943084 | ||
|
|
6c88e5c241 | ||
|
|
01dd356564 | ||
|
|
0d96ac4700 | ||
|
|
5ceef94c1b | ||
|
|
6384724a09 | ||
|
|
8dd76bc6c7 | ||
|
|
7236e514ea | ||
|
|
aeb0fd7ddf | ||
|
|
fbdfbbb28d | ||
|
|
1ae0e83b2d | ||
|
|
3439a0d947 | ||
|
|
69e97fa06f | ||
|
|
401e20cfa6 | ||
|
|
d3b00cb84c | ||
|
|
2c0f5b3059 | ||
|
|
79b3f00b21 | ||
|
|
ae8889ae2b | ||
|
|
13b9dcd466 | ||
|
|
1dd3e3b593 | ||
|
|
551d2ea858 | ||
|
|
36265128cd | ||
|
|
4299539db5 | ||
|
|
8221855735 | ||
|
|
e031ac9b27 | ||
|
|
158ab6ce93 | ||
|
|
2ceff6ab3e | ||
|
|
4e3b5ba5b4 | ||
|
|
fcde83431e | ||
|
|
b0afe5125c | ||
|
|
b76b4a4e8a | ||
|
|
61cdebf272 | ||
|
|
2a4d33e615 | ||
|
|
cee3cc506e | ||
|
|
2cfcb23a49 | ||
|
|
c71c27a397 | ||
|
|
73368f8f0d | ||
|
|
35684dd1b8 | ||
|
|
33aafe0a45 | ||
|
|
466a4a69eb | ||
|
|
5dedd233bd | ||
|
|
307c0c933d | ||
|
|
4b7ebeb014 | ||
|
|
729472bbda | ||
|
|
9c7ac163cc | ||
|
|
b6bd2f79d6 | ||
|
|
20c0576862 | ||
|
|
00d0b5de6b | ||
|
|
5a1d78cadf | ||
|
|
18d8144dc1 | ||
|
|
52b7e5245c | ||
|
|
22b18543ef | ||
|
|
b2e6e408ed | ||
|
|
5790510beb | ||
|
|
8a8b055150 | ||
|
|
59db714d8b | ||
|
|
b8430df6b1 | ||
|
|
2561470039 | ||
|
|
f1a9af5ba6 | ||
|
|
dcd54adbc0 | ||
|
|
6c728120be | ||
|
|
93c8b8556e | ||
|
|
33ff62ee03 | ||
|
|
bd104c4ee0 | ||
|
|
4d9c93e491 | ||
|
|
e0dfff0122 | ||
|
|
1d55b70365 | ||
|
|
771bae4ec5 | ||
|
|
3156f74a53 | ||
|
|
72564f179b | ||
|
|
f93c155781 | ||
|
|
13b6c502b7 | ||
|
|
308ba550ef | ||
|
|
86d2b77f3b | ||
|
|
2b535792c7 | ||
|
|
c3c5745e4a | ||
|
|
d3a15fad8d | ||
|
|
be70e8edd7 | ||
|
|
e5c0e91bc5 | ||
|
|
0126f4ab5e | ||
|
|
501ef914d7 | ||
|
|
e3dae0065f | ||
|
|
d37f604fe2 | ||
|
|
46668744e4 | ||
|
|
0aea7c5262 | ||
|
|
fbd535278e | ||
|
|
5f7f9ff196 | ||
|
|
2e34bb816a | ||
|
|
457e4515e8 | ||
|
|
4aa073279f | ||
|
|
3a36fde240 | ||
|
|
13976cfb33 | ||
|
|
694dcbd9e0 | ||
|
|
4c61e1809a | ||
|
|
0108b22f3c | ||
|
|
76fb728f72 | ||
|
|
c35f0ed71c | ||
|
|
4b8b3084cd | ||
|
|
b728473a63 | ||
|
|
144d053226 | ||
|
|
af5d0965c0 | ||
|
|
b37d8b13dc | ||
|
|
a2e5899450 | ||
|
|
14f0db9dcc | ||
|
|
ccb133fd33 | ||
|
|
3df88b2e31 | ||
|
|
edc7a7ae54 | ||
|
|
be9b83dff6 | ||
|
|
c49bc5c28b | ||
|
|
5f6abda201 | ||
|
|
7945da2b1f | ||
|
|
a6663fc667 | ||
|
|
87dd49693b | ||
|
|
4e82518a01 | ||
|
|
034f03ed50 | ||
|
|
8b8ad61097 | ||
|
|
029b993225 | ||
|
|
cce53abe3d | ||
|
|
7d7a312b33 | ||
|
|
a83b668409 | ||
|
|
d1c7bdb985 | ||
|
|
84d1f2d408 | ||
|
|
768d2bb5a3 | ||
|
|
f46dffcc8e | ||
|
|
5f19b1a7e0 | ||
|
|
b4926daf3a | ||
|
|
52ac75b484 | ||
|
|
4d689ec051 | ||
|
|
94e6b65ad4 | ||
|
|
fb2654f293 | ||
|
|
dede66936e | ||
|
|
370d28e290 | ||
|
|
45b1f9e5ec | ||
|
|
55103132f9 | ||
|
|
faf5be46a5 | ||
|
|
725c756ae1 | ||
|
|
f3bfe2febd | ||
|
|
5dee5a000a | ||
|
|
da5ee4685e | ||
|
|
57e93c463a | ||
|
|
a4c4388b8d | ||
|
|
e7a7215095 | ||
|
|
0eb9379354 | ||
|
|
7c49070a0e | ||
|
|
e4a09706f5 | ||
|
|
b7916f8a83 | ||
|
|
201470902a | ||
|
|
367c452105 | ||
|
|
4eb82706d8 | ||
|
|
a4d2ceb320 | ||
|
|
b807799f24 | ||
|
|
bdcdfa694f | ||
|
|
1b1fe27d75 | ||
|
|
20ed6d0a3c | ||
|
|
d49c781779 | ||
|
|
1c33bd5797 | ||
|
|
db06288448 | ||
|
|
d925dbca30 | ||
|
|
0cf5310cf5 | ||
|
|
15e133f627 | ||
|
|
409c8f9f31 | ||
|
|
3921e523c5 | ||
|
|
0d02a25b04 | ||
|
|
711a8483c6 | ||
|
|
fe388a885e | ||
|
|
8325d56a1a | ||
|
|
6edc546d36 | ||
|
|
3688640d59 | ||
|
|
73e70da9e5 | ||
|
|
0b93d11cc6 | ||
|
|
86703f1009 | ||
|
|
f598b7e680 | ||
|
|
e5317ced15 | ||
|
|
7affec2347 | ||
|
|
99f5925cd3 | ||
|
|
a2e82b7264 | ||
|
|
b367314424 | ||
|
|
a6518c1de3 | ||
|
|
b91da2c904 | ||
|
|
f2bf984160 | ||
|
|
a9830fadac | ||
|
|
1f00d89e20 | ||
|
|
01c95e85dd | ||
|
|
a3aed14d41 | ||
|
|
a2a6cc0c6a | ||
|
|
990809ba07 | ||
|
|
220335cef7 | ||
|
|
3142f31a7a | ||
|
|
58dce4f099 | ||
|
|
16e807a41d | ||
|
|
cba13d4026 | ||
|
|
c48f147192 | ||
|
|
af0051f19f | ||
|
|
b60b78cfc4 | ||
|
|
c55cc1d9ef | ||
|
|
2c4eebc2ae | ||
|
|
fe6d4c7bea | ||
|
|
161902eda2 | ||
|
|
061aa40e9f | ||
|
|
f9243c5ab1 | ||
|
|
351e3abd8e | ||
|
|
ca9d6be061 | ||
|
|
eab83c3653 | ||
|
|
9d66fc2292 | ||
|
|
df0d3f20c4 | ||
|
|
d592f5781a | ||
|
|
2907825f62 | ||
|
|
086bf13a33 | ||
|
|
93f472d1eb | ||
|
|
428ff04b7f | ||
|
|
ac1369c22c | ||
|
|
f93453368a | ||
|
|
ddc9931c20 | ||
|
|
9e55247dac | ||
|
|
be7fc8a2c4 | ||
|
|
336b488d70 | ||
|
|
7b1841a78e | ||
|
|
6bc9f71050 | ||
|
|
ec5b45cd7c | ||
|
|
0f0ac6f586 | ||
|
|
9e0971e867 | ||
|
|
88ad56c9e0 | ||
|
|
99775e4b51 | ||
|
|
cf65d2cd8e | ||
|
|
4df6753109 | ||
|
|
b87a4358ee | ||
|
|
9bf3279695 | ||
|
|
6a7c49c5b8 | ||
|
|
06223e510e | ||
|
|
633a426ce6 | ||
|
|
754cd2f1b2 | ||
|
|
266d125550 | ||
|
|
b3725e202e | ||
|
|
511481e626 | ||
|
|
d7822aba33 | ||
|
|
ea4a2fd57b | ||
|
|
4bf2090534 | ||
|
|
31a0aef594 | ||
|
|
44c35dc538 | ||
|
|
67a7c22def | ||
|
|
bfb6341339 | ||
|
|
c4f82f176d | ||
|
|
085b5f56f3 | ||
|
|
9a740bc447 | ||
|
|
3e2875f39c | ||
|
|
8e439e673e | ||
|
|
635e3365cc | ||
|
|
ea91864af8 | ||
|
|
108b299702 | ||
|
|
834cb7aaef | ||
|
|
7b9e64af85 | ||
|
|
9b91b248ab | ||
|
|
29ced37641 | ||
|
|
97375b38c7 | ||
|
|
fa9a80b15f | ||
|
|
1fbca40f0b | ||
|
|
ac727f22a3 | ||
|
|
e2cfd7cb4c | ||
|
|
47f54dbeca | ||
|
|
56dfe18c5d | ||
|
|
3d5cf99df5 | ||
|
|
3e4dbc83e3 | ||
|
|
ca87c99a3c | ||
|
|
4085e29f80 | ||
|
|
8a0c0727ea | ||
|
|
0300a7017b | ||
|
|
3551bf6d84 | ||
|
|
f7d1a9c999 | ||
|
|
05790460c1 | ||
|
|
eaa2124226 | ||
|
|
0ecbf40d0e | ||
|
|
31b8a2ba5c | ||
|
|
433a9f99a0 | ||
|
|
b9c645d4c3 | ||
|
|
21106b5431 | ||
|
|
7122810b97 | ||
|
|
1f5612dd1b | ||
|
|
90d7472388 | ||
|
|
e52fa87665 | ||
|
|
71084aee3f | ||
|
|
4e913add3e | ||
|
|
2c75cb1ca7 | ||
|
|
4838e04038 | ||
|
|
db229a85d7 | ||
|
|
6137dccfc0 | ||
|
|
8367d731f6 | ||
|
|
42a65a57e6 | ||
|
|
c48b12ba9f | ||
|
|
8816a24f53 | ||
|
|
2dde1800a2 | ||
|
|
e9457a8e66 | ||
|
|
50292be895 | ||
|
|
b181eb2515 | ||
|
|
b17c6c2914 | ||
|
|
04ae82b849 | ||
|
|
cc7afc170b | ||
|
|
6123175a71 | ||
|
|
7484c23ba4 | ||
|
|
8b3929b139 | ||
|
|
9ec7969c09 | ||
|
|
48a94c4051 | ||
|
|
7414ab068a | ||
|
|
5bc67c1fb7 | ||
|
|
98e19c3cf5 | ||
|
|
2c1991fc16 | ||
|
|
23808c2ae6 | ||
|
|
ec234a4ef8 | ||
|
|
bcebf58cbd | ||
|
|
afe6e3622c | ||
|
|
7b58bcfc9e | ||
|
|
7ea53e0a3f | ||
|
|
bdf594317b | ||
|
|
5b7cc78912 | ||
|
|
1d44be5421 | ||
|
|
229769e249 | ||
|
|
755cc6c137 | ||
|
|
3745b24564 | ||
|
|
eb36ea095f | ||
|
|
2813b9c039 | ||
|
|
6316856773 | ||
|
|
4e40593a53 | ||
|
|
20d2eb2709 | ||
|
|
d41e5e1fc0 | ||
|
|
7e45610379 | ||
|
|
4b325a65af | ||
|
|
0c59ac3d29 | ||
|
|
4924f3ba90 | ||
|
|
1457359ce5 | ||
|
|
6f8c208cb2 | ||
|
|
e0109633de | ||
|
|
78a4f20744 | ||
|
|
759f4b3d93 | ||
|
|
875486e8ae | ||
|
|
384be58b5e | ||
|
|
a7cba8a8a6 | ||
|
|
8bacf01c1b | ||
|
|
3da459ef33 | ||
|
|
a1d98bec82 | ||
|
|
f1e13041b5 | ||
|
|
f6dffecab7 | ||
|
|
966800fb1f | ||
|
|
1ff59026f1 | ||
|
|
c01b7e4a4a | ||
|
|
2cf685feb2 | ||
|
|
0a3916c07e | ||
|
|
a6adfa8358 | ||
|
|
c7db12bad8 | ||
|
|
65a3891ca2 | ||
|
|
2e9a32edd2 | ||
|
|
a05e64c9d3 | ||
|
|
7397f305c2 | ||
|
|
b1edaea7e8 | ||
|
|
84e9ea82d1 | ||
|
|
2c19264d08 | ||
|
|
6d9633e364 | ||
|
|
7efeb3d4af | ||
|
|
335c8fcf62 | ||
|
|
31178bfe69 | ||
|
|
5166ead2e0 | ||
|
|
75c40edff8 | ||
|
|
972dc8c2dd | ||
|
|
02056f7b15 | ||
|
|
845580a258 | ||
|
|
e463813416 | ||
|
|
2133397412 | ||
|
|
72a56d9eb7 | ||
|
|
f7edcceb70 | ||
|
|
2eb8469936 | ||
|
|
607ab66707 | ||
|
|
c42eb7fc3a | ||
|
|
7862f731b6 | ||
|
|
793405c00c | ||
|
|
dde0441b3a | ||
|
|
dbea1ca80b | ||
|
|
191f5e5fd8 | ||
|
|
db8356b065 | ||
|
|
d24ea03acf | ||
|
|
b6120edeae |
2
.github/CONTRIBUTING.markdown
vendored
2
.github/CONTRIBUTING.markdown
vendored
@@ -28,7 +28,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
|
||||
|
||||
* 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/).
|
||||
* Pull requests 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.
|
||||
|
||||
|
||||
1
.github/ISSUE_TEMPLATE.md
vendored
1
.github/ISSUE_TEMPLATE.md
vendored
@@ -18,6 +18,7 @@
|
||||
|
||||
- [ ] 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 ran `jekyll doctor` to check my configuration
|
||||
- [ ] I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
|
||||
- [ ] This is a feature request.
|
||||
|
||||
|
||||
68
.rubocop.yml
68
.rubocop.yml
@@ -4,12 +4,43 @@ AllCops:
|
||||
Include:
|
||||
- lib/**/*.rb
|
||||
Exclude:
|
||||
- lib/jekyll/renderer.rb
|
||||
- bin/**/*
|
||||
- exe/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- vendor/**/*
|
||||
Layout/AlignArray:
|
||||
Enabled: false
|
||||
Layout/AlignHash:
|
||||
EnforcedHashRocketStyle: table
|
||||
Layout/AlignParameters:
|
||||
Enabled: false
|
||||
Layout/EmptyLinesAroundAccessModifier:
|
||||
Enabled: false
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
Layout/EndOfLine:
|
||||
EnforcedStyle: lf
|
||||
Layout/ExtraSpacing:
|
||||
AllowForAlignment: true
|
||||
Layout/FirstParameterIndentation:
|
||||
EnforcedStyle: consistent
|
||||
Layout/IndentationWidth:
|
||||
Severity: error
|
||||
Layout/IndentArray:
|
||||
EnforcedStyle: consistent
|
||||
Layout/IndentHash:
|
||||
EnforcedStyle: consistent
|
||||
Layout/IndentHeredoc:
|
||||
Enabled: false
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Layout/MultilineOperationIndentation:
|
||||
EnforcedStyle: indented
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
Layout/SpaceInsideBrackets:
|
||||
Enabled: false
|
||||
Lint/EndAlignment:
|
||||
Severity: error
|
||||
Lint/UnreachableCode:
|
||||
@@ -36,6 +67,8 @@ Metrics/LineLength:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
- Rakefile
|
||||
- rake/*.rake
|
||||
- Gemfile
|
||||
- jekyll.gemspec
|
||||
Max: 90
|
||||
Severity: warning
|
||||
Metrics/MethodLength:
|
||||
@@ -58,13 +91,6 @@ Security/YAMLLoad:
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
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:
|
||||
@@ -79,16 +105,8 @@ Style/Documentation:
|
||||
- !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:
|
||||
@@ -96,18 +114,10 @@ Style/HashSyntax:
|
||||
Severity: error
|
||||
Style/IfUnlessModifier:
|
||||
Enabled: false
|
||||
Style/IndentArray:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentHash:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentationWidth:
|
||||
Severity: error
|
||||
Style/InverseMethods:
|
||||
Enabled: false
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineOperationIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineTernaryOperator:
|
||||
Severity: error
|
||||
Style/PercentLiteralDelimiters:
|
||||
@@ -131,14 +141,12 @@ 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/SymbolArray:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInLiteral:
|
||||
EnforcedStyleForMultiline: consistent_comma
|
||||
Style/UnneededCapitalW:
|
||||
|
||||
14
.travis.yml
14
.travis.yml
@@ -5,9 +5,10 @@ language: ruby
|
||||
sudo: false
|
||||
|
||||
rvm:
|
||||
- &ruby1 2.3.3
|
||||
- &ruby2 2.2.6
|
||||
- &ruby3 2.1.9
|
||||
- &ruby1 2.4.1
|
||||
- &ruby2 2.3.4
|
||||
- &ruby3 2.2.7
|
||||
- &ruby4 2.1.10
|
||||
- &jruby jruby-9.1.7.0
|
||||
|
||||
matrix:
|
||||
@@ -16,6 +17,8 @@ matrix:
|
||||
env: TEST_SUITE=fmt
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=default-site
|
||||
- rvm: *ruby1
|
||||
env: ROUGE_VERSION=1.11.1 # runs everything with this version
|
||||
exclude:
|
||||
- rvm: *jruby
|
||||
env: TEST_SUITE=cucumber
|
||||
@@ -28,7 +31,7 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- 3.4-stable*
|
||||
- /*-stable/
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
@@ -49,3 +52,6 @@ addons:
|
||||
# regular test configuration
|
||||
after_success:
|
||||
- bundle exec codeclimate-test-reporter
|
||||
|
||||
before_install:
|
||||
- gem update --system
|
||||
|
||||
12
Gemfile
12
Gemfile
@@ -22,11 +22,13 @@ group :test do
|
||||
gem "cucumber", "~> 2.1"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
gem "nokogiri"
|
||||
# nokogiri v1.8 does not work with ruby 2.1 and below
|
||||
gem "nokogiri", RUBY_VERSION >= "2.2" ? "~> 1.7" : "~> 1.7.0"
|
||||
gem "rspec"
|
||||
gem "rspec-mocks"
|
||||
gem "rubocop", "~> 0.47"
|
||||
gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
|
||||
gem "rubocop", "~> 0.49.1"
|
||||
gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__)
|
||||
gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__)
|
||||
|
||||
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
|
||||
end
|
||||
@@ -51,6 +53,7 @@ end
|
||||
group :benchmark do
|
||||
if ENV["BENCHMARK"]
|
||||
gem "benchmark-ips"
|
||||
gem "benchmark-memory"
|
||||
gem "rbtrace"
|
||||
gem "ruby-prof"
|
||||
gem "stackprof"
|
||||
@@ -63,7 +66,7 @@ group :jekyll_optional_dependencies do
|
||||
gem "coderay", "~> 1.1.0"
|
||||
gem "jekyll-coffeescript"
|
||||
gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"]
|
||||
gem "jekyll-feed"
|
||||
gem "jekyll-feed", "~> 0.9"
|
||||
gem "jekyll-gist"
|
||||
gem "jekyll-paginate"
|
||||
gem "jekyll-redirect-from"
|
||||
@@ -78,6 +81,7 @@ group :jekyll_optional_dependencies do
|
||||
gem "pygments.rb", "~> 0.6.0"
|
||||
gem "rdiscount", "~> 2.0"
|
||||
gem "redcarpet", "~> 3.2", ">= 3.2.3"
|
||||
gem "yajl-ruby", "~> 1.2"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
|
||||
217
History.markdown
217
History.markdown
@@ -1,8 +1,214 @@
|
||||
## HEAD
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Strip unnecessary leading whitespace in template (#6228)
|
||||
* Users should be installing patch versions. (#6198)
|
||||
* fix tests (#6240)
|
||||
* Define path with __dir__ (#6087)
|
||||
* exit site.process sooner (#6239)
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Ignore final newline in folded YAML string (#6054)
|
||||
* Add URL checks to Doctor (#5760)
|
||||
* Fix serving files that clash with directories (#6222) (#6231)
|
||||
* Bump supported Ruby version to `>= 2.1.0` (#6220)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Deprecator`: fix typo for `--serve` command (#6229)
|
||||
* `Reader#read_directories`: guard against an entry not being a directory (#6226)
|
||||
* kramdown: symbolize keys in-place (#6247)
|
||||
* Call to_s on site.url before attempting to concatenate strings (#6253)
|
||||
|
||||
### Documentation
|
||||
|
||||
* Fix a typo in `custom-404-page.md` (#6218)
|
||||
* Docs: fix links to issues in History.markdown (#6255)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Adding DevKit helpers (#6225)
|
||||
|
||||
## 3.5.1 / 2017-07-17
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Use Warn for deprecation messages (#6192)
|
||||
* site template: Use plugins key instead of gems (#6045)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Backward compatiblize URLFilters module (#6163)
|
||||
* Static files contain front matter default keys when `to_liquid`'d (#6162)
|
||||
* Always normalize the result of the `relative_url` filter (#6185)
|
||||
|
||||
### Documentation
|
||||
|
||||
* Update reference to trouble with OS X/macOS (#6139)
|
||||
* added BibSonomy plugin (#6143)
|
||||
* add plugins for multiple page pagination (#6055)
|
||||
* Update minimum Ruby version in installation.md (#6164)
|
||||
* [docs] Add information about finding a collection in `site.collections` (#6165)
|
||||
* Add `{% raw %}` to Liquid example on site (#6179)
|
||||
* Added improved Pug plugin - removed 404 Jade plugin (#6174)
|
||||
* Linking the link (#6210)
|
||||
* Small correction in documentation for includes (#6193)
|
||||
* Fix docs site page margin (#6214)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Add jekyll doctor to GitHub Issue Template (#6169)
|
||||
* Test with Ruby 2.4.1-1 on AppVeyor (#6176)
|
||||
* set minimum requirement for jekyll-feed (#6184)
|
||||
|
||||
## 3.5.0 / 2017-06-18
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Upgrade to Liquid v4 (#4362)
|
||||
* Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles (#5871)
|
||||
* Add support for Tab-Separated Values data files (`*.tsv`) (#5985)
|
||||
* Specify version constraint in subcommand error message. (#5974)
|
||||
* Add a template for custom 404 page (#5945)
|
||||
* Require `runtime_dependencies` of a Gem-based theme from its `.gemspec` file (#5914)
|
||||
* Don't raise an error if URL contains a colon (#5889)
|
||||
* Date filters should never raise an exception (#5722)
|
||||
* add `plugins` config key as replacement for `gems` (#5130)
|
||||
* create configuration from options only once in the boot process (#5487)
|
||||
* Add option to fail a build with front matter syntax errors (#5832)
|
||||
* Disable default layouts for documents with a `layout: none` declaration (#5933)
|
||||
* In `jekyll new`, make copied site template user-writable (#6072)
|
||||
* Add top-level `layout` liquid variable to Documents (#6073)
|
||||
* Address reading non-binary static files in themes (#5918)
|
||||
* Allow filters to sort & select based on subvalues (#5622)
|
||||
* Add strip_index filter (#6075)
|
||||
|
||||
### Documentation
|
||||
|
||||
* Install troubleshooting on Ubuntu (#5817)
|
||||
* Add Termux section on troubleshooting (#5837)
|
||||
* fix ial css classes in theme doc (#5876)
|
||||
* Update installation.md (#5880)
|
||||
* Update Aerobatic docs (#5883)
|
||||
* Add note to collections doc on hard-coded collections. (#5882)
|
||||
* Makes uri_escape template docs more specific. (#5887)
|
||||
* Remove duplicate footnote_nr from default config (#5891)
|
||||
* Fixed tutorial for publishing gem to include repo. (#5900)
|
||||
* update broken links (#5905)
|
||||
* Fix typo in contribution information (#5910)
|
||||
* update plugin repo URL to reflect repo move (#5916)
|
||||
* Update exclude array in configuration.md (#5947)
|
||||
* Fixed path in "Improve this page" link in Tutorials section (#5951)
|
||||
* Corrected permalink (#5949)
|
||||
* Included more details about adding defaults to static files (#5971)
|
||||
* Create buddyworks (#5962)
|
||||
* added (buddyworks) to ci list (#5965)
|
||||
* Add a tutorial on serving custom Error 404 page (#5946)
|
||||
* add custom 404 to tutorial navigation (#5978)
|
||||
* Add link to order of interpretation tutorial in Tutorials nav (#5952)
|
||||
* Document Jekyll's Philosophy (#5792)
|
||||
* Require Ruby > 2.1.0 (#5983)
|
||||
* Fix broken link (#5994)
|
||||
* Default options for script/proof (#5995)
|
||||
* Mention Bash on Ubuntu on Windows (#5960)
|
||||
* Document `--unpublished` flag introduced in 91e9ecf (#5959)
|
||||
* Update upgrading.md to mention usage of `bundle update` (#5604)
|
||||
* Fix missing quotation mark (#6002)
|
||||
* New tutorial: Convert an HTML site to Jekyll (#5881)
|
||||
* Revamp Permalink section (#5912)
|
||||
* Fixup tutorial on creating theme from existing HTML templates (#6006)
|
||||
* Standardise on "URLs" without apostrophe in docs (#6018)
|
||||
* Added txtpen in tutorial (#6021)
|
||||
* fix typo using past participle (#6026)
|
||||
* changed formatting to fit the style of the documentation (#6027)
|
||||
* doc fix typo word usage (#6028)
|
||||
* corrected reference to layout in index.md (#6032)
|
||||
* (Minor) Update MathJax CDN (#6013)
|
||||
* Add MvvmCross to samples (#6035)
|
||||
* Update travis-ci.md to correct procedure (#6043)
|
||||
* fix sentence in documentation (#6048)
|
||||
* rephrase a sentence in posts.md to be more direct (#6049)
|
||||
* Compress Website Sass output (#6009)
|
||||
* doc correct spelling error (#6050)
|
||||
* adjusted date-format in sitemap (#6053)
|
||||
* Typo fix (welcomed change -> welcome change). (#6070)
|
||||
* Fixed documentation inconsistency (#6068)
|
||||
* Add own plugin -> Jekyll Brand Social Wall (#6064)
|
||||
* Added plugin jekyll-analytics (#6042)
|
||||
* Use more precise language when explaining links (#6078)
|
||||
* Update plugins.md (#6088)
|
||||
* windows 10 tutorial (#6100)
|
||||
* Explain how to override theme styles (#6107)
|
||||
* updated Bash on Ubuntu on Windows link in tutorial (#6111)
|
||||
* Fix wording in `_docs/templates.md` links section (#6114)
|
||||
* Update windows.md (#6115)
|
||||
* Added windows to docs.yml (#6109)
|
||||
* Be more specific on what to upload (#6119)
|
||||
* Remove Blank Newlines from "Jekyll on Windows" Page (#6126)
|
||||
* Link the troubleshooting page in the quickstart page (#6134)
|
||||
* add documentation about the "pinned" label (#6147)
|
||||
* docs(JekyllOnWindows): Add a new Installation way (#6141)
|
||||
* corrected windows.md (#6149)
|
||||
* Refine documentation for Windows (#6153)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* [Rubocop] add missing comma (#5835)
|
||||
* Appease classifier-reborn (#5934)
|
||||
* Allow releases & development on `*-stable` branches (#5926)
|
||||
* Add script/backport-pr (#5925)
|
||||
* Prefer .yaml over .toml (#5966)
|
||||
* Fix Appveyor with DST-aware cucumber steps (#5961)
|
||||
* Use Rubocop v0.47.1 till we're ready for v0.48 (#5989)
|
||||
* Test against Ruby 2.4.0 (#5687)
|
||||
* rubocop: lib/jekyll/renderer.rb complexity fixes (#5052)
|
||||
* Use yajl-ruby 1.2.2 (now with 2.4 support) (#6007)
|
||||
* Bump Rubocop to v0.48 (#5997)
|
||||
* doc use example.com (#6031)
|
||||
* fix typo (#6040)
|
||||
* Fix CI (#6044)
|
||||
* Remove `ruby RUBY_VERSION` from generated Gemfile (#5803)
|
||||
* Test if hidden collections output a document with a future date (#6103)
|
||||
* Add test for uri_escape on reserved characters (#6086)
|
||||
* Allow you to specify the rouge version via an environment variable for testing (#6138)
|
||||
* Bump Rubocop to 0.49.1 (#6093)
|
||||
* Lock nokogiri to 1.7.x for Ruby 2.1 (#6140)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Corrected date for version 3.4.0 (#5842)
|
||||
* Add the correct year to the 3.4.0 release date (#5858)
|
||||
* Add documentation about order of interpretation (#5834)
|
||||
* Documentation on how to build navigation (#5698)
|
||||
* Navigation has been moved out from docs (#5927)
|
||||
* Make links in sidebar for current page more prominent (#5820)
|
||||
* Update normalize.css to v6.0.0 (#6008)
|
||||
* Docs: rename `gems` to `plugins` (#6082)
|
||||
* plugins -> gems (#6110)
|
||||
* Document difference between cgi_escape and uri_escape #5970 (#6081)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Exclude Gemfile by default (#5860)
|
||||
* Convertible#validate_permalink!: ensure the return value of data["permalink"] is a string before asking if it is empty (#5878)
|
||||
* Allow abbreviated post dates (#5920)
|
||||
* Remove dependency on include from default about.md (#5903)
|
||||
* Allow colons in `uri_escape` filter (#5957)
|
||||
* Re-surface missing public methods in `Jekyll::Document` (#5975)
|
||||
* absolute_url should not mangle URL if called more than once (#5789)
|
||||
* patch URLFilters to prevent `//` (#6058)
|
||||
* add test to ensure variables work in `where_exp` condition (#5315)
|
||||
* Read explicitly included dot-files in collections. (#6092)
|
||||
* Default `baseurl` to `nil` instead of empty string (#6137)
|
||||
* Filters#time helper: Duplicate time before calling #localtime. (#5996)
|
||||
|
||||
## 3.4.5 / 2017-06-30
|
||||
|
||||
* Backport #6185 for v3.4.x: Always normalize the result of the `relative_url` filter (#6186)
|
||||
|
||||
## 3.4.4 / 2016-06-17
|
||||
## 3.4.4 / 2017-06-17
|
||||
|
||||
* Backport #6137 for v3.4.x: Default `baseurl` to `nil` instead of empty string (#6146)
|
||||
|
||||
@@ -12,14 +218,13 @@
|
||||
|
||||
## 3.4.2 / 2017-03-09
|
||||
|
||||
* Backport #5871 for v3.4.x: Convert StaticFile liquid representation to
|
||||
a Drop & add front matter defaults support to StaticFiles (#5940)
|
||||
* Backport #5871 for v3.4.x: Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles (#5940)
|
||||
|
||||
## 3.4.1 / 2017-03-02
|
||||
|
||||
* Backport #5920 for v3.4.x: Allow abbreviated post dates (#5924)
|
||||
|
||||
## 3.4.0 / 2016-01-27
|
||||
## 3.4.0 / 2017-01-27
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
@@ -318,7 +523,7 @@
|
||||
* 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)
|
||||
* Adds `link` Liquid tag to make generation of URLs 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)
|
||||
@@ -1101,7 +1306,7 @@
|
||||
* Fix Rouge's RedCarpet plugin interface integration (#2951)
|
||||
* Remove `--watch` from the site template blog post since it defaults to watching in in 2.4.0 (#2922)
|
||||
* Fix code for media query mixin in site template (#2946)
|
||||
* Allow post URL's to have `.htm` extensions (#2925)
|
||||
* Allow post URLs to have `.htm` extensions (#2925)
|
||||
* `Utils.slugify`: Don't create new objects when gsubbing (#2997)
|
||||
* The jsonify filter should deep-convert to Liquid when given an Array. (#3032)
|
||||
* Apply `jsonify` filter to Hashes deeply and effectively (#3063)
|
||||
|
||||
@@ -22,9 +22,9 @@ Jekyll is a simple, blog-aware, static site generator perfect for personal, proj
|
||||
|
||||
Jekyll does what you tell it to do — no more, no less. It doesn't try to outsmart users by making bold assumptions, nor does it burden them with needless complexity and configuration. Put simply, Jekyll gets out of your way and allows you to concentrate on what truly matters: your content.
|
||||
|
||||
## Having trouble with OS X El Capitan?
|
||||
## Having trouble with OS X/macOS?
|
||||
|
||||
See: https://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
|
||||
See: https://jekyllrb.com/docs/troubleshooting/
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
4
Rakefile
4
Rakefile
@@ -4,7 +4,7 @@ require "rdoc"
|
||||
require "date"
|
||||
require "yaml"
|
||||
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
|
||||
$LOAD_PATH.unshift File.expand_path("lib", __dir__)
|
||||
require "jekyll/version"
|
||||
|
||||
Dir.glob("rake/**.rake").each { |f| import f }
|
||||
@@ -106,7 +106,7 @@ def siteify_file(file, overrides_front_matter = {})
|
||||
front_matter = {
|
||||
"title" => title,
|
||||
"permalink" => "/docs/#{slug}/",
|
||||
"note" => "This file is autogenerated. Edit /#{file} instead."
|
||||
"note" => "This file is autogenerated. Edit /#{file} instead.",
|
||||
}.merge(overrides_front_matter)
|
||||
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
|
||||
File.write("#{docs_folder}/_docs/#{slug}.md", contents)
|
||||
|
||||
14
appveyor.yml
14
appveyor.yml
@@ -16,15 +16,15 @@ install:
|
||||
environment:
|
||||
BUNDLE_WITHOUT: "benchmark:site:development"
|
||||
matrix:
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "cucumber"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "default-site"
|
||||
- RUBY_FOLDER_VER: "24-x64"
|
||||
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"
|
||||
|
||||
36
benchmark/reduce-vs-each-with-object
Executable file
36
benchmark/reduce-vs-each-with-object
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "benchmark/ips"
|
||||
require "benchmark/memory"
|
||||
|
||||
GC.disable
|
||||
|
||||
PERIOD = "."
|
||||
PROPERTY_AS_HASH = ["hello", "there_oh", "friends"]
|
||||
property = "hello.there_oh.friends"
|
||||
item = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
|
||||
|
||||
def candidate(property, item)
|
||||
property.to_s.split(".".freeze).each_with_object(item) do |attribute, memo|
|
||||
memo = memo[attribute]
|
||||
end
|
||||
end
|
||||
|
||||
def control(property, item)
|
||||
property.to_s.split(".").reduce(item) do |subvalue, attribute|
|
||||
subvalue[attribute]
|
||||
end
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("candidate") { candidate(property, item) }
|
||||
x.report("control") { control(property, item) }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
Benchmark.memory do |x|
|
||||
x.report("candidate") { candidate(property, item) }
|
||||
x.report("control") { control(property, item) }
|
||||
x.compare!
|
||||
end
|
||||
1
docs/.gitignore
vendored
1
docs/.gitignore
vendored
@@ -2,3 +2,4 @@ _site/
|
||||
*.swp
|
||||
pkg/
|
||||
test/
|
||||
.idea/
|
||||
@@ -1,5 +1,7 @@
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
sass:
|
||||
style: compressed
|
||||
|
||||
gauges_id: 503c5af6613f5d0f19000027
|
||||
google_analytics_id: UA-50755011-1
|
||||
@@ -32,6 +34,8 @@ collections:
|
||||
posts:
|
||||
permalink: /news/:year/:month/:day/:title/
|
||||
output: true
|
||||
tutorials:
|
||||
output: true
|
||||
|
||||
name: Jekyll • Simple, blog-aware, static sites
|
||||
description: Transform your plain text into static websites and blogs
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
- home
|
||||
- quickstart
|
||||
- installation
|
||||
- windows
|
||||
- usage
|
||||
- structure
|
||||
- configuration
|
||||
|
||||
11
docs/_data/tutorials.yml
Normal file
11
docs/_data/tutorials.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
- title: Tutorials
|
||||
tutorials:
|
||||
- home
|
||||
- navigation
|
||||
- orderofinterpretation
|
||||
- custom-404-page
|
||||
- convert-site-to-jekyll
|
||||
|
||||
#- title: Another section
|
||||
# tutorials:
|
||||
# - sample
|
||||
@@ -88,6 +88,6 @@ To enable Coffeescript in Jekyll 3.0 and up you must
|
||||
* Ensure that your `_config.yml` is up-to-date and includes the following:
|
||||
|
||||
```yaml
|
||||
gems:
|
||||
plugins:
|
||||
- jekyll-coffeescript
|
||||
```
|
||||
|
||||
@@ -89,18 +89,75 @@ choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.
|
||||
|
||||
## Configuring permalinks for collections {#permalinks}
|
||||
|
||||
You can customize the [Permalinks](../permalinks/) for your collection's documents by setting `permalink` property in the collection's configuration as follows:
|
||||
If you wish to specify a custom pattern for the URLs where your Collection pages
|
||||
will reside, you may do so with the [`permalink` property](../permalinks/):
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
my_collection:
|
||||
output: true
|
||||
permalink: /awesome/:path/:title.:output_ext
|
||||
permalink: /:collection/:name
|
||||
```
|
||||
|
||||
In this example, the collection documents will the have the URL of `awesome` followed by the path to the document and its file extension.
|
||||
### Examples
|
||||
|
||||
Collections have the following template variables available for permalinks:
|
||||
For a collection with the following source file structure,
|
||||
|
||||
```
|
||||
_my_collection/
|
||||
└── some_subdir
|
||||
└── some_doc.md
|
||||
```
|
||||
|
||||
each of the following `permalink` configurations will produce the document structure shown below it.
|
||||
|
||||
* **Default**
|
||||
Same as `permalink: /:collection/:path`.
|
||||
|
||||
```
|
||||
_site/
|
||||
├── my_collection
|
||||
│ └── some_subdir
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: pretty`
|
||||
Same as `permalink: /:collection/:path/`.
|
||||
|
||||
```
|
||||
_site/
|
||||
├── my_collection
|
||||
│ └── some_subdir
|
||||
│ └── some_doc
|
||||
│ └── index.html
|
||||
...
|
||||
```
|
||||
* `permalink: /doc/:path`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── doc
|
||||
│ └── some_subdir
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: /doc/:name`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── doc
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: /:name`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── some_doc.html
|
||||
...
|
||||
```
|
||||
|
||||
### Template Variables
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
@@ -113,7 +170,7 @@ Collections have the following template variables available for permalinks:
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>collection</code></p>
|
||||
<p><code>:collection</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Label of the containing collection.</p>
|
||||
@@ -121,7 +178,7 @@ Collections have the following template variables available for permalinks:
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>path</code></p>
|
||||
<p><code>:path</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Path to the document relative to the collection's directory.</p>
|
||||
@@ -129,7 +186,7 @@ Collections have the following template variables available for permalinks:
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>name</code></p>
|
||||
<p><code>:name</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's base filename, with every sequence of spaces
|
||||
@@ -138,7 +195,7 @@ Collections have the following template variables available for permalinks:
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>title</code></p>
|
||||
<p><code>:title</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's lowercase title (as defined in its <a href="/docs/frontmatter/">front matter</a>), with every sequence of spaces and non-alphanumeric characters replaced by a hyphen. If the document does not define a title in its <a href="/docs/frontmatter/">front matter</a>, this is equivalent to <code>name</code>.</p>
|
||||
@@ -146,92 +203,16 @@ Collections have the following template variables available for permalinks:
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>output_ext</code></p>
|
||||
<p><code>:output_ext</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Extension of the output file.</p>
|
||||
<p>Extension of the output file. (Included by default and usually unnecessary.)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
## Permalink examples for collections
|
||||
|
||||
Depending on how you declare the permalinks in your configuration file, the permalinks and paths get written differently in the `_site` folder. A few examples will help clarify the options.
|
||||
|
||||
Let's say your collection is called `apidocs` with `doc1.md` in your collection. `doc1.md` is grouped inside a folder called `mydocs`. Your project's source directory for the collection looks this:
|
||||
|
||||
```
|
||||
├── \_apidocs
|
||||
│ └── mydocs
|
||||
│ └── doc1.md
|
||||
```
|
||||
|
||||
Based on this scenario, here are a few permalink options.
|
||||
|
||||
**Permalink configuration 1**: [Nothing configured] <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── apidocs
|
||||
│ └── mydocs
|
||||
│ └── doc1.html
|
||||
```
|
||||
|
||||
**Permalink configuration 2**: `/:collection/:path/:title:output_ext` <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── apidocs
|
||||
│ └── mydocs
|
||||
│ └── doc1.html
|
||||
```
|
||||
|
||||
**Permalink configuration 3**: No collection permalinks configured, but `pretty` configured for pages/posts. <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── apidocs
|
||||
│ └── mydocs
|
||||
│ └── doc1
|
||||
│ └── index.html
|
||||
```
|
||||
|
||||
**Permalink configuration 4**: `/awesome/:path/:title.html` <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── awesome
|
||||
│ └── mydocs
|
||||
│ └── doc1.html
|
||||
```
|
||||
|
||||
**Permalink configuration 5**: `/awesome/:path/:title/` <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── awesome
|
||||
│ └── mydocs
|
||||
│ └── doc1
|
||||
│ └── index.html
|
||||
```
|
||||
|
||||
**Permalink configuration 6**: `/awesome/:title.html` <br/>
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── awesome
|
||||
│ └── doc1.html
|
||||
```
|
||||
|
||||
**Permalink configuration 7**: `:title.html`
|
||||
**Output**:
|
||||
|
||||
```
|
||||
├── doc1.html
|
||||
```
|
||||
|
||||
## Liquid Attributes
|
||||
|
||||
### Collections
|
||||
@@ -321,6 +302,17 @@ you specified in your `_config.yml` (if present) and the following information:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>A Hard-Coded Collection</h5>
|
||||
<p>In addition to any collections you create yourself, the
|
||||
<code>posts</code> collection is hard-coded into Jekyll. It exists whether
|
||||
you have a <code>_posts</code> directory or not. This is something to note
|
||||
when iterating through <code>site.collections</code> as you may need to
|
||||
filter it out.</p>
|
||||
<p>You may wish to use filters to find your collection:
|
||||
<code>{% raw %}{{ site.collections | where: "label", "myCollection" | first }}{% endraw %}</code></p>
|
||||
</div>
|
||||
|
||||
|
||||
### Documents
|
||||
|
||||
|
||||
@@ -305,6 +305,18 @@ class="flag">flags</code> (specified on the command-line) that control them.
|
||||
<p><code class="flag">--profile</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Strict Front Matter</strong></p>
|
||||
<p class="description">
|
||||
Cause a build to fail if there is a YAML syntax error in a page's front matter.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">strict_front_matter: BOOL</code></p>
|
||||
<p><code class="flag">--strict_front_matter</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -601,12 +613,13 @@ collections:
|
||||
output: true
|
||||
|
||||
# Handling Reading
|
||||
safe: false
|
||||
include: [".htaccess"]
|
||||
exclude: ["node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
|
||||
keep_files: [".git", ".svn"]
|
||||
encoding: "utf-8"
|
||||
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
|
||||
safe: false
|
||||
include: [".htaccess"]
|
||||
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
|
||||
keep_files: [".git", ".svn"]
|
||||
encoding: "utf-8"
|
||||
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
|
||||
strict_front_matter: false
|
||||
|
||||
# Filtering Content
|
||||
show_drafts: null
|
||||
@@ -616,7 +629,7 @@ unpublished: false
|
||||
|
||||
# Plugins
|
||||
whitelist: []
|
||||
gems: []
|
||||
plugins: []
|
||||
|
||||
# Conversion
|
||||
markdown: kramdown
|
||||
@@ -653,7 +666,6 @@ redcarpet:
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
footnote_nr: 1
|
||||
entity_output: as_char
|
||||
toc_levels: 1..6
|
||||
smart_quotes: lsquo,rsquo,ldquo,rdquo
|
||||
|
||||
62
docs/_docs/continuous-integration/buddyworks.md
Normal file
62
docs/_docs/continuous-integration/buddyworks.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: "BuddyWorks"
|
||||
---
|
||||
|
||||
[BuddyWorks][buddyworks-homepage] is a [Docker][docker-homepage]-based CI server that you can set up in 15-20 minutes to build, test, and deploy your Jekyll websites. It supports [GitHub][github-homepage], [Bitbucket][bitbucket-homepage], and [GitLab][gitlab-homepage] repositories, and can be installed on-premises or used in cloud. The following guide will show you how to set up a free environment to build and test your Jekyll project.
|
||||
|
||||
[buddyworks-homepage]: https://buddy.works
|
||||
[docker-homepage]: https://www.docker.com/
|
||||
[github-homepage]: https://github.com
|
||||
[bitbucket-homepage]: https://bitbucket.org/
|
||||
[gitlab-homepage]: https://gitlab.com
|
||||
|
||||
## 1. Getting started
|
||||
|
||||
1. Log in at [https://buddy.works](https://buddy.works) with your GitHub/Bitbucket account or email
|
||||
2. Choose your Git provider and select or push your Jekyll Project
|
||||
3. Create a new pipeline and set the trigger mode to 'On every push'
|
||||
4. Add and configure the Jekyll action and save the pipeline
|
||||
|
||||
## 2. How it works
|
||||
|
||||
Whenever you make a push to the selected branch, the Jekyll action runs `jekyll build` in an isolated [Jekyll Docker image][jekyll-docker-image]. The output is generated to the `/filesystem` directory, and can be further deployed to FTP/SFTP and IaaS services. You can add your own commands, install additional packages, attach services, and run Selenium tests, as well as add other actions down the pipeline, eg. a Slack notification or an SSH script that will restart your server.
|
||||
|
||||

|
||||
|
||||
[jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/
|
||||
|
||||
## 3. Using YAML for configuration
|
||||
|
||||
If you prefer configuration as code over GUI, you can generate a `buddy.yml` that will create a pipeline with the Jekyll action once you push it to the target branch:
|
||||
|
||||
```ruby
|
||||
- pipeline: "Build and Deploy Jekyll site"
|
||||
trigger_mode: "ON_EVERY_PUSH"
|
||||
ref_name: "master"
|
||||
actions:
|
||||
- action: "Execute: jekyll build"
|
||||
type: "BUILD"
|
||||
docker_image_name: "jekyll/jekyll"
|
||||
docker_image_tag: "latest"
|
||||
execute_commands:
|
||||
- "chown jekyll:jekyll $WORKING_DIR"
|
||||
- "jekyll build"
|
||||
```
|
||||
|
||||
## 4. Setting up on-premises server
|
||||
|
||||
The self-hosted version of BuddyWorks can be installed on any type of server supporting Docker, including [Linux][bw-linux], [Mac][bw-mac], [AWS EC2][bw-aws-ec2], [DigitalOcean][bw-digitalocean], and [Microsoft Azure][bw-azure].
|
||||
|
||||
[bw-linux]: https://buddy.works/knowledge/standalone/installation-linux
|
||||
[bw-mac]: https://buddy.works/knowledge/standalone/installation-mac-osx
|
||||
[bw-aws-ec2]: https://buddy.works/knowledge/standalone/installation-amazon-ec2
|
||||
[bw-digitalocean]: https://buddy.works/knowledge/standalone/installation-digitalocean
|
||||
[bw-azure]: https://buddy.works/knowledge/standalone/installation-azure
|
||||
|
||||
## 5. Questions?
|
||||
|
||||
This entire guide is open-source. Go ahead and [edit it][jekyll-docs-ci-buddyworks] if you want to expand it or have a fix or [ask for help][jekyll-help] if you run into trouble and need assistance. BuddyWorks also has an [online community][buddyworks-forum] for help.
|
||||
|
||||
[jekyll-docs-ci-buddyworks]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/buddyworks.md
|
||||
[jekyll-help]: https://jekyllrb.com/help/
|
||||
[buddyworks-forum]: http://forum.buddy.works/
|
||||
@@ -7,3 +7,4 @@ Continuous Integration (CI) enables you to publish your Jekyll generated website
|
||||
|
||||
* [Travis CI](travis-ci)
|
||||
* [CircleCI](circleci)
|
||||
* [BuddyWorks](buddyworks)
|
||||
|
||||
@@ -15,10 +15,9 @@ Enabling Travis builds for your GitHub repository is pretty simple:
|
||||
|
||||
1. Go to your profile on travis-ci.org: https://travis-ci.org/profile/username
|
||||
2. Find the repository for which you're interested in enabling builds.
|
||||
3. Click the slider on the right so it says "ON" and is a dark grey.
|
||||
3. Flick the repository switch on so that it turns blue.
|
||||
4. Optionally configure the build by clicking on the gear icon. Further
|
||||
configuration happens in your `.travis.yml` file. More details on that
|
||||
below.
|
||||
configuration happens via your `.travis.yml` file. More details below.
|
||||
|
||||
## 2. The Test Script
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
|
||||
|
||||
* 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/).
|
||||
* Pull requests 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.
|
||||
|
||||
|
||||
@@ -70,6 +70,9 @@ You can now render the list of members in a template:
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
{: .note .info }
|
||||
If your Jekyll site has a lot of pages, such as with documentation websites, see the detailed examples in [how to build robust navigation for your site]({% link _tutorials/navigation.md %}).
|
||||
|
||||
## Example: Organizations
|
||||
|
||||
Data files can also be placed in sub-folders of the `_data` folder. Each folder
|
||||
@@ -149,3 +152,5 @@ author: dave
|
||||
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see [Navigation](/tutorials/navigation).
|
||||
|
||||
@@ -7,7 +7,7 @@ Sites built using Jekyll can be deployed in a large number of ways due to the st
|
||||
|
||||
## Web hosting providers (FTP)
|
||||
|
||||
Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll build` command and copy the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
|
||||
Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll build` command and copy the contents of the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
|
||||
|
||||
## Self-managed web server
|
||||
|
||||
@@ -78,7 +78,7 @@ Another way to deploy your Jekyll site is to use [Rake](https://github.com/ruby/
|
||||
|
||||
### scp
|
||||
|
||||
Once you’ve generated the `_site` directory, you can easily scp it using a
|
||||
Once you’ve generated the `_site` directory, you can easily scp its content using a
|
||||
`tasks/deploy` shell script similar to [this deploy script][]. You’d obviously
|
||||
need to change the values to reflect your site’s details. There is even [a
|
||||
matching TextMate command][] that will help you run this script.
|
||||
@@ -89,7 +89,7 @@ matching TextMate command][] that will help you run this script.
|
||||
|
||||
### rsync
|
||||
|
||||
Once you’ve generated the `_site` directory, you can easily rsync it using a `tasks/deploy` shell script similar to [this deploy script here](https://github.com/vitalyrepin/vrepinblog/blob/master/transfer.sh). You’d obviously need to change the values to reflect your site’s details.
|
||||
Once you’ve generated the `_site` directory, you can easily rsync its content using a `tasks/deploy` shell script similar to [this deploy script here](https://github.com/vitalyrepin/vrepinblog/blob/master/transfer.sh). You’d obviously need to change the values to reflect your site’s details.
|
||||
|
||||
Certificate-based authorization is another way to simplify the publishing
|
||||
process. It makes sense to restrict rsync access only to the directory which it is supposed to sync. This can be done using rrsync.
|
||||
@@ -203,6 +203,6 @@ Setting up Kickster is very easy, just install the gem and you are good to go. M
|
||||
|
||||
## Aerobatic
|
||||
|
||||
[Aerobatic](https://www.aerobatic.com) is an add-on for Bitbucket that brings GitHub Pages style functionality to Bitbucket users. It includes continuous deployment, custom domains with a wildcard SSL cert, CDN, basic auth, and staging branches all in the box.
|
||||
[Aerobatic](https://www.aerobatic.com) has custom domains, global CDN distribution, basic auth, CORS proxying, and a growing list of plugins all included.
|
||||
|
||||
Automating the build and deployment of a Jekyll site is just as simple as GitHub Pages - push your changes to your repo (excluding the `_site` directory) and within seconds a build will be triggered and your built site deployed to our highly- available, globally distributed hosting service. The build process will even install and execute custom Ruby plugins. See our [Jekyll docs](https://www.aerobatic.com/docs/static-generators#jekyll) for more details.
|
||||
Automating the deployment of a Jekyll site is simple. See our [Jekyll docs](https://www.aerobatic.com/docs/static-site-generators/#jekyll) for more details. Your built `_site` folder is deployed to our highly-available, globally distributed hosting service.
|
||||
|
||||
@@ -6,12 +6,22 @@ permalink: /docs/extras/
|
||||
There are a number of (optional) extra features that Jekyll supports that you
|
||||
may want to install, depending on how you plan to use Jekyll.
|
||||
|
||||
## Web Highlights and Commenting
|
||||
|
||||
Register your site with [txtpen](https://txtpen.com). Then append
|
||||
|
||||
```html
|
||||
<script src="https://txtpen.com/embed.js?site=<your site name>"></script>
|
||||
```
|
||||
|
||||
to your template files in `/_layout` folder.
|
||||
|
||||
## Math Support
|
||||
|
||||
Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](https://www.mathjax.org) within math blocks. See the Kramdown documentation on [math blocks](http://kramdown.gettalong.org/syntax.html#math-blocks) and [math support](http://kramdown.gettalong.org/converter/html.html#math-support) for more details. MathJax requires you to include JavaScript or CSS to render the LaTeX, e.g.
|
||||
|
||||
```html
|
||||
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/visually-enforced/opinion/2014/02/16/Mathjax-with-jekyll/).
|
||||
|
||||
@@ -99,6 +99,14 @@ front matter of a page or post.
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note">
|
||||
<h5>ProTip™: Render Posts Marked As Unpublished</h5>
|
||||
<p>
|
||||
To preview unpublished pages, simply run `jekyll serve` or `jekyll build`
|
||||
with the `--unpublished` switch. Jekyll also has a handy <a href="../drafts/">drafts</a>
|
||||
feature tailored specifically for blog posts.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Custom Variables
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ This guide will teach you what you need to know about Git, GitHub, and Jekyll to
|
||||
|
||||
Sometimes it's nice to preview your Jekyll site before you push your `gh-pages`
|
||||
branch to GitHub. However, the subdirectory-like URL structure GitHub uses for
|
||||
Project Pages complicates the proper resolution of URLs. In order to assure your site builds properly, use `site.github.url` in your URL's.
|
||||
Project Pages complicates the proper resolution of URLs. In order to assure your site builds properly, use `site.github.url` in your URLs.
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
<!-- Useful for styles with static names... -->
|
||||
<link href="{{ site.github.url }}/path/to/css.css" rel="stylesheet">
|
||||
<!-- and for documents/pages whose URL's can change... -->
|
||||
<!-- and for documents/pages whose URLs can change... -->
|
||||
[{{ page.title }}]("{{ page.url | prepend: site.github.url }}")
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
@@ -4,6 +4,202 @@ permalink: "/docs/history/"
|
||||
note: This file is autogenerated. Edit /History.markdown instead.
|
||||
---
|
||||
|
||||
## 3.5.1 / 2017-07-17
|
||||
{: #v3-5-1}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v3-5-1}
|
||||
|
||||
- Use Warn for deprecation messages ([#6192]({{ site.repository }}/issues/6192))
|
||||
- site template: Use plugins key instead of gems ([#6045]({{ site.repository }}/issues/6045))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-5-1}
|
||||
|
||||
- Backward compatiblize URLFilters module ([#6163]({{ site.repository }}/issues/6163))
|
||||
- Static files contain front matter default keys when `to_liquid`'d ([#6162]({{ site.repository }}/issues/6162))
|
||||
- Always normalize the result of the `relative_url` filter ([#6185]({{ site.repository }}/issues/6185))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Update reference to trouble with OS X/macOS ([#6139]({{ site.repository }}/issues/6139))
|
||||
- added BibSonomy plugin ([#6143]({{ site.repository }}/issues/6143))
|
||||
- add plugins for multiple page pagination ([#6055]({{ site.repository }}/issues/6055))
|
||||
- Update minimum Ruby version in installation.md ([#6164]({{ site.repository }}/issues/6164))
|
||||
- [docs] Add information about finding a collection in `site.collections` ([#6165]({{ site.repository }}/issues/6165))
|
||||
- Add {%raw%} to Liquid example on site ([#6179]({{ site.repository }}/issues/6179))
|
||||
- Added improved Pug plugin - removed 404 Jade plugin ([#6174]({{ site.repository }}/issues/6174))
|
||||
- Linking the link ([#6210]({{ site.repository }}/issues/6210))
|
||||
- Small correction in documentation for includes ([#6193]({{ site.repository }}/issues/6193))
|
||||
- Fix docs site page margin ([#6214]({{ site.repository }}/issues/6214))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-5-1}
|
||||
|
||||
- Add jekyll doctor to GitHub Issue Template ([#6169]({{ site.repository }}/issues/6169))
|
||||
- Test with Ruby 2.4.1-1 on AppVeyor ([#6176]({{ site.repository }}/issues/6176))
|
||||
- set minimum requirement for jekyll-feed ([#6184]({{ site.repository }}/issues/6184))
|
||||
|
||||
|
||||
## 3.5.0 / 2017-06-18
|
||||
{: #v3-5-0}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v3-5-0}
|
||||
|
||||
- Upgrade to Liquid v4 ([#4362]({{ site.repository }}/issues/4362))
|
||||
- Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles ([#5871]({{ site.repository }}/issues/5871))
|
||||
- Add support for Tab-Separated Values data files (`*.tsv`) ([#5985]({{ site.repository }}/issues/5985))
|
||||
- Specify version constraint in subcommand error message. ([#5974]({{ site.repository }}/issues/5974))
|
||||
- Add a template for custom 404 page ([#5945]({{ site.repository }}/issues/5945))
|
||||
- Require `runtime_dependencies` of a Gem-based theme from its `.gemspec` file ([#5914]({{ site.repository }}/issues/5914))
|
||||
- Don't raise an error if URL contains a colon ([#5889]({{ site.repository }}/issues/5889))
|
||||
- Date filters should never raise an exception ([#5722]({{ site.repository }}/issues/5722))
|
||||
- add `plugins` config key as replacement for `gems` ([#5130]({{ site.repository }}/issues/5130))
|
||||
- create configuration from options only once in the boot process ([#5487]({{ site.repository }}/issues/5487))
|
||||
- Add option to fail a build with front matter syntax errors ([#5832]({{ site.repository }}/issues/5832))
|
||||
- Disable default layouts for documents with a `layout: none` declaration ([#5933]({{ site.repository }}/issues/5933))
|
||||
- In `jekyll new`, make copied site template user-writable ([#6072]({{ site.repository }}/issues/6072))
|
||||
- Add top-level `layout` liquid variable to Documents ([#6073]({{ site.repository }}/issues/6073))
|
||||
- Address reading non-binary static files in themes ([#5918]({{ site.repository }}/issues/5918))
|
||||
- Allow filters to sort & select based on subvalues ([#5622]({{ site.repository }}/issues/5622))
|
||||
- Add strip_index filter ([#6075]({{ site.repository }}/issues/6075))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Install troubleshooting on Ubuntu ([#5817]({{ site.repository }}/issues/5817))
|
||||
- Add Termux section on troubleshooting ([#5837]({{ site.repository }}/issues/5837))
|
||||
- fix ial css classes in theme doc ([#5876]({{ site.repository }}/issues/5876))
|
||||
- Update installation.md ([#5880]({{ site.repository }}/issues/5880))
|
||||
- Update Aerobatic docs ([#5883]({{ site.repository }}/issues/5883))
|
||||
- Add note to collections doc on hard-coded collections. ([#5882]({{ site.repository }}/issues/5882))
|
||||
- Makes uri_escape template docs more specific. ([#5887]({{ site.repository }}/issues/5887))
|
||||
- Remove duplicate footnote_nr from default config ([#5891]({{ site.repository }}/issues/5891))
|
||||
- Fixed tutorial for publishing gem to include repo. ([#5900]({{ site.repository }}/issues/5900))
|
||||
- update broken links ([#5905]({{ site.repository }}/issues/5905))
|
||||
- Fix typo in contribution information ([#5910]({{ site.repository }}/issues/5910))
|
||||
- update plugin repo URL to reflect repo move ([#5916]({{ site.repository }}/issues/5916))
|
||||
- Update exclude array in configuration.md ([#5947]({{ site.repository }}/issues/5947))
|
||||
- Fixed path in "Improve this page" link in Tutorials section ([#5951]({{ site.repository }}/issues/5951))
|
||||
- Corrected permalink ([#5949]({{ site.repository }}/issues/5949))
|
||||
- Included more details about adding defaults to static files ([#5971]({{ site.repository }}/issues/5971))
|
||||
- Create buddyworks ([#5962]({{ site.repository }}/issues/5962))
|
||||
- added (buddyworks) to ci list ([#5965]({{ site.repository }}/issues/5965))
|
||||
- Add a tutorial on serving custom Error 404 page ([#5946]({{ site.repository }}/issues/5946))
|
||||
- add custom 404 to tutorial navigation ([#5978]({{ site.repository }}/issues/5978))
|
||||
- Add link to order of interpretation tutorial in Tutorials nav ([#5952]({{ site.repository }}/issues/5952))
|
||||
- Document Jekyll's Philosophy ([#5792]({{ site.repository }}/issues/5792))
|
||||
- Require Ruby > 2.1.0 ([#5983]({{ site.repository }}/issues/5983))
|
||||
- Fix broken link ([#5994]({{ site.repository }}/issues/5994))
|
||||
- Default options for script/proof ([#5995]({{ site.repository }}/issues/5995))
|
||||
- Mention Bash on Ubuntu on Windows ([#5960]({{ site.repository }}/issues/5960))
|
||||
- Document `--unpublished` flag introduced in 91e9ecf ([#5959]({{ site.repository }}/issues/5959))
|
||||
- Update upgrading.md to mention usage of `bundle update` ([#5604]({{ site.repository }}/issues/5604))
|
||||
- Fix missing quotation mark ([#6002]({{ site.repository }}/issues/6002))
|
||||
- New tutorial: Convert an HTML site to Jekyll ([#5881]({{ site.repository }}/issues/5881))
|
||||
- Revamp Permalink section ([#5912]({{ site.repository }}/issues/5912))
|
||||
- Fixup tutorial on creating theme from existing HTML templates ([#6006]({{ site.repository }}/issues/6006))
|
||||
- Standardise on "URLs" without apostrophe in docs ([#6018]({{ site.repository }}/issues/6018))
|
||||
- Added txtpen in tutorial ([#6021]({{ site.repository }}/issues/6021))
|
||||
- fix typo using past participle ([#6026]({{ site.repository }}/issues/6026))
|
||||
- changed formatting to fit the style of the documentation ([#6027]({{ site.repository }}/issues/6027))
|
||||
- doc fix typo word usage ([#6028]({{ site.repository }}/issues/6028))
|
||||
- corrected reference to layout in index.md ([#6032]({{ site.repository }}/issues/6032))
|
||||
- (Minor) Update MathJax CDN ([#6013]({{ site.repository }}/issues/6013))
|
||||
- Add MvvmCross to samples ([#6035]({{ site.repository }}/issues/6035))
|
||||
- Update travis-ci.md to correct procedure ([#6043]({{ site.repository }}/issues/6043))
|
||||
- fix sentence in documentation ([#6048]({{ site.repository }}/issues/6048))
|
||||
- rephrase a sentence in posts.md to be more direct ([#6049]({{ site.repository }}/issues/6049))
|
||||
- Compress Website Sass output ([#6009]({{ site.repository }}/issues/6009))
|
||||
- doc correct spelling error ([#6050]({{ site.repository }}/issues/6050))
|
||||
- adjusted date-format in sitemap ([#6053]({{ site.repository }}/issues/6053))
|
||||
- Typo fix (welcomed change -> welcome change). ([#6070]({{ site.repository }}/issues/6070))
|
||||
- Fixed documentation inconsistency ([#6068]({{ site.repository }}/issues/6068))
|
||||
- Add own plugin -> Jekyll Brand Social Wall ([#6064]({{ site.repository }}/issues/6064))
|
||||
- Added plugin jekyll-analytics ([#6042]({{ site.repository }}/issues/6042))
|
||||
- Use more precise language when explaining links ([#6078]({{ site.repository }}/issues/6078))
|
||||
- Update plugins.md ([#6088]({{ site.repository }}/issues/6088))
|
||||
- windows 10 tutorial ([#6100]({{ site.repository }}/issues/6100))
|
||||
- Explain how to override theme styles ([#6107]({{ site.repository }}/issues/6107))
|
||||
- updated Bash on Ubuntu on Windows link in tutorial ([#6111]({{ site.repository }}/issues/6111))
|
||||
- Fix wording in `_docs/templates.md` links section ([#6114]({{ site.repository }}/issues/6114))
|
||||
- Update windows.md ([#6115]({{ site.repository }}/issues/6115))
|
||||
- Added windows to docs.yml ([#6109]({{ site.repository }}/issues/6109))
|
||||
- Be more specific on what to upload ([#6119]({{ site.repository }}/issues/6119))
|
||||
- Remove Blank Newlines from "Jekyll on Windows" Page ([#6126]({{ site.repository }}/issues/6126))
|
||||
- Link the troubleshooting page in the quickstart page ([#6134]({{ site.repository }}/issues/6134))
|
||||
- add documentation about the &[#34]({{ site.repository }}/issues/34);pinned&[#34]({{ site.repository }}/issues/34); label ([#6147]({{ site.repository }}/issues/6147))
|
||||
- docs(JekyllOnWindows): Add a new Installation way ([#6141]({{ site.repository }}/issues/6141))
|
||||
- corrected windows.md ([#6149]({{ site.repository }}/issues/6149))
|
||||
- Refine documentation for Windows ([#6153]({{ site.repository }}/issues/6153))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-5-0}
|
||||
|
||||
- [Rubocop] add missing comma ([#5835]({{ site.repository }}/issues/5835))
|
||||
- Appease classifier-reborn ([#5934]({{ site.repository }}/issues/5934))
|
||||
- Allow releases & development on `*-stable` branches ([#5926]({{ site.repository }}/issues/5926))
|
||||
- Add script/backport-pr ([#5925]({{ site.repository }}/issues/5925))
|
||||
- Prefer .yaml over .toml ([#5966]({{ site.repository }}/issues/5966))
|
||||
- Fix Appveyor with DST-aware cucumber steps ([#5961]({{ site.repository }}/issues/5961))
|
||||
- Use Rubocop v0.47.1 till we're ready for v0.48 ([#5989]({{ site.repository }}/issues/5989))
|
||||
- Test against Ruby 2.4.0 ([#5687]({{ site.repository }}/issues/5687))
|
||||
- rubocop: lib/jekyll/renderer.rb complexity fixes ([#5052]({{ site.repository }}/issues/5052))
|
||||
- Use yajl-ruby 1.2.2 (now with 2.4 support) ([#6007]({{ site.repository }}/issues/6007))
|
||||
- Bump Rubocop to v0.48 ([#5997]({{ site.repository }}/issues/5997))
|
||||
- doc use example.com ([#6031]({{ site.repository }}/issues/6031))
|
||||
- fix typo ([#6040]({{ site.repository }}/issues/6040))
|
||||
- Fix CI ([#6044]({{ site.repository }}/issues/6044))
|
||||
- Remove `ruby RUBY_VERSION` from generated Gemfile ([#5803]({{ site.repository }}/issues/5803))
|
||||
- Test if hidden collections output a document with a future date ([#6103]({{ site.repository }}/issues/6103))
|
||||
- Add test for uri_escape on reserved characters ([#6086]({{ site.repository }}/issues/6086))
|
||||
- Allow you to specify the rouge version via an environment variable for testing ([#6138]({{ site.repository }}/issues/6138))
|
||||
- Bump Rubocop to 0.49.1 ([#6093]({{ site.repository }}/issues/6093))
|
||||
- Lock nokogiri to 1.7.x for Ruby 2.1 ([#6140]({{ site.repository }}/issues/6140))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v3-5-0}
|
||||
|
||||
- Corrected date for version 3.4.0 ([#5842]({{ site.repository }}/issues/5842))
|
||||
- Add the correct year to the 3.4.0 release date ([#5858]({{ site.repository }}/issues/5858))
|
||||
- Add documentation about order of interpretation ([#5834]({{ site.repository }}/issues/5834))
|
||||
- Documentation on how to build navigation ([#5698]({{ site.repository }}/issues/5698))
|
||||
- Navigation has been moved out from docs ([#5927]({{ site.repository }}/issues/5927))
|
||||
- Make links in sidebar for current page more prominent ([#5820]({{ site.repository }}/issues/5820))
|
||||
- Update normalize.css to v6.0.0 ([#6008]({{ site.repository }}/issues/6008))
|
||||
- Docs: rename `gems` to `plugins` ([#6082]({{ site.repository }}/issues/6082))
|
||||
- plugins -> gems ([#6110]({{ site.repository }}/issues/6110))
|
||||
- Document difference between cgi_escape and uri_escape [#5970]({{ site.repository }}/issues/5970) ([#6081]({{ site.repository }}/issues/6081))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-5-0}
|
||||
|
||||
- Exclude Gemfile by default ([#5860]({{ site.repository }}/issues/5860))
|
||||
- Convertible#validate_permalink!: ensure the return value of data["permalink"] is a string before asking if it is empty ([#5878]({{ site.repository }}/issues/5878))
|
||||
- Allow abbreviated post dates ([#5920]({{ site.repository }}/issues/5920))
|
||||
- Remove dependency on include from default about.md ([#5903]({{ site.repository }}/issues/5903))
|
||||
- Allow colons in `uri_escape` filter ([#5957]({{ site.repository }}/issues/5957))
|
||||
- Re-surface missing public methods in `Jekyll::Document` ([#5975]({{ site.repository }}/issues/5975))
|
||||
- absolute_url should not mangle URL if called more than once ([#5789]({{ site.repository }}/issues/5789))
|
||||
- patch URLFilters to prevent `//` ([#6058]({{ site.repository }}/issues/6058))
|
||||
- add test to ensure variables work in `where_exp` condition ([#5315]({{ site.repository }}/issues/5315))
|
||||
- Read explicitly included dot-files in collections. ([#6092]({{ site.repository }}/issues/6092))
|
||||
- Default `baseurl` to `nil` instead of empty string ([#6137]({{ site.repository }}/issues/6137))
|
||||
- Filters#time helper: Duplicate time before calling #localtime. ([#5996]({{ site.repository }}/issues/5996))
|
||||
|
||||
|
||||
## 3.4.5 / 2017-06-30
|
||||
{: #v3-4-5}
|
||||
|
||||
- Backport [#6185]({{ site.repository }}/issues/6185) for v3.4.x: Always normalize the result of the `relative_url` filter ([#6186]({{ site.repository }}/issues/6186))
|
||||
|
||||
|
||||
## 3.4.4 / 2017-06-17
|
||||
{: #v3-4-4}
|
||||
|
||||
- Backport [#6137]({{ site.repository }}/issues/6137) for v3.4.x: Default `baseurl` to `nil` instead of empty string ([#6146]({{ site.repository }}/issues/6146))
|
||||
|
||||
|
||||
## 3.4.3 / 2017-03-21
|
||||
{: #v3-4-3}
|
||||
|
||||
@@ -13,8 +209,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
|
||||
## 3.4.2 / 2017-03-09
|
||||
{: #v3-4-2}
|
||||
|
||||
- Backport [#5871]({{ site.repository }}/issues/5871) for v3.4.x: Convert StaticFile liquid representation to
|
||||
a Drop & add front matter defaults support to StaticFiles ([#5940]({{ site.repository }}/issues/5940))
|
||||
- Backport [#5871]({{ site.repository }}/issues/5871) for v3.4.x: Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles ([#5940]({{ site.repository }}/issues/5940))
|
||||
|
||||
|
||||
## 3.4.1 / 2017-03-02
|
||||
@@ -23,7 +218,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
|
||||
- Backport [#5920]({{ site.repository }}/issues/5920) for v3.4.x: Allow abbreviated post dates ([#5924]({{ site.repository }}/issues/5924))
|
||||
|
||||
|
||||
## 3.4.0 / 2016-01-27
|
||||
## 3.4.0 / 2017-01-27
|
||||
{: #v3-4-0}
|
||||
|
||||
### Minor Enhancements
|
||||
@@ -347,7 +542,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
|
||||
- Add `show_dir_listing` option for serve command and fix index file names ([#4533]({{ site.repository }}/issues/4533))
|
||||
- Site Template: write a Gemfile which is educational to the new site ([#4542]({{ site.repository }}/issues/4542))
|
||||
- Site template: add explanation of site variables in the example `_config.yml` ([#4704]({{ site.repository }}/issues/4704))
|
||||
- Adds `link` Liquid tag to make generation of URL's easier ([#4624]({{ site.repository }}/issues/4624))
|
||||
- Adds `link` Liquid tag to make generation of URLs easier ([#4624]({{ site.repository }}/issues/4624))
|
||||
- Allow static files to be symlinked in unsafe mode or non-prod environments ([#4640]({{ site.repository }}/issues/4640))
|
||||
- Add `:after_init` hook & add `Site#config=` to make resetting config easy ([#4703]({{ site.repository }}/issues/4703))
|
||||
- DocumentDrop: add `#<=>` which sorts by date (falling back to path) ([#4741]({{ site.repository }}/issues/4741))
|
||||
@@ -1201,7 +1396,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
|
||||
- Fix Rouge's RedCarpet plugin interface integration ([#2951]({{ site.repository }}/issues/2951))
|
||||
- Remove `--watch` from the site template blog post since it defaults to watching in in 2.4.0 ([#2922]({{ site.repository }}/issues/2922))
|
||||
- Fix code for media query mixin in site template ([#2946]({{ site.repository }}/issues/2946))
|
||||
- Allow post URL's to have `.htm` extensions ([#2925]({{ site.repository }}/issues/2925))
|
||||
- Allow post URLs to have `.htm` extensions ([#2925]({{ site.repository }}/issues/2925))
|
||||
- `Utils.slugify`: Don't create new objects when gsubbing ([#2997]({{ site.repository }}/issues/2997))
|
||||
- The jsonify filter should deep-convert to Liquid when given an Array. ([#3032]({{ site.repository }}/issues/3032))
|
||||
- Apply `jsonify` filter to Hashes deeply and effectively ([#3063]({{ site.repository }}/issues/3063))
|
||||
|
||||
@@ -151,7 +151,7 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p
|
||||
In the `_includes` folder, assume you have a file called `spotlight.html` with this code:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% for person in {{ include.participants }} %}
|
||||
{% raw %}{% for person in include.participants %}
|
||||
{% if person.login_age == "new" %}
|
||||
{{ person.name }}
|
||||
{% endif %}
|
||||
@@ -164,4 +164,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f
|
||||
{% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %}
|
||||
```
|
||||
|
||||
In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`.
|
||||
In this instance, `site.data.profiles` gets inserted in place of {% raw %}`include.participants`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`.
|
||||
|
||||
@@ -10,22 +10,33 @@ encountered and how we might make the process easier.
|
||||
|
||||
### Requirements
|
||||
|
||||
Installing Jekyll is easy and straight-forward, but there are a few
|
||||
requirements you’ll need to make sure your system has before you start.
|
||||
Installing Jekyll should be straight-forward if all requirements are met.
|
||||
Before you start, make sure your system has the following:
|
||||
|
||||
- [Ruby](https://www.ruby-lang.org/en/downloads/) (including development
|
||||
headers, v1.9.3 or above for Jekyll 2 and v2 or above for Jekyll 3)
|
||||
- GNU/Linux, Unix, or macOS
|
||||
- [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.1 or above, including all development
|
||||
headers
|
||||
- [RubyGems](https://rubygems.org/pages/download)
|
||||
- Linux, Unix, or macOS
|
||||
- [NodeJS](https://nodejs.org/), or another JavaScript runtime (Jekyll 2 and
|
||||
earlier, for CoffeeScript support).
|
||||
- [Python 2.7](https://www.python.org/downloads/) (for Jekyll 2 and earlier)
|
||||
- [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v` and `make -v` in your system's command line interface)
|
||||
|
||||
#### Only required for Jekyll 2 and earlier
|
||||
|
||||
- [NodeJS](https://nodejs.org/), or another JavaScript runtime (for CoffeeScript support).
|
||||
- [Python 2.7](https://www.python.org/downloads/)
|
||||
|
||||
<div class="note info">
|
||||
<h5>Problems installing Jekyll?</h5>
|
||||
<p>
|
||||
Check out the <a href="../troubleshooting/">troubleshooting</a> page or
|
||||
<a href="{{ site.repository }}/issues/new">report an issue</a> so the
|
||||
Jekyll community can improve the experience for everyone.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>Running Jekyll on Windows</h5>
|
||||
<p>
|
||||
While Windows is not officially supported, it is possible to get it running
|
||||
While Windows is not officially supported, it is possible to get Jekyll running
|
||||
on Windows. Special instructions can be found on our
|
||||
<a href="../windows/#installation">Windows-specific docs page</a>.
|
||||
</p>
|
||||
@@ -42,10 +53,7 @@ $ gem install jekyll
|
||||
```
|
||||
|
||||
All of Jekyll’s gem dependencies are automatically installed by the above
|
||||
command, so you won’t have to worry about them at all. If you have problems
|
||||
installing Jekyll, check out the [troubleshooting](../troubleshooting/) page or
|
||||
[report an issue]({{ site.repository }}/issues/new) so the Jekyll
|
||||
community can improve the experience for everyone.
|
||||
command, so you won’t have to worry about them at all.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Installing Xcode Command-Line Tools</h5>
|
||||
|
||||
@@ -18,3 +18,7 @@ These labels are used to indicate that the Git state of a pull request must chan
|
||||
## `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/#staleness-and-automatic-closure).
|
||||
|
||||
## `pinned`
|
||||
|
||||
This label is for @jekyllbot to ignore the age of the issue, which means that the `stale` label won't be automatically added, and the issue won't be closed after a while. This needs to be set manually, and should be set with care. (The `has-pull-request` label does the same thing, but shouldn't be used to _only_ keep an issue open)
|
||||
|
||||
@@ -51,4 +51,4 @@ Is what they wanted to get something we want to happen? Sometimes a bug report i
|
||||
|
||||
### 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.
|
||||
@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. This behaviour can be suppressed by setting the [`pinned` label](../maintaining/special-labels.md/#pinned).
|
||||
|
||||
@@ -27,12 +27,12 @@ You have 3 options for installing plugins:
|
||||
1. In your site source root, make a `_plugins` directory. Place your plugins
|
||||
here. Any file ending in `*.rb` inside this directory will be loaded before
|
||||
Jekyll generates your site.
|
||||
2. In your `_config.yml` file, add a new array with the key `gems` and the
|
||||
2. In your `_config.yml` file, add a new array with the key `plugins` and the
|
||||
values of the gem names of the plugins you'd like to use. An example:
|
||||
|
||||
|
||||
gems: [jekyll-coffeescript, jekyll-watch, jekyll-assets]
|
||||
# This will require each of these gems automatically.
|
||||
plugins: [jekyll-coffeescript, jekyll-watch, jekyll-assets]
|
||||
# This will require each of these plugins automatically.
|
||||
|
||||
Then install your plugins using `gem install jekyll-coffeescript jekyll-watch jekyll-assets`
|
||||
|
||||
@@ -754,13 +754,13 @@ LESS.js files during generation.
|
||||
- [AMP-Jekyll by Juuso Mikkonen](https://github.com/juusaw/amp-jekyll): Generate [Accelerated Mobile Pages](https://www.ampproject.org) of Jekyll posts.
|
||||
- [Jekyll Art Gallery plugin](https://github.com/alexivkin/Jekyll-Art-Gallery-Plugin): An advanced art/photo gallery generation plugin for creating galleries from a set of image folders. Supports image tagging, thumbnails, sorting, image rotation, post-processing (remove EXIF, add watermark), multiple collections and much more.
|
||||
- [jekyll-ga](https://github.com/developmentseed/jekyll-ga): A Jekyll plugin that downloads Google Analytics data and adds it to posts. Useful for making a site that lists "most popular" content. [Read the introduction](https://developmentseed.org/blog/google-analytics-jekyll-plugin/) post on the developmentSEED blog.
|
||||
- [jekyll-multi-paginate](https://github.com/fadhilnapis/jekyll-multi-paginate): Simple Jekyll paginator for multiple page. Ease you to make pagination on multiple page especially like multiple language.
|
||||
|
||||
#### Converters
|
||||
|
||||
- [Pug plugin by Doug Beney](https://github.com/DougBeney/jekyll-pug): Pug (previously Jade) converter for Jekyll.
|
||||
- [Textile converter](https://github.com/jekyll/jekyll-textile-converter): Convert `.textile` files into HTML. Also includes the `textilize` Liquid filter.
|
||||
- [Slim plugin](https://github.com/slim-template/jekyll-slim): Slim converter and includes for Jekyll with support for Liquid tags.
|
||||
- [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade converter for Jekyll.
|
||||
- [Pug plugin by Josh Waller](https://github.com/mdxprograms/pug-jekyll-plugin): Pug (previously Jade) converter for Jekyll.
|
||||
- [HAML plugin by Sam Z](https://gist.github.com/517556): HAML converter for Jekyll.
|
||||
- [HAML-Sass Converter by Adam Pearson](https://gist.github.com/481456): Simple HAML-Sass converter for Jekyll. [Fork](https://gist.github.com/528642) by Sam X.
|
||||
- [Sass SCSS Converter by Mark Wolfe](https://gist.github.com/960150): Sass converter which uses the new CSS compatible syntax, based Sam X’s fork above.
|
||||
@@ -865,12 +865,17 @@ LESS.js files during generation.
|
||||
- [jekyll-figure](https://github.com/paulrobertlloyd/jekyll-figure): A liquid tag for Jekyll that generates `<figure>` elements.
|
||||
- [Jekyll Video Embed](https://github.com/eug/jekyll-video-embed): It provides several tags to easily embed videos (e.g. Youtube, Vimeo, UStream and Ted Talks)
|
||||
- [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags): Translate your templates.
|
||||
- [Jekyll Ideal Image Slider](https://github.com/xHN35RQ/jekyll-ideal-image-slider): Liquid tag plugin to create image sliders using [Ideal Image Slider](https://github.com/gilbitron/Ideal-Image-Slider).
|
||||
- [Jekyll Ideal Image Slider](https://github.com/jekylltools/jekyll-ideal-image-slider): Liquid tag plugin to create image sliders using [Ideal Image Slider](https://github.com/gilbitron/Ideal-Image-Slider).
|
||||
- [Jekyll Tags List Plugin](https://github.com/crispgm/jekyll-tags-list-plugin): A Liquid tag plugin that creates tags list in specific order.
|
||||
- [Jekyll Maps](https://github.com/ayastreb/jekyll-maps) by [Anatoliy Yastreb](https://github.com/ayastreb): A Jekyll plugin to easily embed maps with filterable locations.
|
||||
- [Jekyll Cloudinary](https://nhoizey.github.io/jekyll-cloudinary/) by [Nicolas Hoizey](https://nicolas-hoizey.com/): a Jekyll plugin adding a Liquid tag to ease the use of Cloudinary for responsive images in your Markdown/Kramdown posts.
|
||||
- [jekyll-include-absolute-plugin](https://github.com/tnhu/jekyll-include-absolute-plugin) by [Tan Nhu](https://github.com/tnhu): A Jekyll plugin to include a file from its path relative to Jekyll's source folder.
|
||||
- [Jekyll Download Tag](https://github.com/mattg/jekyll-download-tag): A Liquid tag that acts like `include`, but for external resources.
|
||||
- [Jekyll Brand Social Wall](https://github.com/MediaComem/jekyll-brand-social-wall): A jekyll plugin to generate a social wall with your favorite social networks
|
||||
- [Jekyll If File Exists](https://github.com/k-funk/jekyll-if-file-exists): A Jekyll Plugin that checks if a file exists with an if/else block.
|
||||
- [BibSonomy](https://github.com/rjoberon/bibsonomy-jekyll): Jekyll
|
||||
plugin to generate publication lists from [BibSonomy](https://www.bibsonomy.org/).
|
||||
|
||||
|
||||
#### Collections
|
||||
|
||||
@@ -880,6 +885,7 @@ LESS.js files during generation.
|
||||
|
||||
#### Other
|
||||
|
||||
- [Analytics for Jekyll](https://github.com/hendrikschneider/jekyll-analytics) by Hendrik Schneider: An effortless way to add various trackers like Google Analytics, Piwik, etc. to your site
|
||||
- [ditaa-ditaa](https://github.com/tmthrgd/ditaa-ditaa) by Tom Thorogood: a drastic revision of jekyll-ditaa that renders diagrams drawn using ASCII art into PNG images.
|
||||
- [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments.
|
||||
- [Draft/Publish Plugin by Michael Ivey](https://gist.github.com/49630): Save posts as drafts.
|
||||
|
||||
@@ -42,8 +42,8 @@ file. For example, the following are examples of valid post filenames:
|
||||
<div class="note">
|
||||
<h5>ProTip™: Link to other posts</h5>
|
||||
<p>
|
||||
Use the <a href="../templates/#post-url"><code>post_url</code></a>
|
||||
tag to link to other posts without having to worry about the URL's
|
||||
Use the <a href="../templates/#linking-to-posts"><code>post_url</code></a>
|
||||
tag to link to other posts without having to worry about the URLs
|
||||
breaking when the site permalink style changes.
|
||||
</p>
|
||||
</div>
|
||||
@@ -78,7 +78,7 @@ digital assets along with your text content. While the syntax for linking to
|
||||
these resources differs between Markdown and Textile, the problem of working
|
||||
out where to store these files in your site is something everyone will face.
|
||||
|
||||
Because of Jekyll’s flexibility, there are many solutions to how to do this.
|
||||
There are a number of ways to include digital assets in Jekyll.
|
||||
One common solution is to create a folder in the root of the project directory
|
||||
called something like `assets` or `downloads`, into which any images, downloads
|
||||
or other resources are placed. Then, from within any post, they can be linked
|
||||
@@ -112,7 +112,7 @@ Linking to a PDF for readers to download:
|
||||
|
||||
## A typical post
|
||||
|
||||
Jekyll can handle many different iterations of the idea you might associate with a "post," however a standard blog style post, including an Title, Layout, Publishing Date, and Categories might look like this:
|
||||
Jekyll can handle many different iterations of the idea you might associate with a "post," however a standard blog style post, including a Title, Layout, Publishing Date, and Categories might look like this:
|
||||
|
||||
```
|
||||
---
|
||||
|
||||
@@ -4,7 +4,7 @@ permalink: /docs/quickstart/
|
||||
---
|
||||
|
||||
|
||||
If you already have a full [Ruby](https://www.ruby-lang.org/en/downloads/) development environment with all headers and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following:
|
||||
If you already have a full [Ruby](https://www.ruby-lang.org/en/downloads/) development environment with all headers and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements)), you can create a new Jekyll site by doing the following:
|
||||
|
||||
```sh
|
||||
# Install Jekyll and Bundler gems through RubyGems
|
||||
@@ -22,7 +22,7 @@ If you already have a full [Ruby](https://www.ruby-lang.org/en/downloads/) devel
|
||||
# Now browse to http://localhost:4000
|
||||
```
|
||||
|
||||
If you encounter any unexpected errors during the above, please refer to the already-mentioned [requirements](/docs/installation/#requirements/) page, as you might be missing development headers or other prerequisites.
|
||||
If you encounter any unexpected errors during the above, please refer to the [troubleshooting](/docs/troubleshooting/#configuration-problems) page or the already-mentioned [requirements](/docs/installation/#requirements) page, as you might be missing development headers or other prerequisites.
|
||||
|
||||
## About Bundler
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ learning purposes.
|
||||
([source](https://github.com/github/training-kit))
|
||||
- [Rasmus Andersson](https://rsms.me/)
|
||||
([source](https://github.com/rsms/rsms.github.com))
|
||||
- [MvvmCross](https://mvvmcross.github.io/MvvmCross/)
|
||||
([source](https://github.com/MvvmCross/MvvmCross/tree/master/docs))
|
||||
|
||||
If you would like to explore more examples, you can find a list of sites
|
||||
and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].
|
||||
|
||||
@@ -65,3 +65,34 @@ following metadata:
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Note that in the above table, `file` can be anything. It's simply an arbitrarily set variable used in your own logic (such as in a for loop). It isn't a global site or page variable.
|
||||
|
||||
## Add front matter to static files
|
||||
|
||||
Although you can't directly add front matter values to static files, you can set front matter values through the [defaults property](../configuration/#front-matter-defaults) in your configuration file. When Jekyll builds the site, it will use the front matter values you set.
|
||||
|
||||
Here's an example:
|
||||
|
||||
In your `_config.yml` file, add the following values to the `defaults` property:
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
- scope:
|
||||
path: "assets/img"
|
||||
values:
|
||||
image: true
|
||||
```
|
||||
|
||||
This assumes that your Jekyll site has a folder path of `assets/img` where you have images (static files) stored. When Jekyll builds the site, it will treat each image as if it had the front matter value of `image: true`.
|
||||
|
||||
Suppose you want to list all your image assets as contained in `assets/img`. You could use this for loop to look in the `static_files` object and get all static files that have this front matter property:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% assign image_files = site.static_files | where: "image", true %}
|
||||
{% for myimage in image_files %}
|
||||
{{ myimage.path }}
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
When you build your site, the output will list the path to each file that meets this front matter condition.
|
||||
|
||||
@@ -4,8 +4,8 @@ permalink: /docs/templates/
|
||||
---
|
||||
|
||||
Jekyll uses the [Liquid](https://shopify.github.io/liquid/) templating language to
|
||||
process templates. All of the standard Liquid [tags](https://shopify.github.io/liquid/tags/) and
|
||||
[filters](https://shopify.github.io/liquid/filters/) are
|
||||
process templates. All of the standard Liquid [tags](https://shopify.github.io/liquid/tags/control-flow/) and
|
||||
[filters](https://shopify.github.io/liquid/filters/abs/) are
|
||||
supported. Jekyll even adds a few handy filters and tags of its own to make
|
||||
common tasks easier.
|
||||
|
||||
@@ -178,15 +178,15 @@ common tasks easier.
|
||||
<p class="name"><strong>CGI Escape</strong></p>
|
||||
<p>
|
||||
CGI escape a string for use in a URL. Replaces any special characters
|
||||
with appropriate %XX replacements.
|
||||
with appropriate <code>%XX</code> replacements. CGI escape normally replaces a space with a plus <code>+</code> sign.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ "foo,bar;baz?" | cgi_escape }}{% endraw %}</code>
|
||||
<code class="filter">{% raw %}{{ "foo, bar; baz?" | cgi_escape }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class="output">foo%2Cbar%3Bbaz%3F</code>
|
||||
<code class="output">foo%2C+bar%3B+baz%3F</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -194,15 +194,15 @@ common tasks easier.
|
||||
<td>
|
||||
<p class="name"><strong>URI Escape</strong></p>
|
||||
<p>
|
||||
URI escape a string.
|
||||
Percent encodes any special characters in a URI. URI escape normally replaces a space with <code>%20</code>. <a href="https://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters">Reserved characters</a> will not be escaped.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ "foo, bar \baz?" | uri_escape }}{% endraw %}</code>
|
||||
<code class="filter">{% raw %}{{ "http://foo.com/?q=foo, \bar?" | uri_escape }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class="output">foo,%20bar%20%5Cbaz?</code>
|
||||
<code class="output">http://foo.com/?q=foo,%20%5Cbar?</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -542,7 +542,7 @@ You can also use the `link` tag to create a link in Markdown as follows:
|
||||
|
||||
The path to the post, page, or collection is defined as the path relative to the root directory (where your config file is) to the file, not the path from your existing page to the other page.
|
||||
|
||||
For example, suppose you're creating a link `page_a.md` (stored in `pages/folder1/folder2`) to `page_b.md` (stored in `pages/folder1`). Your path in the link would not be `../page_b.html`. Instead, it would be `/pages/folder1/page_b.md`.
|
||||
For example, suppose you're creating a link in `page_a.md` (stored in `pages/folder1/folder2`) to `page_b.md` (stored in `pages/folder1`). Your path in the link would not be `../page_b.html`. Instead, it would be `/pages/folder1/page_b.md`.
|
||||
|
||||
If you're unsure of the path, add `{% raw %}{{ page.path }}{% endraw %}` to the page and it will display the path.
|
||||
|
||||
@@ -552,7 +552,7 @@ Note you cannot add filters to `link` tags. For example, you cannot append a str
|
||||
|
||||
### Linking to posts
|
||||
|
||||
If you want like to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
|
||||
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
|
||||
@@ -35,23 +35,15 @@ The goal of gem-based themes is to allow you to get all the benefits of a robust
|
||||
|
||||
Jekyll themes set default layouts, includes, and stylesheets. However, you can override any of the theme defaults with your own site content.
|
||||
|
||||
To replace layouts or includes in your theme, make a copy in your `_layouts` or `_includes` directory of the specific file you wish to modify, or create the file from scratch giving it the same name as the file you wish to override.
|
||||
|
||||
For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` directory (that is, `_layouts/page.html`).
|
||||
|
||||
Jekyll will look first to your site's content before looking to the theme's defaults for any requested file in the following folders:
|
||||
To locate a theme's files on your computer:
|
||||
|
||||
- `/assets`
|
||||
- `/_layouts`
|
||||
- `/_includes`
|
||||
- `/_sass`
|
||||
1. Run `bundle show` followed by the name of the theme's gem, e.g., `bundle show minima` for Jekyll's default theme.
|
||||
|
||||
Refer to your selected theme's documentation and source repository for more information on what files you can override.
|
||||
{: .note .info}
|
||||
|
||||
To locate theme's files on your computer:
|
||||
|
||||
1. Run `bundle show` followed by the name of the theme's gem, e.g., `bundle show minima` for default Jekyll's theme.
|
||||
|
||||
This returns the location of the gem-based theme files. For example, Minima theme's files are located in `/usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0` on macOS.
|
||||
This returns the location of the gem-based theme files. For example, the Minima theme's files might be located in `/usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0` on macOS.
|
||||
|
||||
2. Open the theme's directory in Finder or Explorer:
|
||||
|
||||
@@ -92,9 +84,23 @@ To locate theme's files on your computer:
|
||||
└── main.scss
|
||||
```
|
||||
|
||||
With a clear understanding of the theme's files, you can now override any theme file by creating a similarly named file in your Jekyll site directory.
|
||||
With a clear understanding of the theme's files, you can now override any theme file by creating a similarly named file in your Jekyll site directory.
|
||||
|
||||
Let's say you want to override Minima's footer. In your Jekyll site, create an `_includes` folder and add a file in it called `footer.html`. Jekyll will now use your site's `footer.html` file instead of the `footer.html` file from the Minima theme gem.
|
||||
Let's say, for a second example, you want to override Minima's footer. In your Jekyll site, create an `_includes` folder and add a file in it called `footer.html`. Jekyll will now use your site's `footer.html` file instead of the `footer.html` file from the Minima theme gem.
|
||||
|
||||
To modify any stylesheet you must take the extra step of also copying the main sass file (`_sass/minima.scss` in the Minima theme) into the `_sass` directory in your site's source.
|
||||
|
||||
Jekyll will look first to your site's content before looking to the theme's defaults for any requested file in the following folders:
|
||||
|
||||
- `/assets`
|
||||
- `/_layouts`
|
||||
- `/_includes`
|
||||
- `/_sass`
|
||||
|
||||
Note that making copies of theme files will prevent you from receiving any theme updates on those files. An alternative, to continue getting theme updates on all stylesheets, is to use higher specificity CSS selectors in your own additional, originally named CSS files.
|
||||
|
||||
Refer to your selected theme's documentation and source repository for more information on what files you can override.
|
||||
{: .note .info}
|
||||
|
||||
## Converting gem-based themes to regular themes
|
||||
|
||||
@@ -141,7 +147,8 @@ To install a gem-based theme:
|
||||
bundle exec jekyll serve
|
||||
```
|
||||
|
||||
You can have multiple themes listed in your site's `Gemfile`, but only one theme can be selected in your site's `_config.yml`. {: .note .info }
|
||||
You can have multiple themes listed in your site's `Gemfile`, but only one theme can be selected in your site's `_config.yml`.
|
||||
{: .note .info }
|
||||
|
||||
If you're publishing your Jekyll site on [GitHub Pages](https://pages.github.com/), note that GitHub Pages supports only some gem-based themes. See [Supported Themes](https://pages.github.com/themes/) in GitHub's documentation to see which themes are supported.
|
||||
|
||||
@@ -183,7 +190,7 @@ For example, if your theme has a `/_layouts/page.html` file, and a page has `lay
|
||||
|
||||
Any file in `/assets` will be copied over to the user's site upon build unless they have a file with the same relative path. You can ship any kind of asset here: SCSS, an image, a webfont, etc. These files behave like pages and static files in Jekyll:
|
||||
|
||||
- If the file has [YAML front matter](../docs/frontmatter/) at the top, it will be rendered.
|
||||
- If the file has [YAML front matter](/docs/frontmatter/) at the top, it will be rendered.
|
||||
- If the file does not have YAML front matter, it will simply be copied over into the resulting site.
|
||||
|
||||
This allows theme creators to ship a default `/assets/styles.scss` file which their layouts can depend on as `/assets/styles.css`.
|
||||
@@ -205,6 +212,12 @@ Your theme's styles can be included in the user's stylesheet using the `@import`
|
||||
{% raw %}@import "{{ site.theme }}";{% endraw %}
|
||||
```
|
||||
|
||||
### Theme-gem dependencies
|
||||
|
||||
From `v3.5`, Jekyll will automatically require all whitelisted `runtime_dependencies` of your theme-gem even if they're not explicitly included under the `gems` array in the site's config file. (NOTE: whitelisting is only required when building or serving with the `--safe` option.)
|
||||
|
||||
With this, the end-user need not keep track of the plugins required to be included in their config file for their theme-gem to work as intended.
|
||||
|
||||
### Documenting your theme
|
||||
|
||||
Your theme should include a `/README.md` file, which explains how site authors can install and use your theme. What layouts are included? What includes? Do they need to add anything special to their site's configuration file?
|
||||
@@ -217,22 +230,31 @@ Themes are visual. Show users what your theme looks like by including a screensh
|
||||
|
||||
To preview your theme as you're authoring it, it may be helpful to add dummy content in, for example, `/index.html` and `/page.html` files. This will allow you to use the `jekyll build` and `jekyll serve` commands to preview your theme, just as you'd preview a Jekyll site.
|
||||
|
||||
If you do preview your theme locally, be sure to add `/_site` to your theme's `.gitignore` file to prevent the compiled site from also being included when you distribute your theme. {: .info .note}
|
||||
If you do preview your theme locally, be sure to add `/_site` to your theme's `.gitignore` file to prevent the compiled site from also being included when you distribute your theme.
|
||||
{: .info .note}
|
||||
|
||||
### Publishing your theme
|
||||
|
||||
Themes are published via [RubyGems.org](https://rubygems.org). You will need a RubyGems account, which you can [create for free](https://rubygems.org/sign_up).
|
||||
|
||||
1. First, package your theme, by running the following command, replacing `jekyll-theme-awesome` with the name of your theme:
|
||||
1. First, you need to have it in a git repository:
|
||||
|
||||
```sh
|
||||
git init # Only the first time
|
||||
git add -A
|
||||
git commit -m "Init commit"
|
||||
```
|
||||
|
||||
2. Next, package your theme, by running the following command, replacing `jekyll-theme-awesome` with the name of your theme:
|
||||
|
||||
```sh
|
||||
gem build jekyll-theme-awesome.gemspec
|
||||
```
|
||||
|
||||
2. Next, push your packaged theme up to the RubyGems service, by running the following command, again replacing `jekyll-theme-awesome` with the name of your theme:
|
||||
3. Finally, push your packaged theme up to the RubyGems service, by running the following command, again replacing `jekyll-theme-awesome` with the name of your theme:
|
||||
|
||||
```sh
|
||||
gem push jekyll-theme-awesome-*.gem
|
||||
```
|
||||
|
||||
3. To release a new version of your theme, update the version number in the gemspec file, ( `jekyll-theme-awesome.gemspec` in this example ), and then repeat Steps 1 & 2 above. We recommend that you follow [Semantic Versioning](http://semver.org/) while bumping your theme-version.
|
||||
4. To release a new version of your theme, update the version number in the gemspec file, ( `jekyll-theme-awesome.gemspec` in this example ), and then repeat Steps 1 - 3 above. We recommend that you follow [Semantic Versioning](http://semver.org/) while bumping your theme-version.
|
||||
|
||||
@@ -17,7 +17,7 @@ that might be of help. If the problem you’re experiencing isn’t covered belo
|
||||
## Installation Problems
|
||||
|
||||
If you encounter errors during gem installation, you may need to install
|
||||
the header files for compiling extension modules for Ruby 2.0.0. This
|
||||
the header files for compiling extension modules for Ruby 2.x This
|
||||
can be done on Ubuntu or Debian by running:
|
||||
|
||||
```sh
|
||||
@@ -36,6 +36,15 @@ If you installed the above - specifically on Fedora 23 - but the extensions woul
|
||||
sudo dnf install redhat-rpm-config
|
||||
```
|
||||
|
||||
On Ubuntu if you get stuck after `bundle exec jekyll serve` and see error
|
||||
messages like `Could not locate Gemfile` or `.bundle/ directory`, it's likely
|
||||
because all requirements have not been fully met. Recent stock Ubuntu
|
||||
distributions require the installation of both the `ruby` and `ruby-all-dev`
|
||||
packages:
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby ruby-all-dev
|
||||
```
|
||||
|
||||
On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the
|
||||
following commands before installing Jekyll:
|
||||
@@ -56,6 +65,12 @@ sudo emerge -av dev-ruby/rubygems
|
||||
On Windows, you may need to install [RubyInstaller
|
||||
DevKit](https://wiki.github.com/oneclick/rubyinstaller/development-kit).
|
||||
|
||||
On Android (with Termux) you can install all requirements by running:
|
||||
|
||||
```sh
|
||||
apt update && apt install libffi-dev clang ruby-dev make
|
||||
```
|
||||
|
||||
On macOS, you may need to update RubyGems (using `sudo` only if necessary):
|
||||
|
||||
```sh
|
||||
@@ -180,10 +195,10 @@ That is: defaults are overridden by options specified in `_config.yml`,
|
||||
and flags specified at the command-line will override all other settings
|
||||
specified elsewhere.
|
||||
|
||||
If you encounter an error in building the site, with the error message
|
||||
"'0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the
|
||||
YAML front matter." try including the line `exclude: [vendor]`
|
||||
in `_config.yml`.
|
||||
If you encounter an error in building the site, with the error message
|
||||
"'0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the
|
||||
YAML front matter." try including the line `exclude: [vendor]`
|
||||
in `_config.yml`.
|
||||
|
||||
## Markup Problems
|
||||
|
||||
|
||||
@@ -8,3 +8,6 @@ Upgrading from an older version of Jekyll? Upgrading to a new major version of J
|
||||
|
||||
- [From 0.x to 1.x and 2.x](/docs/upgrading/0-to-2/)
|
||||
- [From 2.x to 3.x](/docs/upgrading/2-to-3/)
|
||||
|
||||
If you are making a minor update (for example from 3.3.1 to the latest version at the time 3.3.2) run 'bundle update jekyll' when in your site directory.
|
||||
If you would like to update all your gems, run 'bundle update' when in your site directory.
|
||||
|
||||
@@ -12,7 +12,7 @@ Before we dive in, go ahead and fetch the latest version of Jekyll:
|
||||
$ gem update jekyll
|
||||
```
|
||||
|
||||
Please note: Jekyll 3 requires Ruby version >= 2.0.0.
|
||||
Please note: Jekyll 3.2 requires Ruby version >= 2.1
|
||||
|
||||
<div class="note feature">
|
||||
<h5 markdown="1">Diving in</h5>
|
||||
|
||||
@@ -3,15 +3,88 @@ title: Jekyll on Windows
|
||||
permalink: /docs/windows/
|
||||
---
|
||||
|
||||
While Windows is not an officially-supported platform, it can be used to run
|
||||
Jekyll with the proper tweaks. This page aims to collect some of the general
|
||||
knowledge and lessons that have been unearthed by Windows users.
|
||||
While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks. This page aims to collect some of the general knowledge and lessons that have been unearthed by Windows users.
|
||||
|
||||
## Installation
|
||||
|
||||
A quick way to install Jekyll is to follow the [installation instructions by David Burela](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/):
|
||||
## Installing Jekyll
|
||||
|
||||
1. Install a package manager for Windows called [Chocolatey](https://chocolatey.org/install)
|
||||
If you are using Windows 10 Anniversary Update, the easiest way to run Jekyll is by [installing][WSL-Guide] the new Bash on Ubuntu on Windows.
|
||||
|
||||
|
||||
### Installation via Bash on Windows 10
|
||||
|
||||
*Note:* You must have [Bash on Ubuntu on Windows][BASH-WSL] enabled.
|
||||
|
||||
First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following:
|
||||
|
||||
```
|
||||
bash
|
||||
```
|
||||
Your Command Prompt instance should now be a Bash instance. Now we must update our repo lists and packages.
|
||||
|
||||
```
|
||||
sudo apt-get update -y && sudo apt-get upgrade -y
|
||||
```
|
||||
Now we can install Ruby. To do this we will use a repository from [BrightBox](https://www.brightbox.com/docs/ruby/ubuntu/), which hosts optimized versions of Ruby for Ubuntu.
|
||||
|
||||
```
|
||||
sudo apt-add-repository ppa:brightbox/ruby-ng
|
||||
sudo apt-get update
|
||||
sudo apt-get install ruby2.3 ruby2.3-dev build-essential
|
||||
```
|
||||
|
||||
Next let's update our Ruby gems:
|
||||
|
||||
```
|
||||
sudo gem update
|
||||
```
|
||||
|
||||
Now all that is left to do is install Jekyll.
|
||||
|
||||
```
|
||||
sudo gem install jekyll bundler
|
||||
```
|
||||
|
||||
Check if Jekyll installed properly by running:
|
||||
|
||||
```
|
||||
jekyll -v
|
||||
```
|
||||
|
||||
**And that's it!**
|
||||
|
||||
To start a new project named `my_blog`, just run:
|
||||
|
||||
```
|
||||
jekyll new my_blog
|
||||
```
|
||||
|
||||
You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file with the current date in the filename.
|
||||
|
||||
**Note:** Bash on Ubuntu on Windows is still under development, so you may run into issues.
|
||||
|
||||
|
||||
[WSL-Guide]: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
|
||||
[BASH-WSL]: https://msdn.microsoft.com/en-us/commandline/wsl/about
|
||||
|
||||
|
||||
### Installation via RubyInstaller
|
||||
|
||||
[RubyInstaller][] is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more.
|
||||
|
||||
1. Download and Install a package manager version from [RubyInstaller Downloads][RubyInstaller-downloads].
|
||||
2. Install Jekyll and Bundler via a command prompt window: `gem install jekyll bundler`
|
||||
3. Check if Jekyll installed properly: `jekyll -v`
|
||||
|
||||
[RubyInstaller]: https://rubyinstaller.org/
|
||||
[RubyInstaller-downloads]: https://rubyinstaller.org/downloads/
|
||||
|
||||
|
||||
### Installation via Chocolatey
|
||||
|
||||
A quick way to install Jekyll using Chocolatey is to follow the [installation instructions by David Burela](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/):
|
||||
|
||||
1. Install a package manager for Windows called [Chocolatey][]
|
||||
2. Install Ruby via Chocolatey: `choco install ruby -y`
|
||||
3. Reopen a command prompt and install Jekyll: `gem install jekyll`
|
||||
|
||||
@@ -19,52 +92,12 @@ Updates in the infrastructure of Ruby may cause SSL errors when attempting to us
|
||||
|
||||
[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
|
||||
|
||||
For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3].
|
||||
|
||||
[windows-installjekyll3]: https://labs.sverrirs.com/jekyll/
|
||||
|
||||
## Encoding
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header
|
||||
characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant if you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8
|
||||
in case you get a "Liquid Exception: Incompatible character encoding" error during
|
||||
the site generation process. It can be done with the following command:
|
||||
|
||||
```sh
|
||||
$ chcp 65001
|
||||
```
|
||||
|
||||
## Timezone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their 'Gemfile' by default, existing sites *will* have to update their 'Gemfile' (and installed) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
```
|
||||
|
||||
## Auto-regeneration
|
||||
|
||||
As of v1.3.0, Jekyll uses the `listen` gem to watch for changes when the
|
||||
`--watch` switch is specified during a build or serve. While `listen` has
|
||||
built-in support for UNIX systems, it requires an extra gem for compatibility
|
||||
with Windows. Add the following to the Gemfile for your site:
|
||||
|
||||
```ruby
|
||||
gem 'wdm', '~> 0.1.0' if Gem.win_platform?
|
||||
```
|
||||
|
||||
### How to install github-pages
|
||||
### Installing *github-pages* via Chocolatey
|
||||
|
||||
This section is part of an article written by [Jens Willmer][jwillmerPost]. To follow the instructions you need to have [Chocolatey][] installed on your system. If you already have a version of Ruby installed you need to uninstall it before you can continue.
|
||||
|
||||
|
||||
#### Install Ruby and Ruby development kit
|
||||
|
||||
Open a command prompt and execute the following commands:
|
||||
@@ -72,6 +105,7 @@ Open a command prompt and execute the following commands:
|
||||
* `choco install ruby -version 2.2.4`
|
||||
* `choco install ruby2.devkit` - _needed for compilation of json gem_
|
||||
|
||||
|
||||
#### Configure Ruby development kit
|
||||
|
||||
The development kit did not set the environment path for Ruby so we need to do it.
|
||||
@@ -81,14 +115,13 @@ The development kit did not set the environment path for Ruby so we need to do i
|
||||
* Edit the `config.yml` file and include the path to Ruby `- C:/tools/ruby22`
|
||||
* Execute the following command to set the path: `ruby dk.rb install`
|
||||
|
||||
|
||||
#### Nokogiri gem installation
|
||||
|
||||
This gem is also needed in the github-pages and to get it running on Windows x64 we have to install a few things.
|
||||
|
||||
|
||||
**Note:** In the current [pre release][nokogiriFails] it works out of the box with Windows x64 but this version is not referenced in the github-pages.
|
||||
|
||||
|
||||
`choco install libxml2 -Source "https://www.nuget.org/api/v2/"`{:.language-ruby}
|
||||
|
||||
`choco install libxslt -Source "https://www.nuget.org/api/v2/"`{:.language-ruby}
|
||||
@@ -105,11 +138,11 @@ This gem is also needed in the github-pages and to get it running on Windows x64
|
||||
--with-xslt-lib=C:\Chocolatey\lib\libxslt.redist.1.1.28.0\build\native\bin\v110\x64\Release\dynamic
|
||||
```
|
||||
|
||||
#### Install github-pages
|
||||
#### Install github-pages
|
||||
|
||||
* Open command prompt and install [Bundler][]: `gem install bundler`
|
||||
* Create a file called `Gemfile` without any extension in your root directory of your blog
|
||||
* Copy & paste the two lines into the file:
|
||||
* Open command prompt and install [Bundler][]: `gem install bundler`
|
||||
* Create a file called `Gemfile` without any extension in your root directory of your blog
|
||||
* Copy & paste the two lines into the file:
|
||||
|
||||
|
||||
```ruby
|
||||
@@ -121,13 +154,65 @@ gem 'github-pages', group: :jekyll_plugins
|
||||
* Open a command prompt, target your local blog repository root, and install github-pages: `bundle install`
|
||||
|
||||
|
||||
After this process you should have github-pages installed on your system and you can host your blog again with `jekyll s`. \\
|
||||
After this process you should have github-pages installed on your system and you can host your blog again with `jekyll s`.
|
||||
There will be a warning on startup that you should include `gem 'wdm', '>= 0.1.0' if Gem.win_platform?` to your `Gemfile` but I could not get `jekyll s` working if I include that line so for the moment I ignore that warning.
|
||||
|
||||
In the future the installation process of the github-pages should be as simple as the setup of the blog. But as long as the new version of the Nokogiri ([v1.6.8][nokogiriReleases]) is not stable and referenced, it is work to get it up and running on Windows.
|
||||
|
||||
[jwillmerPost]: https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46 "Installation instructions by Jens Willmer"
|
||||
[Chocolatey]: https://chocolatey.org/install "Package manager for Windows"
|
||||
[nokogiriFails]: https://github.com/sparklemotion/nokogiri/issues/1456#issuecomment-206481794 "Nokogiri fails to install on Ruby 2.3 for Windows"
|
||||
[Bundler]: http://bundler.io/ "Ruby Dependencie Manager"
|
||||
[nokogiriReleases]: https://github.com/sparklemotion/nokogiri/releases "Nokogiri Releases"
|
||||
[nokogiriFails]: https://github.com/sparklemotion/nokogiri/issues/1456#issuecomment-206481794 "Nokogiri fails to install on Ruby 2.3 for Windows"
|
||||
|
||||
---
|
||||
|
||||
For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3].
|
||||
|
||||
Optionally you can use [Autoinstall Jekyll for Windows][fastjekyll-autoinstall].
|
||||
|
||||
---
|
||||
|
||||
[windows-installjekyll3]: https://labs.sverrirs.com/jekyll/
|
||||
[fastjekyll-autoinstall]: https://github.com/KeJunMao/fastjekyll#autoinstall-jekyll-for-windows
|
||||
|
||||
|
||||
## Encoding
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant when you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a "Liquid Exception: Incompatible character encoding" error during the site generation process. It can be done with the following command:
|
||||
|
||||
```sh
|
||||
$ chcp 65001
|
||||
```
|
||||
|
||||
|
||||
## Time-Zone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database][IANA-database].
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their 'Gemfile' by default, existing sites *will* have to update their 'Gemfile' (and installed) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
```
|
||||
|
||||
[IANA-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
|
||||
|
||||
## Auto Regeneration
|
||||
|
||||
As of v1.3.0, Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve. While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows.
|
||||
|
||||
Add the following to the Gemfile for your site if you have issues with auto-regeneration on Windows alone:
|
||||
|
||||
```ruby
|
||||
gem 'wdm', '~> 0.1.1' if Gem.win_platform?
|
||||
```
|
||||
|
||||
You may first have to download and install the [Ruby DevKit](https://rubyinstaller.org/downloads/) by following [the instructions here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit).
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
<a href="/help/">Help</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ site.repository }}"><span class="hide-on-mobiles">View on </span>GitHub</a>
|
||||
<a href="{{ site.repository }}">GitHub</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
39
docs/_includes/section_nav_tutorials.html
Normal file
39
docs/_includes/section_nav_tutorials.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% comment %}
|
||||
Map grabs the tutorials sections, giving us an array of arrays. Join, flattens all
|
||||
the items to a comma delimited string. Split turns it into an array again.
|
||||
{% endcomment %}
|
||||
{% assign tutorials = site.data.tutorials | map: 'tutorials' | join: ',' | split: ',' %}
|
||||
|
||||
{% comment %}
|
||||
Because this is built for every page, lets find where we are in the ordered
|
||||
document list by comparing url strings. Then if there's something previous or
|
||||
next, lets build a link to it.
|
||||
{% endcomment %}
|
||||
|
||||
{% for tutorial in tutorials %}
|
||||
{% assign tutorial_url = tutorial | prepend:"/tutorials/" | append:"/" %}
|
||||
{% if tutorial_url == page.url %}
|
||||
<div class="section-nav">
|
||||
<div class="left align-right">
|
||||
{% if forloop.first %}
|
||||
<span class="prev disabled">Back</span>
|
||||
{% else %}
|
||||
{% assign previous = forloop.index0 | minus: 1 %}
|
||||
{% assign previous_page = tutorials[previous] | prepend:"/tutorials/" | append:"/" %}
|
||||
<a href="{{ previous_page }}" class="prev">Back</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="right align-left">
|
||||
{% if forloop.last %}
|
||||
<span class="next disabled">Next</span>
|
||||
{% else %}
|
||||
{% assign next = forloop.index0 | plus: 1 %}
|
||||
{% assign next_page = tutorials[next] | prepend:"/tutorials/" | append:"/" %}
|
||||
<a href="{{ next_page }}" class="next">Next</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
10
docs/_includes/tutorials_contents.html
Normal file
10
docs/_includes/tutorials_contents.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="unit one-fifth hide-on-mobiles">
|
||||
<aside>
|
||||
{% for section in site.data.tutorials %}
|
||||
<h4>{{ section.title }}</h4>
|
||||
|
||||
{% include tutorials_ul.html items=section.tutorials %}
|
||||
|
||||
{% endfor %}
|
||||
</aside>
|
||||
</div>
|
||||
10
docs/_includes/tutorials_contents_mobile.html
Normal file
10
docs/_includes/tutorials_contents_mobile.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="docs-nav-mobile unit whole show-on-mobiles">
|
||||
<select onchange="if (this.value) window.location.href=this.value">
|
||||
<option value="">Navigate the tutorials…</option>
|
||||
{% for section in site.data.tutorials %}
|
||||
<optgroup label="{{ section.title }}">
|
||||
{% include tutorials_option.html items=section.tutorials %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
5
docs/_includes/tutorials_option.html
Normal file
5
docs/_includes/tutorials_option.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% for item in include.items %}
|
||||
{% assign item_url = item | prepend:"/tutorials/" | append:"/" %}
|
||||
{% assign tutorial = site.tutorials | where: "url", item_url | first %}
|
||||
<option value="{{ tutorial.url }}">{{ tutorial.title }}</option>
|
||||
{% endfor %}
|
||||
7
docs/_includes/tutorials_ul.html
Normal file
7
docs/_includes/tutorials_ul.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<ul>
|
||||
{% for item in include.items %}
|
||||
{% assign item_url = item | prepend:"/tutorials/" | append:"/" %}
|
||||
{% assign p = site.tutorials | where:"url", item_url | first %}
|
||||
<li class="{% if item_url == page.url %}current{% endif %}"><a href="{{ p.url }}">{{ p.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
27
docs/_layouts/tutorials.html
Normal file
27
docs/_layouts/tutorials.html
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
<section class="docs">
|
||||
<div class="grid">
|
||||
|
||||
{% include tutorials_contents_mobile.html %}
|
||||
|
||||
<div class="unit four-fifths">
|
||||
<article>
|
||||
<div class="improve right hide-on-mobiles">
|
||||
<a href="https://github.com/jekyll/jekyll/edit/master/docs/{{ page.path }}"><i
|
||||
class="fa fa-pencil"></i> Improve this page</a>
|
||||
</div>
|
||||
<h1>{{ page.title }}</h1>
|
||||
{{ content }}
|
||||
{% include section_nav_tutorials.html %}
|
||||
</article>
|
||||
</div>
|
||||
|
||||
{% include tutorials_contents.html %}
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@@ -22,7 +22,7 @@ Some other notable changes:
|
||||
- Explicit support for Ruby 2.0.x was dropped
|
||||
- Added an `:after_init` Hook
|
||||
- Added a `where_exp` filter to provide more powerful filtering
|
||||
- Added a `link` liquid tag which can be used to generate URL's for any
|
||||
- Added a `link` liquid tag which can be used to generate URLs for any
|
||||
post or document based on its path relative to the site source
|
||||
- ... and lots more!
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ By default, `baseurl` is set to `""` and therefore yields (never set to
|
||||
|
||||
A result of `relative_url` will safely always produce a URL which is
|
||||
relative to the domain root. A similar principle applies to `absolute_url`.
|
||||
It prepends your `baseurl` and `url` values, making absolute URL's all the
|
||||
It prepends your `baseurl` and `url` values, making absolute URLs all the
|
||||
easier to make:
|
||||
|
||||
{% highlight liquid %}
|
||||
|
||||
@@ -10,8 +10,8 @@ Hey there! We have a quick update of Jekyll for you to enjoy this January.
|
||||
Packed full of bug fixes as usual, thanks to the tireless efforts of our
|
||||
exceptional Jekyll community. Three changes to call out:
|
||||
|
||||
1. If you're a big fan of [`where_by_exp`](/docs/filters/), you'll be an
|
||||
even bigger fan of [`group_by_exp`](/docs/filters/).
|
||||
1. If you're a big fan of [`where_by_exp`](/docs/templates/#filters), you'll be an
|
||||
even bigger fan of [`group_by_exp`](/docs/templates/#filters).
|
||||
2. Using a custom timezone in Jekyll on Windows? Yeah, sorry that hasn't ever worked
|
||||
properly. We made it possible to accurately [set the timezone using IANA
|
||||
timezone codes](https://jekyllrb.com/docs/windows/#timezone-management).
|
||||
|
||||
106
docs/_posts/2017-03-02-jekyll-3-4-1-released.markdown
Normal file
106
docs/_posts/2017-03-02-jekyll-3-4-1-released.markdown
Normal file
@@ -0,0 +1,106 @@
|
||||
---
|
||||
title: 'Jekyll 3.4.1, or "Unintended Consequences"'
|
||||
date: 2017-03-02 14:20:26 -0500
|
||||
author: parkr
|
||||
version: 3.4.1
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Conformity is a confounding thing.
|
||||
|
||||
We write tests to ensure that a piece of functionality that works today
|
||||
will work tomorrow, as further modifications are made to the codebase. This
|
||||
is a principle of modern software development: every change must have a
|
||||
test to guard against regressions to the functionality implemented by that
|
||||
change.
|
||||
|
||||
And yet, occasionally, our very best efforts to test functionality will be
|
||||
thwarted. This is because of how our code produces unintended
|
||||
functionality, which naturally goes untested.
|
||||
|
||||
In our documentation, we tell users to name their posts with the following
|
||||
format:
|
||||
|
||||
```text
|
||||
YYYY-MM-DD-title.extension
|
||||
```
|
||||
|
||||
That format specifies exactly four numbers for the year, e.g. 2017, two
|
||||
letters for the month, e.g. 03, and two letters for the day, e.g. 02. To
|
||||
match this, we had the following regular expression:
|
||||
|
||||
```ruby
|
||||
%r!^(?:.+/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$!
|
||||
```
|
||||
|
||||
You might already see the punchline. While our documentation specifies the
|
||||
exact number of numbers that is required for each section of the date, our
|
||||
regular expression does not enforce this precision. What happens if a user
|
||||
doesn't conform to our documentation?
|
||||
|
||||
We recently [received a bug report](https://github.com/jekyll/jekyll/issues/5603)
|
||||
that detailed how the following file was considered a post:
|
||||
|
||||
```text
|
||||
84093135-42842323-42000001-b890-136270f7e5f1.md
|
||||
```
|
||||
|
||||
Of course! It matches the above regular expression, but doesn't satisfy
|
||||
other requirements about those numbers being a valid date (unless you're
|
||||
living in a world that has 43 million months, and 42 million (and one)
|
||||
days). So, we [modified the regular expression to match our
|
||||
documentation](https://github.com/jekyll/jekyll/pull/5609):
|
||||
|
||||
```ruby
|
||||
%r!^(?:.+/)*(\d{4}-\d{2}-\d{2})-(.*)(\.[^.]+)$!
|
||||
```
|
||||
|
||||
Our tests all passed and we were properly excluding this crazy date with 43
|
||||
million months and days. This change shipped in Jekyll v3.4.0 and all was
|
||||
well.
|
||||
|
||||
Well, not so much.
|
||||
|
||||
A very common way to specify the month of February is `2`. This is true for
|
||||
all single-digit months and days of the month. Notice anything about our
|
||||
first regular expression versus our second? The second regular expression
|
||||
imposes a **minimum**, as well as maximum, number of digits. This change
|
||||
made Jekyll ignore dates with single-digit days and months.
|
||||
|
||||
The first eight years of Jekyll's existence had allowed single-digit days
|
||||
and months due to an imprecise regular expression. For some people, their
|
||||
entire blog was missing, and there were no errors that told them why.
|
||||
|
||||
After receiving a few bug reports, it became clear what had happened.
|
||||
Unintended functionality of the last eight years had been broken. Thus,
|
||||
v3.4.0 was broken for a non-negligible number of sites. With a test site
|
||||
in-hand from @andrewbanchich, I tracked it down to this regular expression
|
||||
and [reintroduced](https://github.com/jekyll/jekyll/pull/5920) a proper
|
||||
minimum number of digits for each segment:
|
||||
|
||||
```ruby
|
||||
%r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$!
|
||||
```
|
||||
|
||||
And, I wrote a test.
|
||||
|
||||
This change was quickly backported to v3.4.0 and here we are: releasing
|
||||
v3.4.1. It will fix the problem for all users who were using single-digit
|
||||
months and days.
|
||||
|
||||
With this, I encourage all of you to look at your code for *unintended*
|
||||
functionality and make a judgement call: if it's allowed, *should it be*?
|
||||
If it should be allowed, make it *intended* functionality and test it! I
|
||||
know I'll be looking at my code with much greater scrutiny going forward,
|
||||
looking for unintended consequences.
|
||||
|
||||
Many thanks to our Jekyll affinity team captains who helped out, including
|
||||
@pathawks, @pnn, and @DirtyF. Thanks, too, to @ashmaroli for reviewing my
|
||||
change with an eye for consistency and precision. This was certainly a team
|
||||
effort.
|
||||
|
||||
We hope Jekyll v3.4.1 brings your variable-digit dates back to their
|
||||
previous glory. We certainly won't let that unintended functionality be
|
||||
unintended any longer.
|
||||
|
||||
As always, Happy Jekylling!
|
||||
51
docs/_posts/2017-03-09-jekyll-3-4-2-released.markdown
Normal file
51
docs/_posts/2017-03-09-jekyll-3-4-2-released.markdown
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: 'Jekyll 3.4.2 Released'
|
||||
date: 2017-03-09 15:41:57 -0500
|
||||
author: parkr
|
||||
version: 3.4.2
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Another one-PR patch update, though without the same [lessons as for the
|
||||
previous release]({% link _posts/2017-03-02-jekyll-3-4-1-released.markdown %}).
|
||||
|
||||
This release includes a beneficial change for a number of plugins:
|
||||
**static files now respect front matter defaults**.
|
||||
|
||||
You might be asking yourself: "why would static files, files that are
|
||||
static files explicitly because they *don't* have YAML front matter, want
|
||||
to respect YAML front matter?" That's a great question. Let me illustrate
|
||||
with an example.
|
||||
|
||||
Let's look at `jekyll-sitemap`. This plugin generates a list of documents,
|
||||
pages, and static files, and some metadata for them in an XML file for a
|
||||
Google/Yahoo/Bing/DuckDuckGo crawler to consume. If you don't want a given
|
||||
file in this list, you set `sitemap: false` in the YAML front matter. But
|
||||
what about static files, which don't have YAML front matter? Before this
|
||||
release, they could not be excluded because they had no properties in YAML
|
||||
other than [the ones we explicitly assigned](https://github.com/jekyll/jekyll/blob/v3.4.1/lib/jekyll/static_file.rb#L98-L106).
|
||||
So if you had a PDF you didn't want to be in your sitemap, you couldn't use
|
||||
`jekyll-sitemap`.
|
||||
|
||||
With this release, you can now set [front matter
|
||||
defaults](/docs/configuration/#front-matter-defaults) for static files:
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "pdfs/"
|
||||
values:
|
||||
sitemap: false
|
||||
```
|
||||
|
||||
Now, for every file in the Liquid `site.static_files` loop which is in the
|
||||
folder `pdfs/`, you'll see `sitemap` equal to `false`.
|
||||
|
||||
Many thanks to @benbalter for coming up with the solution and ensuring
|
||||
sitemaps everywhere are filled with just the right content.
|
||||
|
||||
As always, if you notice any bugs, please search the issues and file one if
|
||||
you can't find another related to your issue.
|
||||
|
||||
Happy Jekylling!
|
||||
49
docs/_posts/2017-03-21-jekyll-3-4-3-released.markdown
Normal file
49
docs/_posts/2017-03-21-jekyll-3-4-3-released.markdown
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: 'Jekyll 3.4.3 Released'
|
||||
date: 2017-03-21 08:52:53 -0500
|
||||
author: pathawks
|
||||
version: 3.4.3
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Another one-PR patch update as we continue our quest to destroy all bugs. A
|
||||
fairly technical debriefing follows, but the TLDR is that we have updated the
|
||||
`uri_escape` filter to more closely follow the pre-v3.4.0 behavior.
|
||||
|
||||
In [v3.4.0]({% link _posts/2017-01-18-jekyll-3-4-0-released.markdown %}), we
|
||||
moved away from using the deprecated
|
||||
[`URI.escape`](https://ruby-doc.org/stdlib-2.3.0/libdoc/uri/rdoc/URI/Escape.html#method-i-encode)
|
||||
in favor of
|
||||
[`Addressable::URI.encode`](http://www.rubydoc.info/gems/addressable/Addressable/URI#encode-class_method).
|
||||
This is what powers our [`uri_escape`
|
||||
filter](https://jekyllrb.com/docs/templates/).
|
||||
|
||||
While this transition was mostly a smooth one, the two methods are not
|
||||
identical. While `URI.escape` was happy to escape any string,
|
||||
`Addressable::URI.encode` first turns the string into an `Addressable::URI`
|
||||
object, and will then escape each component of that object. In most cases, this
|
||||
difference was insignificant, but there were a few cases where this caused some
|
||||
unintended regressions when encoding colons.
|
||||
|
||||
While **Addressable** can understand that something like `"/example :page"` is a
|
||||
relative URI, without the slash it cannot figure out how to turn
|
||||
`"example :page"` into an `Addressable::URI` object. `URI.escape` had no such
|
||||
objection. This lead to the following Liquid code working fine in Jekyll 3.3.x
|
||||
but breaking in 3.4.0:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ "example :page" | uri_escape }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
This was not an intended consequence of switching to **Addressable**.
|
||||
|
||||
Fortunately, the solution was not complicated. **Addressable** has a method
|
||||
[`Addressable::URI.normalize_component`](http://www.rubydoc.info/gems/addressable/Addressable/URI#normalize_component-class_method)
|
||||
which will simply escape the characters in a string, much like `URI.escape`.
|
||||
|
||||
Thanks to @cameronmcefee and @FriesFlorian for reporting
|
||||
[this issue](https://github.com/jekyll/jekyll/issues/5954).
|
||||
|
||||
Happy Jekylling!
|
||||
38
docs/_posts/2017-06-14-jekyll-3-5-0-released.markdown
Normal file
38
docs/_posts/2017-06-14-jekyll-3-5-0-released.markdown
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: 'Jekyll turns 3.5, oh my!'
|
||||
date: 2017-06-15 17:32:32 -0400
|
||||
author: parkr
|
||||
version: 3.5.0
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Good news! Nearly 400 commits later, Jekyll 3.5.0 has been released into
|
||||
the wild. Some new shiny things you might want to test out:
|
||||
|
||||
- Jekyll now uses Liquid 4, the latest! It comes with whitespace control, new filters `concat` annd `compact`, loop performance improvements and [many fixes](https://github.com/Shopify/liquid/blob/master/History.md#400--2016-12-14--branch-4-0-stable)
|
||||
- Themes can specify runtime dependencies (in their gemspecs) and we'll require those. This makes it easier for theme writers to use plugins.
|
||||
- Speaking of themes, we'll properly handle the discrepancy between a convertible file in the local site and a static file in the theme. Overriding a file locally now doesn't matter if it's convertible or static.
|
||||
- Pages, posts, and other documents can now access layout variables via `{% raw %}{{ layout }}{% endraw %}`.
|
||||
- The `gems` key in the `_config.yml` is now `plugins`. This is backwards-compatible, as Jekyll will gracefully upgrade `gems` to `plugins` if you use the former.
|
||||
- Filters like `sort` now allow you to sort based on a subvalue, e.g. `{% raw %}{% assign sorted = site.posts | sort: "image.alt_text" %}{% endraw %}`.
|
||||
- You can now create tab-separated data files.
|
||||
- Using `layout: none` will now produce a file with no layout. Equivalent to `layout: null`, with the exception that `none` is a truthy value and won't be overwritten by front matter defaults.
|
||||
- No more pesky errors if your URL contains a colon (sorry about those!)
|
||||
- We now automatically exclude the `Gemfile` from the site manifest when compiling your site. No more `_site/Gemfile`!
|
||||
- We fixed a bug where abbreviated post dates were ignored, e.g. `_posts/2016-4-4-april-fourth.md`.
|
||||
|
||||
And [so much more!](/docs/history/)
|
||||
|
||||
There was a huge amount of effort put into this release by our maintainers,
|
||||
especially @pathawks, @DirtyF, and @pup. Huge thanks to them for ushering
|
||||
this release along and keeping the contributions flowing! Jekyll wouldn't
|
||||
work without the tireless dedication of our team captains & maintainers.
|
||||
Thank you, all!
|
||||
|
||||
A huge thanks as well to our contributors to this release: Adam Hollett, Aleksander Kuś, Alfred Myers, Anatoliy Yastreb, Antonio Argote, Ashton Hellwig, Ashwin Maroli, Ben Balter, BlueberryFoxtrot, Brent Yi, Chris Finazzo, Christoph Päper, Christopher League, Chun Fei Lung, Colin, David Zhang, Eric Leong, Finn Ellis, Florian Thomas, Frank Taillandier, Hendrik Schneider, Henry Kobin, Ivan Storck, Jakub Klímek, Jan Pobořil, Jeff Puckett, Jonathan Hooper, Kaligule, Kevin Funk, Krzysztof Szafranek, Liu Cheng, Lukasz Brodowski, Marc Bruins, Marcelo Canina, Martin Desrumaux, Mer, Nate, Oreonax, Parker Moore, Pat Hawks, Pedro Lamas, Phil Nash, Ricardo N Feliciano, Ricky Han, Roger Sheen, Ryan Lue, Ryan Streur, Shane Neuville, Sven Meyer, Tom Johnson, William Entriken, Yury V. Zaytsev, Zarino Zappia, dyang, jekylltools, sean delaney, zenHeart
|
||||
|
||||
Please file any bugs with detailed replication instructions if you find any
|
||||
bugs. Better yet, submit a patch if you find the bug in the code and know
|
||||
how to fix it! :heart:
|
||||
|
||||
Happy Jekylling! :tada:
|
||||
19
docs/_posts/2017-07-17-jekyll-3-5-1-released.markdown
Normal file
19
docs/_posts/2017-07-17-jekyll-3-5-1-released.markdown
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: 'Jekyll 3.5.1 Released'
|
||||
date: 2017-07-17 12:40:37 -0400
|
||||
author: parkr
|
||||
version: 3.5.1
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
We've released a few bugfixes in the form of v3.5.1 today:
|
||||
|
||||
- Some plugins stopped functioning properly due to a NoMethodError for `registers` on NilClass. That's been fixed.
|
||||
- A bug in `relative_url` when `baseurl` is `nil` caused URL's to come out wrong. Squashed.
|
||||
- Static files' liquid representations should now have all the keys you were expecting when serialized into JSON.
|
||||
|
||||
We apologize for the breakages! We're working diligently to improve how we test our plugins with Jekyll core to prevent breakages in the future.
|
||||
|
||||
More details in [the history](/docs/history/#v3-5-1). Many thanks to all the contributors to Jekyll v3.5.1: Adam Voss, ashmaroli, Ben Balter, Coby Chapple, Doug Beney, Fadhil, Florian Thomas, Frank Taillandier, James, jaybe, Joshua Byrd, Kevin Plattret, & Robert Jäschke.
|
||||
|
||||
Happy Jekylling!
|
||||
@@ -1 +1,427 @@
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:0.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}
|
||||
/*! normalize.css v6.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct the line height in all browsers.
|
||||
* 2. Prevent adjustments of font size after orientation changes in
|
||||
* IE on Windows Phone and in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
footer,
|
||||
header,
|
||||
nav,
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
* 1. Add the correct display in IE.
|
||||
*/
|
||||
|
||||
figcaption,
|
||||
figure,
|
||||
main { /* 1 */
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct margin in IE 8.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Remove the gray background on active links in IE 10.
|
||||
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent; /* 1 */
|
||||
-webkit-text-decoration-skip: objects; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font style in Android 4.3-.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct background and color in IE 9-.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background-color: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
audio,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in iOS 4-7.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10-.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the overflow in IE.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input { /* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
||||
* controls in Android 4.
|
||||
* 2. Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
html [type="button"], /* 1 */
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
[type="reset"]:-moz-focusring,
|
||||
[type="submit"]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct display in IE 9-.
|
||||
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10-.
|
||||
* 2. Remove the padding in IE 10-.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
[type="search"]::-webkit-search-cancel-button,
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in IE 9-.
|
||||
* 1. Add the correct display in Edge, IE, and Firefox.
|
||||
*/
|
||||
|
||||
details, /* 1 */
|
||||
menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Scripting
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 9-.
|
||||
*/
|
||||
|
||||
canvas {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hidden
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10-.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ body {
|
||||
-o-font-feature-settings: "kern" 1;
|
||||
font-feature-settings: "kern" 1;
|
||||
font-kerning: normal;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.clear {
|
||||
@@ -101,6 +102,7 @@ nav {
|
||||
}
|
||||
|
||||
.mobile-nav {
|
||||
padding: 0 5px;
|
||||
|
||||
ul {
|
||||
overflow: hidden;
|
||||
@@ -459,6 +461,9 @@ aside {
|
||||
top: 0;
|
||||
left: -30px;
|
||||
}
|
||||
&.current a {
|
||||
color: #f90;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,3 +1036,20 @@ code.output {
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.result {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.image-description {
|
||||
margin: -20px 0 20px;
|
||||
padding: 10px 15px;
|
||||
font-size: 0.81em;
|
||||
text-align: justify;
|
||||
background: #5c5c5c;
|
||||
|
||||
pre, code {
|
||||
font-size: 0.75em;
|
||||
background: #454545;
|
||||
}
|
||||
}
|
||||
|
||||
521
docs/_tutorials/convert-existing-site-to-jekyll.md
Normal file
521
docs/_tutorials/convert-existing-site-to-jekyll.md
Normal file
@@ -0,0 +1,521 @@
|
||||
---
|
||||
layout: tutorials
|
||||
permalink: /tutorials/convert-site-to-jekyll/
|
||||
title: Convert an HTML site to Jekyll
|
||||
---
|
||||
|
||||
If you're looking for themes for your Jekyll site, you don't have to restrict yourself to existing Jekyll themes. It's pretty easy to convert almost any static HTML files into a Jekyll website.
|
||||
|
||||
In many ways, any site that is currently a static site is *already* a Jekyll website. Jekyll just allows you to automate parts of the site (like inserting pages into templates, rendering lists for navigation, generating feeds and sitemaps, and more) as it processes the files.
|
||||
|
||||
Understanding how to convert any HTML site into Jekyll templates will open your world to many more options for Jekyll themes. Instead of [searching online for *Jekyll themes*](https://duckduckgo.com/?q=Jekyll+themes), you can choose from the large variety of HTML templates for your site, quickly Jekyll-ize the HTML templates as you need to, and build the output with Jekyll.
|
||||
|
||||
Although websites can have sophisticated features and controls, we'll keep things simple in this tutorial.
|
||||
|
||||
## What is a Jekyll Website?
|
||||
|
||||
First, let's start with a grounding in the basics. Stripping a Jekyll site down to an extremely basic level will help clarify what happens in a Jekyll site. If you haven't already installed the jekyll gem, [install it]({% link _docs/installation.md %}).
|
||||
|
||||
We'll start with a *basic Jekyll site* consisting of three files:
|
||||
|
||||
```
|
||||
├── _config.yml
|
||||
├── _layouts
|
||||
│ └── default.html
|
||||
└── index.md
|
||||
```
|
||||
|
||||
Manually create these three files in a folder called `my_jekyll_site` or whatever suits you the most, and place `default.html` inside a folder named `_layouts`.
|
||||
|
||||
```sh
|
||||
$ touch _config.yml index.md default.html
|
||||
$ mkdir _layouts && mv default.html _layouts
|
||||
```
|
||||
|
||||
Fire up your favorite editor, and populate the contents of the `default.html` and `index.md` files as follows:
|
||||
|
||||
**_config.yml**
|
||||
|
||||
```yaml
|
||||
name: My Jekyll Website
|
||||
```
|
||||
|
||||
**_layouts/default.html**
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
{% raw %}{{ content }}{% endraw %}
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
**index.md**
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My page
|
||||
layout: default
|
||||
---
|
||||
|
||||
# {% raw %}{{ page.title }}{% endraw %}
|
||||
|
||||
Content is written in [Markdown](https://learnxinyminutes.com/docs/markdown/). Plain text format allows you to focus on your **content**.
|
||||
|
||||
<!--
|
||||
You can use HTML elements in Markdown, such as the comment element, and they won't be affected by a markdown parser. However, if you create an HTML element in your markdown file, you cannot use markdown syntax within that element's contents.
|
||||
-->
|
||||
```
|
||||
|
||||
Now `cd` to `my_jekyll_site` and serve the site with the built-in server:
|
||||
|
||||
```
|
||||
cd my_jekyll_site
|
||||
jekyll serve
|
||||
```
|
||||
|
||||
If you have a Gemfile, [use Bundler]({% link _docs/quickstart.md %}#about-bundler) by typing `bundle exec jekyll serve` instead.
|
||||
{: .note .info}
|
||||
|
||||
When you serve the site, you get a preview URL such as `http://127.0.0.1:4000/` (which is the same as `http://localhost:4000/`). The site's files are built into the `_site` folder by default.
|
||||
|
||||
This is a Jekyll site at the most basic functional level. Here's what is happening:
|
||||
|
||||
* The `_config.yml` file contains settings that Jekyll uses as it processes your site. An empty config file will use default values for building a Jekyll site. For example, to convert [Markdown](https://learnxinyminutes.com/docs/markdown/) to HTML, Jekyll will automatically use the [kramdown Markdown filter](https://rubygems.org/gems/kramdown/), without any need to specify it.
|
||||
* Jekyll looks for files with [front matter tags]({% link _docs/frontmatter.md %}) (the two sets of dashed lines `---` like those in `index.md`) and processes the files (populating site variables, rendering any [Liquid](https://shopify.github.io/liquid/), and converting Markdown to HTML).
|
||||
* Jekyll pushes the content from all pages and posts into the `{% raw %}{{ content }}{% endraw %}` variable in the layout specified (`default`) in the front matter tags.
|
||||
* The processed files get written as `.html` files in the `_site` directory.
|
||||
|
||||
You can read more about how Jekyll processes the files in [order of Interpretation]({% link _tutorials/orderofinterpretation.md %}).
|
||||
|
||||
With this basic understanding of how a Jekyll site works, you can convert almost any HTML theme for Jekyll. The following sections will take you through a step-by-step tutorial to do so.
|
||||
|
||||
## 1. Create a template for your default layout
|
||||
|
||||
Find your HTML theme and save it as a `default` layout. If you're converting or cloning an existing site, you can right-click the page and view the source code.
|
||||
|
||||
For example, suppose you're cloning your company site to create a documentation site with the same branding. Or suppose you have a personal site that you built with HTML and now want to make it a Jekyll site. Get the HTML source code for your site.
|
||||
|
||||
{: .note .info}
|
||||
Regardless of the site, do check the license and make sure you have permission to copy and use the code.
|
||||
|
||||
Copy and paste the source code into a file called `default.html`. Put the `default.html` file inside the `_layouts` folder. This will be the default layout template for your pages and posts — that is, each page or post will use this layout when Jekyll builds the site.
|
||||
|
||||
Note that in looking for templates, you want the HTML output of the template. If the template has PHP tags or other dynamic scripts, these dynamic elements will need to be converted to HTML or to [Liquid](https://shopify.github.io/liquid/). Liquid is [Jekyll templating system]({% link _docs/templates.md %}) to retrieve dynamic content.
|
||||
|
||||
Open `default.html` into your browser locally to ensure the site looks and behaves like it does online. You will likely need to adjust CSS, JS, and image paths so they work.
|
||||
|
||||
For example, if the paths were relative on the site you copied, you'll need to either download the same assets into your Jekyll site or use absolute paths to the same assets in the cloud. (Syntax such as `src="//` requires a prefix such as `src="http://` to work in your local browser.)
|
||||
|
||||
Jekyll provides some [filters]({% link _docs/templates.md %}#filters) to prepend a site URL before path. For example, you could preface your stylesheet like this:
|
||||
|
||||
```liquid
|
||||
{% raw %}{{ "/assets/style.css" | relative_url }}{% endraw %}
|
||||
```
|
||||
|
||||
The `relative_url` filter will prepend the [`baseurl`](https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/) value from your config file (as`blog` for instance) to the input. This is useful if your site is hosted at a subpath rather than at the root of the domain (for example, `http://mysite.com/blog/`).
|
||||
|
||||
You can also use an `absolute_url` filter. This filter will prepend the `url` *and* `baseurl` value to the input:
|
||||
|
||||
```liquid
|
||||
{% raw %}{{ "/assets/style.css" | absolute_url }}{% endraw %}
|
||||
```
|
||||
|
||||
Again, both `url` and `baseurl` can be defined in your site's config file, like this:
|
||||
|
||||
```
|
||||
url: http://mysite.com
|
||||
baseurl: /blog
|
||||
```
|
||||
|
||||
The result in the output will be `http://mysite.com/blog/assets/style.css`.
|
||||
|
||||
Note that the `url` property of any page begins with a forward slash (`/`), so omit this at the end of your `url` or `baseurl` property.
|
||||
|
||||
You don't have to prepend filters to link paths like this. You could also use relative links across your entire site. However you decide to code the paths to your assets, make sure they render correctly.
|
||||
|
||||
Does your local `default.html` page look good in your browser? Are all images, styles, and other elements showing up correctly? If so, great. Keep going. You can use this template as the layout for all your pages and posts or create as many templates as you need.
|
||||
|
||||
In the next section, you'll blank out the content of the layout and replace it with placeholder tags that get populated dynamically with your Jekyll pages.
|
||||
|
||||
## 2. Identify the content part of the layout
|
||||
|
||||
In `default.html`, find where the page content begins (usually at `h1` or `h2` tags). Replace the title that appears inside these tags with `{% raw %}{{ page.title }}{% endraw %}`.
|
||||
|
||||
Remove the content part (keep everything else: navigation menu, sidebar, footer, etc.) and replace it with `{% raw %}{{ content }}{% endraw %}`.
|
||||
|
||||
Check the layout again in your browser and make sure you didn't corrupt or alter it up by inadvertently removing a crucial `div` tag or other element. The only change should be to the title and page content, which are now blanked out or showing the placeholder tag.
|
||||
|
||||
## 3. Create a couple of files with front matter tags
|
||||
|
||||
Create a couple of files (`index.md` and `about.md`) in your root directory.
|
||||
|
||||
In your `index.md` file, add some front matter tags containing a `title` and `layout` property, like this:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: Home
|
||||
layout: default
|
||||
---
|
||||
|
||||
Some page content here...
|
||||
```
|
||||
|
||||
Create another page for testing called `about.md` with similar front matter tags.
|
||||
|
||||
{: .note .info}
|
||||
If you don't specify a layout in your pages, Jekyll will simply render that page as an unstyled basic HTML page.
|
||||
|
||||
## 4. Add a configuration file
|
||||
|
||||
Add a `_config.yml` file in your root directory. In `_config.yml`, you can optionally specify the markdown filter you want. By default, [kramdown](https://kramdown.gettalong.org/) is used (without the need to specify it). If no other filter is specified, your config file will automatically apply the following as a default setting:
|
||||
|
||||
```
|
||||
markdown: kramdown
|
||||
```
|
||||
|
||||
You can also specify [some options](https://kramdown.gettalong.org/converter/html.html) for kramdown to make it behave more like [GitHub Flavored Markdown (GFM)](https://github.github.com/gfm/):
|
||||
|
||||
```
|
||||
kramdown:
|
||||
input: GFM
|
||||
auto_ids: true
|
||||
hard_wrap: false
|
||||
syntax_highlighter: rouge
|
||||
```
|
||||
|
||||
## 5. Test your pages
|
||||
|
||||
Now run `jekyll serve` and toggle between your `index.html` and `about.html` pages. The default layout should load for both pages.
|
||||
|
||||
You've now extracted your content out into separate files and defined a common layout for pages.
|
||||
|
||||
You could define any number of layouts you want for pages. Then just identify the layout you want that particular page to use. For example:
|
||||
|
||||
```
|
||||
---
|
||||
title: Sample page
|
||||
layout: homepage
|
||||
---
|
||||
```
|
||||
|
||||
This page would then use the `homepage.html` template in the `_layouts` folder.
|
||||
|
||||
You can even set [default front matter tags]({% link _docs/configuration.md %}#front-matter-defaults) for pages, posts, or [collections]({% link _docs/collections.md %}) in your `_config.yml` file so that you don't have to specify the layout in the front matter variables. Anywayd, setting defaults is beyond the scope of this tutorial, let's get back to work.
|
||||
|
||||
## 6. Configure site variables
|
||||
|
||||
You already configured the page title using `{% raw %}{{ page.title }}{% endraw %}` tags. But there are more `title` tags to populate. Pages also have a [`title`](https://moz.com/learn/seo/title-tag) tag that appears in the browser tab or window. Typically you put the page title followed by the site title here.
|
||||
|
||||
In your `default.html` layout, look for the `title` tags below your `head` tags:
|
||||
|
||||
```
|
||||
<title>ACME Website</title>
|
||||
```
|
||||
|
||||
Insert the following site variables:
|
||||
|
||||
```
|
||||
{% raw %}<title>{{ page.title }} | {{ site.title }}</title>{% endraw %}
|
||||
```
|
||||
|
||||
Open `_config.yml` and add a `title` property for your site's name.
|
||||
|
||||
```
|
||||
title: ACME Website
|
||||
```
|
||||
|
||||
Any properties you add in your `_config.yml` file are accessible through the `site` namespace. Similarly, any properties in your page's front matter are accessible through the `page` namespace. Use dot notation after `site` or `page` to access the value.
|
||||
|
||||
Stop your Jekyll server with <kbd>Ctrl</kbd> + <kbd>C</kbd> and restart it. Verify that the `title` tags are populating correctly.
|
||||
|
||||
{: .note .info}
|
||||
Every time you modify your config file, you have to restart Jekyll for the changes to take effect. When you modify other files, Jekyll automatically picks up the changes when it rebuilds.
|
||||
|
||||
If you have other variables to populate in your site, rinse and repeat.
|
||||
|
||||
## 7. Show posts on a page
|
||||
|
||||
It's common to show a list of posts on the homepage. First, let's create some posts so that we have something to showcase.
|
||||
|
||||
Add some posts in a `_posts` folder following the standard `YYYY-MM-DD-title.md` post format:
|
||||
|
||||
* `2017-01-02-my-first-post.md`
|
||||
* `2017-01-15-my-second-post.md`
|
||||
* `2017-02-08-my-third-post.md`
|
||||
|
||||
In each post, add some basic content:
|
||||
|
||||
```
|
||||
---
|
||||
title: My First Post
|
||||
layout: default
|
||||
---
|
||||
|
||||
Some sample content...
|
||||
```
|
||||
|
||||
Now let's create a layout that will display the posts. Create a new file in `_layouts` called `home.html` and add the following logic:
|
||||
|
||||
```
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
{% raw %}{{ content }}
|
||||
<ul class="myposts">
|
||||
{% for post in site.posts %}
|
||||
<li><a href="{{ post.url }}">{{ post.title}}</a>
|
||||
<span class="postDate">{{ post.date | date: "%b %-d, %Y" }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
Create a file called `blog.md` in your root directory and specify the `home` layout:
|
||||
|
||||
```
|
||||
---
|
||||
title: Blog
|
||||
layout: home
|
||||
---
|
||||
```
|
||||
|
||||
In this case, contents of `blog.md` will be pushed into the `{% raw %}{{ content }}{% endraw %}` tag in the `home` layout. Then the `home` layout will be pushed into the `{% raw %}{{ content }}{% endraw %}` tag of the `default` layout.
|
||||
|
||||
|
||||
### How layouts work
|
||||
|
||||
When a layout specifies another layout, it means the content of the first layout will be stuffed into the `{% raw %}{{ content }}{% endraw %}` tag of the second layout. As an analogy, think of Russian dolls that fit into each other. Each layout fits into another layout that it specifies.
|
||||
|
||||
The following diagram shows how layouts work in Jekyll:
|
||||
|
||||
<img src="../../img/jekylllayoutconcept.png" alt="Concept of Jekyll layouts" />
|
||||
|
||||
{: .image-description}
|
||||
In this example, the content from a Markdown document `document.md` that specifies `layout: docs` gets pushed into the `{% raw %}{{ content }}{% endraw %}` tag of the layout file `docs.html`. Because the `docs` layout itself specifies `layout: page`, the content from `docs.html` gets pushed into the `{% raw %}{{ content }}{% endraw %}` tag in the layout file `page.html`. Finally because the `page` layout specifies `layout: default`, the content from `page.html` gets pushed into the `{% raw %}{{ content }}{% endraw %}` tag of the layout file `default.html`.
|
||||
|
||||
You don't need multiple layouts. You could just use one: `default`. You have options for how you design your site. In general, it's common to define one layout for pages and another layout for posts, but for both of these layouts to inherit the `default` template (which usually defines the top and bottom parts of the site).
|
||||
|
||||
In your browser, go to `blog.html` and see the list of posts.
|
||||
Note that you don't have to use the method described here. You could have simply added the `for` loop to any page, such as `index.md`, to display these posts. But given that you may have more complex logic for other features, it can be helpful to store your logic in templates separate from the page area where you frequently type your content.
|
||||
|
||||
{: .note .info}
|
||||
At minimum, a layout should contain `{% raw %}{{ content }}{% endraw %}`, which acts as a receiver for the *content* to be rendered.
|
||||
|
||||
### For loops
|
||||
|
||||
By the way, let's pause here to look at the `for` loop logic a little more closely. [For loops in Liquid](https://help.shopify.com/themes/liquid/tags/iteration-tags#for) are one of the most commonly used Liquid tags. *For loops* let you iterate through content in your Jekyll site and build out a result. The `for` loop also has [certain properties available](https://help.shopify.com/themes/liquid/objects/for-loops) (like first or last iteration) based on the loop's position in the loop as well.
|
||||
|
||||
We've only scratched the surface of what you can do with `for` loops in retrieving posts. For example, if you wanted to display posts from a specific category, you could do so by adding a `categories` property to your post's front matter and then look in those categories. Further, you could limit the number of results by adding a `limit` property. Here's an example:
|
||||
|
||||
```liquid
|
||||
{% raw %}<ul class="myposts">
|
||||
{% for post in site.categories.podcasts limit:3 %}
|
||||
<li><a href="{{ post.url }}">{{ post.title}}</a>
|
||||
<span class="postDate">{{ post.date | date: "%b %-d, %Y" }}</span>
|
||||
</li>
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
This loop would get the latest three posts that have a category called `podcasts` in the front matter.
|
||||
|
||||
## 8. Configure navigation
|
||||
|
||||
Now that you've configured posts, let's configure page navigation. Most websites have some navigation either in the sidebar or header area.
|
||||
|
||||
In this tutorial, we'll assume you've got a simple list of pages you want to generate. If you only have a handful of pages, you could list them by using a `for` loop to iterate through the `site.pages` object and then order them by a front matter property.
|
||||
|
||||
Identify the part of your code where the list of pages appears. Usually this is a `<ul>` element with various child `<li>` elements. Replace the code with the following:
|
||||
|
||||
```html
|
||||
{% raw %}<ul>
|
||||
{% assign mypages = site.pages | sort: "order" %}
|
||||
{% for page in mypages %}
|
||||
<li><a href="{{ page.url | absolute_url }}">{{ page.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
This example assumes each page would have front matter containing both a `title` and `order` property like this:
|
||||
|
||||
```
|
||||
---
|
||||
title: My page
|
||||
order: 2
|
||||
---
|
||||
```
|
||||
|
||||
Here the `order` property will define how the pages get sorted, with `1` appearing first in the list.
|
||||
|
||||
You could also iterate through a list of pages that you maintain in a separate data file. This might be more appropriate if you have a lot of pages, or you have other properties about the pages you want to store.
|
||||
|
||||
To manage page links this way, create a folder in your Jekyll project called `_data`. In this folder, create a file called e.g. `navigation.yml` with this content:
|
||||
|
||||
```yaml
|
||||
- title: Sample page 1
|
||||
url: /page-1-permalink/
|
||||
|
||||
- title: Sample page 2
|
||||
url: /page-2-permalink/
|
||||
|
||||
- title: Sample page 3
|
||||
url: /page-3-permalink/
|
||||
```
|
||||
|
||||
{: .note .info}
|
||||
If you never wrote any YAML before, you'll get quickly familiar with it. Take a look at [what you can do with YAML](https://learnxinyminutes.com/docs/yaml/).
|
||||
|
||||
You can store additional properties for each item in this data file as desired. Arrange the list items in the order you want them to appear.
|
||||
|
||||
To print the list of pages from the data file, use code like this:
|
||||
|
||||
```html
|
||||
{% raw %}<ul>
|
||||
{% for link in site.data.navigation %}
|
||||
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
If you have more sophisticated requirements around navigation, such as when building a documentation site, see the [detailed tutorial on navigation](/tutorials/navigation/).
|
||||
|
||||
## 9. Simplify your site with includes
|
||||
|
||||
Let's suppose your `default.html` file is massive and hard to work with. You can break up your layout by putting some of the HTML code in *include* files.
|
||||
|
||||
Add a folder called `_includes` in your root directory. In that folder, add a file there called `sidebar.html`.
|
||||
|
||||
Remove your sidebar code from your `default.html` layout and insert it into the `sidebar.html` file.
|
||||
|
||||
Where the sidebar code previously existed in `default.html`, pull in your "include" like this:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% include sidebar.html %}{% endraw %}
|
||||
```
|
||||
|
||||
You can break up other elements of your theme like this, such as your header or footer. Then you can apply these common elements to other layout files. This way you won't have duplicate code.
|
||||
|
||||
## 10. RSS feed
|
||||
|
||||
Your Jekyll site needs an RSS feed. Here's the [basic RSS feed syntax](http://www.w3schools.com/xml/xml_rss.asp). To create an RSS file in Jekyll, create a file called `feed.xml` in your root directory and add the following:
|
||||
|
||||
```xml
|
||||
---
|
||||
layout: null
|
||||
---
|
||||
|
||||
{% raw %}<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
|
||||
<channel>
|
||||
<title>{{ site.title }}</title>
|
||||
<link>{{ site.url }}</link>
|
||||
<description>{{ site.description }}</description>
|
||||
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
|
||||
{% for post in site.posts %}
|
||||
<item>
|
||||
<description>
|
||||
{{ post.content | escape | truncate: '400' }}
|
||||
</description>
|
||||
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
|
||||
<guid>
|
||||
{{ post.url | prepend: site.url }}
|
||||
</guid>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>{% endraw %}
|
||||
```
|
||||
|
||||
Make sure your `_config.yml` file has properties for `title`, `url`, and `description`.
|
||||
|
||||
This code uses a `for` loop to look through your last 20 posts. The content from the posts gets escaped and truncated to the last 400 characters using [Liquid filters](https://help.shopify.com/themes/liquid/filters).
|
||||
|
||||
In your `default.html` layout, look for a reference to the RSS or Atom feed in your header, and replace it with a reference to the file you just created. For example:
|
||||
|
||||
```html
|
||||
<link rel="alternate" type="application/rss+xml" href="{% raw %}{{ site.url }}{% endraw %}/feed.xml" title="{% raw %}{{ site.title }}{% endraw %}">
|
||||
```
|
||||
|
||||
You can also auto-generate your posts feed by adding a gem called [`jekyll-feed`][jekyll-feed]. This gem will also work on GitHub Pages.
|
||||
|
||||
## 11. Add a sitemap
|
||||
|
||||
Finally, add a [site map](https://www.sitemaps.org/protocol.html). Create a `sitemap.xml` file in your root directory and add this code:
|
||||
|
||||
```xml
|
||||
---
|
||||
layout: null
|
||||
search: exclude
|
||||
---
|
||||
|
||||
{% raw %}<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
|
||||
{% for page in site.pages %}
|
||||
<url>
|
||||
<loc>{{page.url}}</loc>
|
||||
<lastmod>{{site.time | date: '%Y-%m-%d' }}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.5</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
|
||||
{% for post in site.posts %}
|
||||
<url>
|
||||
<loc>{{post.url}}</loc>
|
||||
<lastmod>{{site.time | date: '%Y-%m-%d' }}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.5</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
|
||||
</urlset>{% endraw %}
|
||||
```
|
||||
|
||||
Again, we're using a `for` loop here to iterate through all posts and pages to add them to the sitemap.
|
||||
|
||||
You can also auto-generate your sitemap by adding a gem called [`jekyll-sitemap`][jekyll-sitemap]. This gem will also work on GitHub Pages.
|
||||
|
||||
## 12. Add external services
|
||||
|
||||
For other services you might need (such as contact forms, search, comments, and more), look for third-party services. For example, you might use the following:
|
||||
|
||||
* For comments: [Disqus](https://disqus.com/)
|
||||
* For a newsletter: [Tinyletter](https://tinyletter.com/)
|
||||
* For contact forms: [Wufoo](https://www.wufoo.com/)
|
||||
* For search: [Algolia Docsearch](https://community.algolia.com/docsearch/)
|
||||
|
||||
For more details on services for static sites, see the [Third Parties](https://learn.cloudcannon.com/jekyll-third-parties/) list and tutorials from CloudCannon.
|
||||
|
||||
Your Jekyll pages consist of HTML, CSS, and JavaScript, so pretty much any code you need to embed will work without a problem.
|
||||
|
||||
As you integrate code for these services, note that **if a page in your Jekyll site doesn't have front matter tags, Jekyll won't process any of the content in that page.** The page will just be passed to the `_site` folder when you build your site.
|
||||
|
||||
If you do want Jekyll to process some page content (for example, to populate a variable that you define in your site's config file), just add front matter tags to the page. If you don't want any layout applied to the page, specify `layout: null` like this:
|
||||
|
||||
```
|
||||
---
|
||||
layout: null
|
||||
---
|
||||
```
|
||||
|
||||
## 13. Conclusion
|
||||
|
||||
Although websites can implement more sophisticated features and functionality, we've covered the basics in this tutorial. You now have a fully functional Jekyll site.
|
||||
|
||||
To deploy your site, consider using [GitHub Pages](https://pages.github.com/), [Netlify](https://www.netlify.com/), [Amazon AWS S3](https://aws.amazon.com/s3/) using the [s3_website plugin](https://github.com/laurilehmijoki/s3_website), or just FTP your files to your web server.
|
||||
|
||||
You can also package your layouts, includes and assets into a Ruby `gem` and [make it a Jekyll theme]({% link _docs/themes.md %}#creating-a-theme).
|
||||
|
||||
## Additional resources
|
||||
|
||||
Here are some additional tutorials on creating Jekyll sites:
|
||||
|
||||
* [Convert a static site to Jekyll](http://jekyll.tips/jekyll-casts/converting-a-static-site-to-jekyll/)
|
||||
* [Building a Jekyll Site – Part 1 of 3: Converting a Static Website To Jekyll](https://css-tricks.com/building-a-jekyll-site-part-1-of-3/)
|
||||
|
||||
[jekyll-sitemap]: https://help.github.com/articles/sitemaps-for-github-pages/
|
||||
[jekyll-feed]: https://help.github.com/articles/atom-rss-feeds-for-github-pages/
|
||||
66
docs/_tutorials/custom-404-page.md
Normal file
66
docs/_tutorials/custom-404-page.md
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
layout: tutorials
|
||||
permalink: /tutorials/custom-404-page/
|
||||
title: Custom 404 Page
|
||||
---
|
||||
|
||||
You can easily serve custom 404 error pages with Jekyll to replace the default **Error 404 -- File Not Found** page displayed when one tries to access a broken link on your site.
|
||||
|
||||
|
||||
## On GitHub Pages
|
||||
|
||||
Any `404.html` at the **root of your `_site` directory** will be served automatically by GitHub Pages and the local WEBrick development server.
|
||||
|
||||
Simply add a `404.md` or `404.html` at the root of your site's source directory and include the YAML Front Matter data to use the theme's base layout.
|
||||
|
||||
If you plan to organize your files under subdirectories, the error page should have the following Front Matter Data, set: `permalink: /404.html`. This is to ensure that the compiled `404.html` resides at the root of your processed site, where it'll be picked by the server.
|
||||
|
||||
```
|
||||
---
|
||||
# example 404.md
|
||||
|
||||
layout: default
|
||||
permalink: /404.html
|
||||
---
|
||||
|
||||
# 404
|
||||
|
||||
Page not found! :(
|
||||
```
|
||||
|
||||
## Hosting on Apache Web Servers
|
||||
|
||||
Apache Web Servers load a configuration file named [`.htaccess`](http://www.htaccess-guide.com/) that modifies the functionality of these servers.
|
||||
|
||||
Simply add the following to your `.htaccess` file.
|
||||
|
||||
```
|
||||
ErrorDocument 404 /404.html
|
||||
```
|
||||
|
||||
With an `.htaccess` file, you have the freedom to place your error page within a subdirectory.
|
||||
|
||||
```
|
||||
ErrorDocument 404 /error_pages/404.html
|
||||
```
|
||||
|
||||
Where the path is relative to your site's domain.
|
||||
|
||||
More info on configuring Apache Error Pages can found in [official documentation](https://httpd.apache.org/docs/current/mod/core.html#errordocument).
|
||||
|
||||
|
||||
## Hosting on Nginx server
|
||||
|
||||
The procedure is just as simple as configuring Apache servers, but slightly different.
|
||||
|
||||
Add the following to the nginx configuration file, `nginx.conf`, which is usually located inside `/etc/nginx/` or `/etc/nginx/conf/`:
|
||||
|
||||
```
|
||||
server {
|
||||
error_page 404 /404.html;
|
||||
location /404.html {
|
||||
internal;
|
||||
}
|
||||
}
|
||||
```
|
||||
The `location` directive prevents users from directly browsing the 404.html page.
|
||||
35
docs/_tutorials/index.md
Normal file
35
docs/_tutorials/index.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
layout: tutorials
|
||||
title: Tutorials
|
||||
permalink: /tutorials/home/
|
||||
redirect_from: /tutorials/index.html
|
||||
---
|
||||
|
||||
In contrast to [Docs](/docs/home/), Tutorials provide more detailed, narrative instruction that cover a variety of Jekyll topics and scenarios. Tutorials might contain the following:
|
||||
|
||||
* Step-by-step processes through particular scenarios or challenges
|
||||
* Full walk-throughs using sample data, showing inputs and results from the sample data
|
||||
* Detailed explanation about the pros and cons for different Jekyll strategies
|
||||
* End-to-end instruction in developing a complete feature on a Jekyll site
|
||||
* Instruction that combines various techniques from across the docs
|
||||
|
||||
In short, tutorials aren't the core reference information in docs. They walk users through processes from beginning to end.
|
||||
|
||||
{: .info .note}
|
||||
**Note:** The Tutorials section is new, so there aren't many tutorials yet. You can add a tutorial here to help populate this section.
|
||||
|
||||
Some of these techniques might even guide you through a supporting tool, script, service, or other hack used with your Jekyll site. Feel free to include tutorials involving external services with Jekyll as well. However, note that Jekyll in no way endorses any third-party tools mentioned in tutorials.
|
||||
|
||||
## How to contribute a tutorial
|
||||
|
||||
We welcome your tutorial contributions. To add your tutorial:
|
||||
|
||||
1. Fork the Jekyll project by clicking the **Fork** button in the upper-right corner of the [jekyll/jekyll project Github repo](https://github.com/jekyll/jekyll/).
|
||||
2. Add your tutorial in the `_tutorials` collection.
|
||||
3. Make sure your tutorial has the same front matter items as other tutorial items.
|
||||
5. Add a reference to your tutorial filename in `_data/tutorials.yml`. This allows your tutorial to appear in the Tutorials sidebar.
|
||||
6. Follow the regular git workflow to submit the pull request.
|
||||
|
||||
When you submit your pull request, the Jekyll documentation team will review your contribution and either merge it or suggest edits.
|
||||
|
||||
|
||||
579
docs/_tutorials/navigation.md
Normal file
579
docs/_tutorials/navigation.md
Normal file
@@ -0,0 +1,579 @@
|
||||
---
|
||||
layout: tutorials
|
||||
permalink: /tutorials/navigation/
|
||||
title: Navigation
|
||||
---
|
||||
|
||||
If your Jekyll site has a lot of pages, you might want to create navigation for the pages. Instead of hard-coding navigation links, you can programmatically retrieve a list of pages to build the navigation for your site.
|
||||
|
||||
Although there's already information about [interacting with data files]({% link _docs/datafiles.md %}) in other Jekyll docs, this tutorial dives into building more robust navigation for your site.
|
||||
|
||||
There are two primary ways of retrieving pages on a Jekyll site:
|
||||
|
||||
* **Retrieve pages listed in a YAML data source**. Store the page data in a YAML (or JSON or CSV) file in the `_data` folder, loop through the YAML properties, and insert the values into your theme.
|
||||
* **Retrieve pages by looping through the page front matter**. Look through the front matter of your pages to identify certain properties, return those pages, and insert the pages' front matter values into your theme.
|
||||
|
||||
The examples that follow start with a basic navigation scenario and add more sophisticated elements to demonstrate different ways of returning the pages. In every scenario, you'll see 3 elements:
|
||||
|
||||
* YAML
|
||||
* Liquid
|
||||
* Result
|
||||
|
||||
The YAML file in the `_data` directory is called `samplelist.yml`.
|
||||
|
||||
The scenarios are as follows:
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
|
||||
## Scenario 1: Basic List
|
||||
|
||||
You want to return a basic list of pages.
|
||||
|
||||
**YAML**
|
||||
|
||||
```yaml
|
||||
docs_list_title: ACME Documentation
|
||||
docs:
|
||||
|
||||
- title: Introduction
|
||||
url: introduction.html
|
||||
|
||||
- title: Configuration
|
||||
url: configuration.html
|
||||
|
||||
- title: Deployment
|
||||
url: deployment.html
|
||||
```
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}<h2>{{ site.data.samplelist.docs_list_title }}</h2>
|
||||
<ul>
|
||||
{% for item in site.data.samplelist.docs %}
|
||||
<li><a href="{{ item.url }}" alt="{{ item.title }}">{{ item.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
<div class="highlight result">
|
||||
<h2>ACME Documentation</h2>
|
||||
<ul>
|
||||
<li><a href="#" alt="Introduction">Introduction</a></li>
|
||||
<li><a href="#" alt="Configuration">Configuration</a></li>
|
||||
<li><a href="#" alt="Deployment">Deployment</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{: .note .info }
|
||||
For the results in these fictitious samples, `#` is manually substituted for the actual link value to avoid 404 errors.)
|
||||
|
||||
When you use a `for` loop, you choose how you want to refer to the items you're looping through. The variable you choose (in this case, `item`) becomes how you access the properties of each item in the list. Dot notation is used to get a property of the item (for example, `item.url`).
|
||||
|
||||
The YAML content has two main types of formats that are relevant here:
|
||||
|
||||
* mapping
|
||||
* list
|
||||
|
||||
`docs_list_title: ACME Documentation` is a mapping. You access the value with `site.data.samplelist.docs_list_title`.
|
||||
|
||||
`docs:` is a list. The list begins each item with a hyphen. Unlike with mappings, you usually don't access list properties directly as you do with mappings. If you want to access a specific item in the list, you must identify the position in the list you want, following typical array notation. For example, `site.data.samplelist.docs[0]` would access the first item in the list. However, this is rarely done.
|
||||
|
||||
With lists, you usually use `for` loops to cycle through the list of items and do something with each item. With navigation menus, you usually insert each list item into `li` tags based on the navigation structure you're using in your HTML theme.
|
||||
|
||||
Each hyphen (`-`) indicates another item in the list. This example just has two properties with each list item: `title` and `url`. You can include as many properties as you want for each item. The order of properties at each position in the list doesn't matter.
|
||||
|
||||
## Scenario 2: Sorted list
|
||||
|
||||
Suppose you wanted to sort the list by the `title`. To do this, convert the reference to the `docs` collection to a variable, and then apply Liquid's `sort` filter to the variable:
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}{% assign doclist = site.data.samplelist.docs | sort: 'title' %}
|
||||
{% for item in doclist %}
|
||||
<li><a href="{{ item.url }}" alt="{{ item.title }}">{{ item.title }}</a></li>
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
<div class="highlight result">
|
||||
<li><a href="#" alt="Configuration">Configuration</a></li>
|
||||
<li><a href="#" alt="Deployment">Deployment</a></li>
|
||||
<li><a href="#" alt="Introduction">Introduction</a></li>
|
||||
</div>
|
||||
|
||||
The items now appear in alphabetical order. The `sort` property in the Liquid filter applies to the `title`, which is an actual property in the list. If `title` weren't a property, we would need to sort by another property.
|
||||
|
||||
See the [Liquid array filter](https://help.shopify.com/themes/liquid/filters/array-filters) for more filter options. Note that you can't simply use this syntax:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% for item in site.data.samplelist.docs | sort: "title" %}{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
You have to convert `site.data.samplelist.docs` to a variable first using either `assign` or `capture` tags.
|
||||
|
||||
## Scenario 3: Two-level navigation list
|
||||
|
||||
Suppose you want a more robust list that incorporates multiple sections of heading titles and subitems. To do this, add an additional level to each list item to store this information:
|
||||
|
||||
**YAML**
|
||||
|
||||
```yaml
|
||||
toc:
|
||||
- title: Group 1
|
||||
subfolderitems:
|
||||
- page: Thing 1
|
||||
url: /thing1.html
|
||||
- page: Thing 2
|
||||
url: /thing2.html
|
||||
- page: Thing 3
|
||||
url: /thing3.html
|
||||
- title: Group 2
|
||||
subfolderitems:
|
||||
- page: Piece 1
|
||||
url: /piece1.html
|
||||
- page: Piece 2
|
||||
url: /piece2.html
|
||||
- page: Piece 3
|
||||
url: /piece3.html
|
||||
- title: Group 3
|
||||
subfolderitems:
|
||||
- page: Widget 1
|
||||
url: /widget1.html
|
||||
- page: Widget 2
|
||||
url: /widget2.html
|
||||
- page: Widget 3
|
||||
url: /widget3.html
|
||||
```
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}{% for item in site.data.samplelist.toc %}
|
||||
<h3>{{ item.title }}</h3>
|
||||
<ul>
|
||||
{% for entry in item.subfolderitems %}
|
||||
<li><a href="{{ entry.url }}">{{ entry.page }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
<div class="highlight result">
|
||||
<h3>Group 1</h3>
|
||||
<ul>
|
||||
<li><a href="#">Thing 1</a></li>
|
||||
<li><a href="#">Thing 2</a></li>
|
||||
<li><a href="#">Thing 3</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Group 2</h3>
|
||||
<ul>
|
||||
<li><a href="#">Piece 1</a></li>
|
||||
<li><a href="#">Piece 2</a></li>
|
||||
<li><a href="#">Piece 3</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Group 3</h3>
|
||||
<ul>
|
||||
<li><a href="#">Widget 1</a></li>
|
||||
<li><a href="#">Widget 2</a></li>
|
||||
<li><a href="#">Widget 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
In this example, `Group 1` is the first list item. Within that list item, its subpages are included as a property that itself contains a list (`subfolderitems`).
|
||||
|
||||
The Liquid code looks through the first level with `for item in site.data.samplelist.toc`, and then looks through the second-level property with `for entry in item.subfolderitems`. Just as `item` is an arbitrary name for the items we're looping through, so is `entry`.
|
||||
|
||||
## Scenario 4: Three-level navigation list
|
||||
|
||||
Building on the previous section, let's add one more level of depth (`subsubfolderitems`) to the list. The formatting will get more complex here, but the principles are the same.
|
||||
|
||||
**YAML**
|
||||
|
||||
```yaml
|
||||
toc2:
|
||||
- title: Group 1
|
||||
subfolderitems:
|
||||
- page: Thing 1
|
||||
url: /thing1.html
|
||||
- page: Thing 2
|
||||
url: /thing2.html
|
||||
subsubfolderitems:
|
||||
- page: Subthing 1
|
||||
url: /subthing1.html
|
||||
- page: Subthing 2
|
||||
url: /subthing2.html
|
||||
- page: Thing 3
|
||||
url: /thing3.html
|
||||
- title: Group 2
|
||||
subfolderitems:
|
||||
- page: Piece 1
|
||||
url: /piece1.html
|
||||
- page: Piece 2
|
||||
url: /piece2.html
|
||||
- page: Piece 3
|
||||
url: /piece3.html
|
||||
subsubfolderitems:
|
||||
- page: Subpiece 1
|
||||
url: /subpiece1.html
|
||||
- page: Subpiece2
|
||||
url: /subpiece2.html
|
||||
- title: Group 3
|
||||
subfolderitems:
|
||||
- page: Widget 1
|
||||
url: /widget1.html
|
||||
subsubfolderitems:
|
||||
- page: Subwidget 1
|
||||
url: /subwidget1.html
|
||||
- page: Subwidget 2
|
||||
url: /subwidget2.html
|
||||
- page: Widget 2
|
||||
url: /widget2.html
|
||||
- page: Widget 3
|
||||
url: /widget3.html
|
||||
```
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}<div>
|
||||
{% if site.data.samplelist.toc2[0] %}
|
||||
{% for item in site.data.samplelist.toc2 %}
|
||||
<h3>{{ item.title }}</h3>
|
||||
{% if item.subfolderitems[0] %}
|
||||
<ul>
|
||||
{% for entry in item.subfolderitems %}
|
||||
<li><a href="{{ entry.url }}">{{ entry.page }}</a></li>
|
||||
{% if entry.subsubfolderitems[0] %}
|
||||
<ul>
|
||||
{% for subentry in entry.subsubfolderitems %}
|
||||
<li><a href="{{ subentry.url }}">{{ subentry.page }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
<div class="highlight result">
|
||||
<div>
|
||||
<h3>Group 1</h3>
|
||||
<ul>
|
||||
<li><a href="#">Thing 1</a></li>
|
||||
<li><a href="#">Thing 2</a></li>
|
||||
<ul>
|
||||
<li><a href="#">Subthing 1</a></li>
|
||||
<li><a href="#">Subthing 2</a></li>
|
||||
</ul>
|
||||
<li><a href="#">Thing 3</a></li>
|
||||
</ul>
|
||||
<h3>Group 2</h3>
|
||||
<ul>
|
||||
<li><a href="#">Piece 1</a></li>
|
||||
<li><a href="#">Piece 2</a></li>
|
||||
<li><a href="#">Piece 3</a></li>
|
||||
<ul>
|
||||
<li><a href="#">Subpiece 1</a></li>
|
||||
<li><a href="#">Subpiece2</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
<h3>Group 3</h3>
|
||||
<ul>
|
||||
<li><a href="#">Widget 1</a></li>
|
||||
<ul>
|
||||
<li><a href="#">Subwidget 1</a></li>
|
||||
<li><a href="#">Subwidget 2</a></li>
|
||||
</ul>
|
||||
<li><a href="#">Widget 2</a></li>
|
||||
<li><a href="#">Widget 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
In this example, `if site.data.samplelist.toc2[0]` is used to ensure that the YAML level actually contains items. If there isn't anything at the `[0]` position, we can skip looking in this level.
|
||||
|
||||
<div class="note">
|
||||
<h5>ProTip: Line up <code>for</code> loops and <code>if</code> statements</h5>
|
||||
<p>To keep the code clear, line up the beginning and ending Liquid tags, such as the <code>for</code> loops and <code>if</code> statements. This way you know when the open tags have been closed. If the code will appear in a Markdown page, keep the opening and closing HTML tags flush against the left edge so that the Markdown filter won't treat the content as a code sample. If necessary, you can wrap the entire code sample in a <code>div</code> tag to ensure the code has HTML tags that bookend the code.</p>
|
||||
</div>
|
||||
|
||||
## Scenario 5: Using a page variable to select the YAML list
|
||||
|
||||
Suppose your sidebar will differ based on various documentation sets. You might have 3 different products on your site, and so you want 3 different sidebars — each unique for that product.
|
||||
|
||||
You can store the name of the sidebar list in your page front matter and then pass that value into the list dynamically.
|
||||
|
||||
**Page front matter**
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My page
|
||||
sidebar: toc
|
||||
---
|
||||
```
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}<ul>
|
||||
{% for item in site.data.samplelist[page.sidebar] %}
|
||||
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
**Result**
|
||||
|
||||
<div class="highlight result">
|
||||
<ul>
|
||||
<li><a href="#">Introduction</a></li>
|
||||
<li><a href="#">Configuration</a></li>
|
||||
<li><a href="#">Deployment</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
In this scenario, we want to pass values from the page's front matter into a `for` loop that contains a variable. When the assigned variable isn't a string but rather a data reference, you must use brackets (instead of curly braces) to refer to the front matter's value.
|
||||
|
||||
For more information, see [Expressions and Variables](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#expressions-and-variables) in Liquid's documentation. Brackets are used in places where dot notation can't be used. You can also read more details in this [Stack Overflow answer](http://stackoverflow.com/questions/4968406/javascript-property-access-dot-notation-vs-brackets/4968448#4968448).
|
||||
|
||||
## Scenario 6: Applying the active class for the current page
|
||||
|
||||
In addition to inserting items from the YAML data file into your list, you also usually want to highlight the current link if the user is viewing that page. You do this by inserting an `active` class for items that match the current page URL.
|
||||
|
||||
**CSS**
|
||||
```css
|
||||
.result li.active a {
|
||||
color: lightgray;
|
||||
cursor: default;
|
||||
}
|
||||
```
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}{% for item in site.data.samplelist.docs %}
|
||||
<li class="{% if item.url == page.url %}active{% endif %}">
|
||||
<a href="{{ item.url }}">{{ item.title }}</a>
|
||||
</li>
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
<style>
|
||||
.result li.active a {
|
||||
color: lightgray;
|
||||
cursor: default;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="highlight result">
|
||||
<li class=""><a href="#">Introduction</a></li>
|
||||
<li class=""><a href="#">Configuration</a></li>
|
||||
<li class="active"><a href="#">Deployment</a></li>
|
||||
</div>
|
||||
|
||||
In this case, assume `Deployment` is the current page.
|
||||
|
||||
To make sure the `item.url` (stored in the YAML file) matches the `page.url`, it can be helpful to print the `{% raw %}{{ page.url }}{% endraw %}` to the page.
|
||||
|
||||
## Scenario 6: Including items conditionally
|
||||
|
||||
You might want to include items conditionally in your list. For example, maybe you have multiple site outputs and only want to include the sidebar item for certain outputs. You can add properties in each list item and then use those properties to conditionally include the content.
|
||||
|
||||
**YAML**
|
||||
```yaml
|
||||
docs2_list_title: ACME Documentation
|
||||
docs2:
|
||||
|
||||
- title: Introduction
|
||||
url: introduction.html
|
||||
version: 1
|
||||
|
||||
- title: Configuration
|
||||
url: configuration.html
|
||||
version: 1
|
||||
|
||||
- title: Deployment
|
||||
url: deployment.html
|
||||
version: 2
|
||||
```
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}<ul>
|
||||
{% for item in site.data.samplelist.docs2 %}
|
||||
{% if item.version == 1 %}
|
||||
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
<div class="highlight result">
|
||||
<ul>
|
||||
<li><a href="#">Introduction</a></li>
|
||||
<li><a href="#">Configuration</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
The `Deployment` page is excluded because its `version` is `2`.
|
||||
|
||||
## Scenario 7: Retrieving items based on front matter properties
|
||||
|
||||
If you don't want to store your navigation items in a YAML file in your `_data` folder, you can use `for` loops to look through the YAML front matter of each page or collection and get the content based on properties in the front matter.
|
||||
|
||||
In this scenario, suppose we have a collection called `_docs`. Collections are often better than pages because they allow you to narrow the list of what you're looping through. (Try to avoid scenarios where you loop through large numbers of items, since it will increase your build time. [Collections]({% link _docs/collections.md %}) help you narrow the scope.)
|
||||
|
||||
In our scenario, there are 6 docs in the `docs` collection: Sample 1, Sample 2, Topic 1, Topic 2, Widget 1, and Widget 2.
|
||||
|
||||
Each doc in the collection contains at least 3 properties in the front matter:
|
||||
|
||||
* `title`
|
||||
* `category`
|
||||
* `order`
|
||||
|
||||
The front matter for each page is as follows (consolidated here for brevity):
|
||||
|
||||
```yaml
|
||||
---
|
||||
Title: Sample 1
|
||||
category: getting-started
|
||||
order: 1
|
||||
---
|
||||
|
||||
---
|
||||
Title: Sample 2
|
||||
category: getting-started
|
||||
order: 2
|
||||
---
|
||||
|
||||
---
|
||||
Title: Topic 1
|
||||
category: configuration
|
||||
order: 1
|
||||
---
|
||||
|
||||
---
|
||||
Title: Topic 2
|
||||
category: configuration
|
||||
order: 2
|
||||
---
|
||||
|
||||
---
|
||||
Title: Widget 1
|
||||
category: deployment
|
||||
order: 1
|
||||
---
|
||||
|
||||
---
|
||||
Title: Widget 2
|
||||
category: deployment
|
||||
order: 2
|
||||
---
|
||||
```
|
||||
|
||||
Note that even though `category` is used in the doc front matter, `category` is not a built-in variable like it is with posts. In other words, you cannot look directly inside `category` with `site.docs.category`.
|
||||
|
||||
If you wanted to simply get all docs in the collection for a specific category, you could use a `for` loop with an `if` condition to check for a specific category:
|
||||
|
||||
```liquid
|
||||
{% raw %}<h3>Getting Started</h3>
|
||||
<ul>
|
||||
{% for doc in site.docs %}
|
||||
{% if doc.category == "getting-started" %}
|
||||
<li><a href="{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>{% endraw %}
|
||||
```
|
||||
|
||||
The result would be as follows:
|
||||
|
||||
<div class="highlight result">
|
||||
<h3>Getting Started</h3>
|
||||
<ul>
|
||||
<li><a href="#">Sample1</a></li>
|
||||
<li><a href="#">Sample2</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
This might be useful if you're setting up a knowledge base and have dozens of topics in each category, with each category displaying on its own page.
|
||||
|
||||
But let's say you want to sort the items by category and group them under the category name, without hard-coding the category names. To achieve this, you could use two filters:
|
||||
|
||||
* `group_by`
|
||||
* `sort`
|
||||
|
||||
Here's the code for getting lists of pages grouped under their corresponding category headers:
|
||||
|
||||
**Liquid**
|
||||
|
||||
```liquid
|
||||
{% raw %}{% assign mydocs = site.docs | group_by: 'category' %}
|
||||
{% for cat in mydocs %}
|
||||
<h2>{{ cat.name | capitalize }}</h2>
|
||||
<ul>
|
||||
{% assign items = cat.items | sort: 'order' %}
|
||||
{% for item in items %}
|
||||
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
**Result**
|
||||
|
||||
<div class="highlight result">
|
||||
<h2>Getting-started</h2>
|
||||
<ul>
|
||||
<li><a href="#">Sample2</a></li>
|
||||
<li><a href="#">Sample1</a></li>
|
||||
</ul>
|
||||
<h2>Configuration</h2>
|
||||
<ul>
|
||||
<li><a href="#">Topic2</a></li>
|
||||
<li><a href="#">Topic1</a></li>
|
||||
</ul>
|
||||
<h2>Deployment</h2>
|
||||
<ul>
|
||||
<li><a href="#">Widget2</a></li>
|
||||
<li><a href="#">Widget1</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Let's walk through the code. First, we assign a variable (`mydocs`) to the collection content (`site.docs`).
|
||||
|
||||
The `group_by` filter groups the collection content by `category`. More specifically, the `group_by` filter converts `mydocs` into an array with `name`, `items`, and `size` properties, somewhat like this:
|
||||
|
||||
```yaml
|
||||
[
|
||||
{"name": "getting-started", "items": [Sample 1, Sample 2],"size": 2},
|
||||
{"name": "configuration", "items": [Topic 1, Topic 2], "size": 2},
|
||||
{"name": "deployment", "items": [Widget 1, Widget 2, "size": 2}
|
||||
]
|
||||
```
|
||||
|
||||
Using `for cat in mydocs`, we look through each item in the `mydocs` array and print the category `name`.
|
||||
|
||||
After getting the category name, we assign the variable `items` for the docs and use the `sort` filter to arrange the docs by their `order` property. The dot notation `cat.items` is used because we're accessing the content in the `items` array. The `sort` filter orders the items by their numbers in ascending order.
|
||||
|
||||
The `for item in items` loop looks through each `item` and gets the `title` and `url` to form the list item link.
|
||||
|
||||
For more details on the `group_by` filter, see [Jekyll's Templates documentation](https://jekyllrb.com/docs/templates/) as well as [this Siteleaf tutorial](https://www.siteleaf.com/blog/advanced-liquid-group-by/). For more details on the `sort` filter, see [sort](https://help.shopify.com/themes/liquid/filters/array-filters#sort) in Liquid's documentation.
|
||||
|
||||
Whether you use properties in your doc's front matter to retrieve your pages or a YAML data file, in both cases you can programmatically build a more robust navigation for your site.
|
||||
143
docs/_tutorials/orderofinterpretation.md
Normal file
143
docs/_tutorials/orderofinterpretation.md
Normal file
@@ -0,0 +1,143 @@
|
||||
---
|
||||
layout: tutorials
|
||||
permalink: /tutorials/orderofinterpretation/
|
||||
title: Order of interpretation
|
||||
---
|
||||
|
||||
Jekyll's main job is to convert your raw text files into a static website. It does this by rendering Liquid, Markdown, and other transforms as it generates the static HTML output.
|
||||
|
||||
In this conversion process, it's important to understand Jekyll's order of interpretation. By "order of interpretation," we mean what gets rendered, in what order, and what rules get applied in converting content.
|
||||
|
||||
If an element isn't converting, you can troubleshoot the problem by analyzing the order of interpretation.
|
||||
|
||||
## Order of interpretations
|
||||
|
||||
Jekyll converts your site in the following order:
|
||||
|
||||
1. **Site variables**. Jekyll looks across your files and populates [site variables]({% link _docs/variables.md %}), such as `site`, `page`, `post`, and collection objects. (From these objects, Jekyll determines the values for permalinks, tags, categories, and other details.)
|
||||
|
||||
2. **Liquid**. Jekyll processes any [Liquid](https://github.com/Shopify/liquid) formatting in pages that contain [front matter]({% link _docs/frontmatter.md %}). You can identify Liquid as follows:
|
||||
* **Liquid tags** start with `{% raw %}{%{% endraw %}` and end with a `{% raw %}%}{% endraw %}`. For example: `{% raw %}{% highlight %}{% endraw %}` or `{% raw %}{% seo %}{% endraw %}`. Tags can define blocks or be inline. Block-defining tags will also come with a corresponding end tag — for example, `{% raw %}{% endhighlight %}{% endraw %}`.
|
||||
* **Liquid variables** start and end with double curly braces. For example: `{% raw %}{{ site.myvariable }}{% endraw %}` or `{% raw %}{{ content }}{% endraw %}`.
|
||||
* **Liquid filters** start with a pipe character (`|`) and can only be used within **Liquid variables** after the variable string. For example: the `relative_url` filter in `{% raw %}{{ "css/main.css" | relative_url }}{% endraw %}`.
|
||||
|
||||
3. **Markdown**. Jekyll converts Markdown to HTML using the Markdown filter specified in your config file. Files must have a Markdown file extension and front matter in order for Jekyll to convert them.
|
||||
|
||||
4. **Layout**. Jekyll pushes content into the layouts specified by the page's front matter (or as specified in the config file). The content from each page gets pushed into the `{% raw %}{{ content }}{% endraw %}` tags within the layouts.
|
||||
|
||||
5. **Files**. Jekyll writes the generated content into files in the [directory structure]({% link _docs/structure.md %}) in `_site`. Pages, posts, and collections get structured based on their [permalink]({% link _docs/permalinks.md %}) setting. Directories that begin with `_` (such as `_includes` and `_data`) are usually hidden in the output.
|
||||
|
||||
## Scenarios where incorrect configurations create problems
|
||||
|
||||
For the most part, you don't have to think about the order of interpretation when building your Jekyll site. These details only become important to know when something isn't rendering.
|
||||
|
||||
The following scenarios highlight potential problems you might encounter. These problems come from misunderstanding the order of interpretation and can be easily fixed.
|
||||
|
||||
### Variable on page not rendered because variable is assigned in layout
|
||||
|
||||
In your layout file (`_layouts/default.html`), suppose you have a variable assigned:
|
||||
|
||||
```
|
||||
{% raw %}{% assign myvar = "joe" %}{% endraw %}
|
||||
```
|
||||
|
||||
On a page that uses the layout, you reference that variable:
|
||||
|
||||
```
|
||||
{% raw %}{{ myvar }}{% endraw %}
|
||||
```
|
||||
|
||||
The variable won't render because the page's order of interpretation is to render Liquid first and later process the Layout. When the Liquid rendering happens, the variable assignment isn't available.
|
||||
|
||||
To make the code work, you could put the variable assignment into the page's front matter.
|
||||
|
||||
### Markdown in include file not processed
|
||||
|
||||
Suppose you have a Markdown file at `_includes/mycontent.md`. In the Markdown file, you have some Markdown formatting:
|
||||
|
||||
```markdown
|
||||
This is a list:
|
||||
* first item
|
||||
* second item
|
||||
```
|
||||
|
||||
You include the file into an HTML file as follows:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% include mycontent.md %}{% endraw %}
|
||||
```
|
||||
|
||||
The Markdown is not processed because first the Liquid (`include` tag) gets processed, inserting `mycontent.md` into the HTML file. *Then* the Markdown would get processed.
|
||||
|
||||
But because the content is included into an *HTML* page, the Markdown isn't rendered. The Markdown filter processes content only in Markdown files.
|
||||
|
||||
To make the code work, use HTML formatting in includes that are inserted into HTML files.
|
||||
|
||||
Note that `highlight` tags don't require Markdown to process. Suppose your include contains the following:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% highlight javascript %}
|
||||
console.log('alert');
|
||||
{% endhighlight %}{% endraw %}
|
||||
```
|
||||
|
||||
The `highlight` tag *is* Liquid. (Liquid passes the content to Rouge or Pygments for syntax highlighting.) As a result, this code will actually convert to HTML with syntax highlighting. Jekyll does not need the Markdown filter to process `highlight` tags.
|
||||
|
||||
### Liquid mixed with JavaScript isn't rendered
|
||||
|
||||
Suppose you try to mix Liquid's `assign` tag with JavaScript, like this:
|
||||
|
||||
```javascript
|
||||
{% raw %}<button onclick="someFunction()">Click me</button>
|
||||
|
||||
<p id="intro"></p>
|
||||
|
||||
<script>
|
||||
{% assign someContent = "This is some content" %}
|
||||
function someFunction() {
|
||||
document.getElementById("intro").innerHTML = someContent;
|
||||
}
|
||||
</script>{% endraw %}
|
||||
```
|
||||
|
||||
This won't work because the `assign` tag is only available during the Liquid rendering phase of the site. In this JavaScript example, the script executes when a user clicks a button ("Click me") on the HTML page. At that time, the Liquid logic is no longer available, so the `assign` tag wouldn't return anything.
|
||||
|
||||
However, you can use Jekyll's site variables or Liquid to *populate* a script that is executed at a later time. For example, suppose you have the following property in your front matter: `someContent: "This is some content"`. You could do this:
|
||||
|
||||
```js
|
||||
{% raw %}<button onclick="someFunction()">Click me</button>
|
||||
|
||||
<p id="intro"></p>
|
||||
|
||||
<script>
|
||||
|
||||
function someFunction() {
|
||||
document.getElementById("intro").innerHTML = "{{ page.someContent }}";
|
||||
}
|
||||
</script>{% endraw %}
|
||||
```
|
||||
|
||||
When Jekyll builds the site, this `someContent` property populates the script's values, converting `{% raw %}{{ page.someContent }}{% endraw %}` to `"This is some content"`.
|
||||
|
||||
The key to remember is that Liquid renders when Jekyll builds your site. Liquid is not available at run-time in the browser when a user executes an event.
|
||||
|
||||
## Note about using Liquid in YAML
|
||||
|
||||
There's one more detail to remember: Liquid does not render when embedded in YAML files or front matter. (This isn't related to order of interpretation, but it's worth mentioning because it's a common question about element rendering.)
|
||||
|
||||
For example, suppose you have a `highlight` tag in your `_data/mydata.yml` file:
|
||||
|
||||
```
|
||||
{% raw %}myvalue: >
|
||||
{% highlight javascript %}
|
||||
console.log('alert');
|
||||
{% endhighlight %}{% endraw %}
|
||||
```
|
||||
|
||||
On a page, you try to insert the value:
|
||||
|
||||
```
|
||||
{% raw %}{{ site.data.mydata.myvalue }}{% endraw %}
|
||||
```
|
||||
|
||||
This would render only as a string rather than a code sample with syntax highlighting. To make the code render, consider using an include instead.
|
||||
@@ -14,6 +14,10 @@ Known breaking changes are listed in the upgrading docs.
|
||||
|
||||
Our guide to Jekyll covering installation, writing, customization, deployment, and more.
|
||||
|
||||
### [Tutorials](/tutorials/home)
|
||||
|
||||
Similar to documentation, but more detailed scenario-based walk-throughs covering a variety of topics.
|
||||
|
||||
### [View source](https://github.com/jekyll/jekyll/wiki/sites)
|
||||
|
||||
Learn from the source of others' Jekyll-powered sites.
|
||||
|
||||
BIN
docs/img/jekylllayoutconcept.png
Normal file
BIN
docs/img/jekylllayoutconcept.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -1 +1 @@
|
||||
3.4.3
|
||||
3.5.1
|
||||
|
||||
50
docs/philosophy.md
Normal file
50
docs/philosophy.md
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: Philosophy
|
||||
---
|
||||
|
||||
Jekyll offers a unique philosophy when approaching the problem of static
|
||||
site generation. This core philosophy drives development and product
|
||||
decisions. When a contributor, maintainer, or user asks herself what Jekyll
|
||||
is about, the following principles should come to mind:
|
||||
|
||||
### 1. No Magic
|
||||
|
||||
Jekyll is not magic. A user should be able to understand the underlying
|
||||
processes that make up the Jekyll build without much reading. It should
|
||||
do only what you ask it to and nothing more. When a user takes a certain
|
||||
action, the outcome should be easily understandable and focused.
|
||||
|
||||
### 2. It "Just Works"
|
||||
|
||||
The out-of-the-box experience should be that it "just works." Run
|
||||
`gem install jekyll` and it should build any Jekyll site that it's given.
|
||||
Features like auto-regeneration and settings like the markdown renderer
|
||||
should represent sane defaults that work perfectly for the vast majority of
|
||||
cases. The burden of initial configuration should not be placed on the user.
|
||||
|
||||
### 3. Content is King
|
||||
|
||||
Why is Jekyll so loved by content creators? It focuses on content first and
|
||||
foremost, making the process of publishing content on the Web easy. Users
|
||||
should find the management of their content enjoyable and simple.
|
||||
|
||||
### 4. Stability
|
||||
|
||||
If a user's site builds today, it should build tomorrow.
|
||||
Backwards-compatibility should be strongly preferred over breaking changes.
|
||||
Breaking changes should be made to support a strong practical goal, and
|
||||
breaking changes should never be made to drive forward "purity" of the
|
||||
codebase, or other changes purely to make the maintainers' lives easier.
|
||||
Breaking changes provide a significant amount of friction between upgrades
|
||||
and reduce the confidence of users in this software, and should thus be
|
||||
avoided unless absolutely necessary.
|
||||
Upon breaking changes, provide a clear path for users to upgrade.
|
||||
|
||||
### 5. Small & Extensible
|
||||
|
||||
The core of Jekyll should be simple and small, and extensibility should be
|
||||
a first-class feature to provide added functionality from community
|
||||
contributors. The core should be kept to features used by at least 90% of
|
||||
users–everything else should be provided as a plugin. New features should
|
||||
be shipped as plugins and focus should be put on creating extensible core
|
||||
API's to support rich plugins.
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
STDOUT.sync = true
|
||||
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
||||
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
||||
|
||||
require "jekyll"
|
||||
require "mercenary"
|
||||
@@ -25,13 +25,13 @@ Mercenary.program(:jekyll) do |p|
|
||||
"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|
|
||||
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g, ver_constraint|
|
||||
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."
|
||||
" version #{ver_constraint} to use the 'jekyll #{cmd}' command."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -94,6 +94,51 @@ Feature: Collections
|
||||
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _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" unless Windows
|
||||
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/yaml_with_dots.md" in "_site/index.html" if on Windows
|
||||
|
||||
Scenario: Rendered collection with document with future date
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content |
|
||||
| Rover | 2007-12-31 | content for Rover. |
|
||||
| Fido | 2120-12-31 | content for Fido. |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: true
|
||||
"""
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "content for Rover" in "_site/puppies/rover.html"
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
When I run jekyll build --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/fido.html" file should exist
|
||||
|
||||
Scenario: Hidden collection with document with future date
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content |
|
||||
| Rover | 2007-12-31 | content for Rover. |
|
||||
| Fido | 2120-12-31 | content for Fido. |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: false
|
||||
"""
|
||||
And I have a "foo.txt" file that contains "random static file"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/rover.html" file should not exist
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
When I run jekyll build --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/puppies/fido.html" file should not exist
|
||||
|
||||
Scenario: All the documents
|
||||
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
|
||||
And I have fixture collections
|
||||
|
||||
@@ -59,6 +59,20 @@ Feature: Data
|
||||
And I should see "Jack" in "_site/index.html"
|
||||
And I should see "Leon" in "_site/index.html"
|
||||
|
||||
Scenario: autoload *.tsv files in _data directory
|
||||
Given I have a _data directory
|
||||
And I have a "_data/members.tsv" file with content:
|
||||
"""
|
||||
name age
|
||||
Jack 28
|
||||
Leon 34
|
||||
"""
|
||||
And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
|
||||
When I run jekyll build
|
||||
Then the "_site/index.html" file should exist
|
||||
And I should see "Jack" in "_site/index.html"
|
||||
And I should see "Leon" in "_site/index.html"
|
||||
|
||||
Scenario: autoload *.yml files in _data directory with space in file name
|
||||
Given I have a _data directory
|
||||
And I have a "_data/team members.yml" file with content:
|
||||
|
||||
@@ -40,6 +40,44 @@ Feature: Rendering
|
||||
And I should not see "Ahoy, indeed!" in "_site/index.css"
|
||||
And I should not see "Ahoy, indeed!" in "_site/index.js"
|
||||
|
||||
Scenario: Ignore defaults and don't place documents with layout set to 'none'
|
||||
Given I have a "index.md" page with layout "none" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a _trials directory
|
||||
And I have a "_trials/no-layout.md" page with layout "none" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a "_trials/test.md" page with layout "null" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a none layout that contains "{{ content }}Welcome!"
|
||||
And I have a page layout that contains "{{ content }}Check this out!"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| author | John Doe |
|
||||
| collections | {trials: {output: true}} |
|
||||
| defaults | [{scope: {path: ""}, values: {layout: page}}] |
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should not see "Welcome!" in "_site/trials/no-layout.html"
|
||||
And I should not see "Check this out!" in "_site/trials/no-layout.html"
|
||||
But I should see "Check this out!" in "_site/trials/test.html"
|
||||
And I should see "Welcome!" in "_site/index.html"
|
||||
|
||||
Scenario: Don't place documents with layout set to 'none'
|
||||
Given I have a "index.md" page with layout "none" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a _trials directory
|
||||
And I have a "_trials/no-layout.md" page with layout "none" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a "_trials/test.md" page with layout "page" that contains "Hi there, {{ site.author }}!"
|
||||
And I have a none layout that contains "{{ content }}Welcome!"
|
||||
And I have a page layout that contains "{{ content }}Check this out!"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| author | John Doe |
|
||||
| collections | {trials: {output: true}} |
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should not see "Welcome!" in "_site/trials/no-layout.html"
|
||||
But I should see "Check this out!" in "_site/trials/test.html"
|
||||
And I should see "Welcome!" in "_site/index.html"
|
||||
|
||||
Scenario: Render liquid in Sass
|
||||
Given I have an "index.scss" page that contains ".foo-bar { color:{{site.color}}; }"
|
||||
And I have a configuration file with "color" set to "red"
|
||||
|
||||
@@ -44,9 +44,11 @@ Feature: Site configuration
|
||||
Given I have an "Rakefile" file that contains "I want to be excluded"
|
||||
And I have an "README" file that contains "I want to be excluded"
|
||||
And I have an "index.html" file that contains "I want to be included"
|
||||
And I have a "Gemfile" file that contains "gem 'include-me'"
|
||||
And I have a configuration file with "exclude" set to "['Rakefile', 'README']"
|
||||
When I run jekyll build
|
||||
Then I should see "I want to be included" in "_site/index.html"
|
||||
And the "_site/Gemfile" file should exist
|
||||
And the "_site/Rakefile" file should not exist
|
||||
And the "_site/README" file should not exist
|
||||
|
||||
@@ -170,12 +172,14 @@ Feature: Site configuration
|
||||
| entry2 | 2013-04-10 03:14 -0400 | post | content for entry2. |
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the _site directory should exist
|
||||
And I should see "Page Layout: 2" in "_site/index.html"
|
||||
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" unless Windows
|
||||
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T22:22:00-05:00" in "_site/2013/04/09/entry1.html" if on Windows
|
||||
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" unless Windows
|
||||
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T02:14:00-05:00" in "_site/2013/04/10/entry2.html" if on Windows
|
||||
And I should see "Post Layout: <p>content for entry1.</p>\n built at" in "_site/2013/04/09/entry1.html"
|
||||
And I should see "Post Layout: <p>content for entry2.</p>\n built at" in "_site/2013/04/10/entry2.html"
|
||||
And I should see date "2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" unless Windows
|
||||
And I should see date "2013-04-09T22:22:00-05:00" in "_site/2013/04/09/entry1.html" if on Windows
|
||||
And I should see date "2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" unless Windows
|
||||
And I should see date "2013-04-10T02:14:00-05:00" in "_site/2013/04/10/entry2.html" if on Windows
|
||||
|
||||
Scenario: Generate proper dates with explicitly set timezone (different than posts' time)
|
||||
Given I have a _layouts directory
|
||||
|
||||
@@ -93,6 +93,19 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given(%r!^I have the following documents? under the (.*) collection:$!) do |folder, table|
|
||||
table.hashes.each do |input_hash|
|
||||
title = slug(input_hash["title"])
|
||||
filename = "#{title}.md"
|
||||
dest_folder = "_#{folder}"
|
||||
|
||||
path = File.join(dest_folder, filename)
|
||||
File.write(path, file_content_from_hash(input_hash))
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given(%r!^I have a configuration file with "(.*)" set to "(.*)"$!) do |key, value|
|
||||
config = \
|
||||
if source_dir.join("_config.yml").exist?
|
||||
@@ -246,6 +259,30 @@ end
|
||||
|
||||
#
|
||||
|
||||
Then(%r!^I should see date "(.*)" in "(.*)" unless Windows$!) do |text, file|
|
||||
step %(the "#{file}" file should exist)
|
||||
regexp = Regexp.new(text)
|
||||
if Jekyll::Utils::Platforms.really_windows? && !dst_active?
|
||||
expect(file_contents(file)).not_to match regexp
|
||||
else
|
||||
expect(file_contents(file)).to match regexp
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then(%r!^I should see date "(.*)" in "(.*)" if on Windows$!) do |text, file|
|
||||
step %(the "#{file}" file should exist)
|
||||
regexp = Regexp.new(text)
|
||||
if Jekyll::Utils::Platforms.really_windows? && !dst_active?
|
||||
expect(file_contents(file)).to match regexp
|
||||
else
|
||||
expect(file_contents(file)).not_to match regexp
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Then(%r!^I should see exactly "(.*)" in "(.*)"$!) do |text, file|
|
||||
step %(the "#{file}" file should exist)
|
||||
expect(file_contents(file).strip).to eq text
|
||||
|
||||
@@ -55,7 +55,7 @@ end
|
||||
def all_steps_to_path(path)
|
||||
source = source_dir
|
||||
dest = Pathname.new(path).expand_path
|
||||
paths = []
|
||||
paths = []
|
||||
|
||||
dest.ascend do |f|
|
||||
break if f == source
|
||||
@@ -163,3 +163,14 @@ def seconds_agnostic_time(time)
|
||||
hour, minutes, = time.split(":")
|
||||
"#{hour}:#{minutes}"
|
||||
end
|
||||
|
||||
# Helper method for Windows
|
||||
def dst_active?
|
||||
config = Jekyll.configuration("quiet" => true)
|
||||
ENV["TZ"] = config["timezone"]
|
||||
dst = Time.now.isdst
|
||||
|
||||
# reset variable to default state on Windows
|
||||
ENV["TZ"] = nil
|
||||
dst
|
||||
end
|
||||
|
||||
@@ -46,6 +46,24 @@ Feature: Writing themes
|
||||
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: A theme with assets
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an assets directory
|
||||
And I have an "assets/application.coffee" file that contains "From your site."
|
||||
And I have an "assets/base.js" file that contains "From your site."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "From your site." in "_site/assets/application.coffee"
|
||||
And I should see "From your site." in "_site/assets/base.js"
|
||||
|
||||
Scenario: Requiring dependencies of a theme
|
||||
Given I have a configuration file with "theme" set to "test-dependency-theme"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/test.txt" file should exist
|
||||
|
||||
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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# coding: utf-8
|
||||
lib = File.expand_path("../lib", __FILE__)
|
||||
|
||||
lib = File.expand_path("lib", __dir__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require "jekyll/version"
|
||||
|
||||
@@ -7,7 +8,7 @@ Gem::Specification.new do |s|
|
||||
s.specification_version = 2 if s.respond_to? :specification_version=
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.rubygems_version = "2.2.2"
|
||||
s.required_ruby_version = ">= 2.0.0"
|
||||
s.required_ruby_version = ">= 2.1.0"
|
||||
|
||||
s.name = "jekyll"
|
||||
s.version = Jekyll::VERSION
|
||||
@@ -34,9 +35,9 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0")
|
||||
s.add_runtime_dependency("jekyll-watch", "~> 1.1")
|
||||
s.add_runtime_dependency("kramdown", "~> 1.3")
|
||||
s.add_runtime_dependency("liquid", "~> 3.0")
|
||||
s.add_runtime_dependency("liquid", "~> 4.0")
|
||||
s.add_runtime_dependency("mercenary", "~> 0.3.3")
|
||||
s.add_runtime_dependency("pathutil", "~> 0.9")
|
||||
s.add_runtime_dependency("rouge", "~> 1.7")
|
||||
s.add_runtime_dependency("rouge", "~> #{ENV["ROUGE_VERSION"] || "1.7"}")
|
||||
s.add_runtime_dependency("safe_yaml", "~> 1.0")
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$LOAD_PATH.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
|
||||
$LOAD_PATH.unshift __dir__ # For use/testing when no gem is installed
|
||||
|
||||
# Require all of the Ruby files in the given directory.
|
||||
#
|
||||
@@ -6,7 +6,7 @@ $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")
|
||||
glob = File.join(__dir__, path, "*.rb")
|
||||
Dir[glob].sort.each do |f|
|
||||
require f
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ module Jekyll
|
||||
if docs.respond_to?(method.to_sym)
|
||||
Jekyll.logger.warn "Deprecation:",
|
||||
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
|
||||
Jekyll.logger.warn "", "Called by #{caller.first}."
|
||||
Jekyll.logger.warn "", "Called by #{caller(0..0)}."
|
||||
docs.public_send(method.to_sym, *args, &blck)
|
||||
else
|
||||
super
|
||||
@@ -72,7 +72,7 @@ module Jekyll
|
||||
def entries
|
||||
return [] unless exists?
|
||||
@entries ||=
|
||||
Utils.safe_glob(collection_dir, ["**", "*"]).map do |entry|
|
||||
Utils.safe_glob(collection_dir, ["**", "*"], File::FNM_DOTMATCH).map do |entry|
|
||||
entry["#{collection_dir}/"] = ""
|
||||
entry
|
||||
end
|
||||
|
||||
@@ -37,6 +37,7 @@ module Jekyll
|
||||
#
|
||||
# Returns a full Jekyll configuration
|
||||
def configuration_from_options(options)
|
||||
return options if options.is_a?(Jekyll::Configuration)
|
||||
Jekyll.configuration(options)
|
||||
end
|
||||
|
||||
@@ -45,6 +46,7 @@ module Jekyll
|
||||
# c - the Jekyll::Command to add these options to
|
||||
#
|
||||
# Returns nothing
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def add_build_options(c)
|
||||
c.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]",
|
||||
Array, "Custom configuration file"
|
||||
@@ -65,7 +67,10 @@ module Jekyll
|
||||
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 "strict_front_matter", "--strict_front_matter",
|
||||
"Fail if errors are present in front matter"
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
require "addressable/uri"
|
||||
|
||||
module Jekyll
|
||||
module Commands
|
||||
class Doctor < Command
|
||||
@@ -36,6 +38,7 @@ module Jekyll
|
||||
!deprecated_relative_permalinks(site),
|
||||
!conflicting_urls(site),
|
||||
!urls_only_differ_by_case(site),
|
||||
proper_site_url?(site),
|
||||
].all?
|
||||
end
|
||||
|
||||
@@ -91,6 +94,15 @@ module Jekyll
|
||||
urls_only_differ_by_case
|
||||
end
|
||||
|
||||
def proper_site_url?(site)
|
||||
url = site.config["url"]
|
||||
[
|
||||
url_exists?(url),
|
||||
url_valid?(url),
|
||||
url_absolute(url),
|
||||
].all?
|
||||
end
|
||||
|
||||
private
|
||||
def collect_urls(urls, things, destination)
|
||||
things.each do |thing|
|
||||
@@ -110,6 +122,29 @@ module Jekyll
|
||||
(memo[dest.downcase] ||= []) << dest
|
||||
end
|
||||
end
|
||||
|
||||
def url_exists?(url)
|
||||
return true unless url.nil? || url.empty?
|
||||
Jekyll.logger.warn "Warning:", "You didn't set an URL in the config file, "\
|
||||
"you may encounter problems with some plugins."
|
||||
false
|
||||
end
|
||||
|
||||
def url_valid?(url)
|
||||
Addressable::URI.parse(url)
|
||||
true
|
||||
rescue
|
||||
Jekyll.logger.warn "Warning:", "The site URL does not seem to be valid, "\
|
||||
"check the value of `url` in your config file."
|
||||
false
|
||||
end
|
||||
|
||||
def url_absolute(url)
|
||||
return true if Addressable::URI.parse(url).absolute?
|
||||
Jekyll.logger.warn "Warning:", "Your site URL does not seem to be absolute, "\
|
||||
"check the value of `url` in your config file."
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -61,7 +61,6 @@ module Jekyll
|
||||
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
|
||||
@@ -71,7 +70,7 @@ ruby RUBY_VERSION
|
||||
#
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
gem "jekyll", "#{Jekyll::VERSION}"
|
||||
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"
|
||||
@@ -82,7 +81,7 @@ gem "minima", "~> 2.0"
|
||||
|
||||
# If you have any plugins, put them here!
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-feed", "~> 0.6"
|
||||
gem "jekyll-feed", "~> 0.6"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
@@ -109,11 +108,12 @@ RUBY
|
||||
|
||||
def create_sample_files(path)
|
||||
FileUtils.cp_r site_template + "/.", path
|
||||
FileUtils.chmod_R "u+w", path
|
||||
FileUtils.rm File.expand_path(scaffold_path, path)
|
||||
end
|
||||
|
||||
def site_template
|
||||
File.expand_path("../../site_template", File.dirname(__FILE__))
|
||||
File.expand_path("../../site_template", __dir__)
|
||||
end
|
||||
|
||||
def scaffold_path
|
||||
|
||||
@@ -32,11 +32,12 @@ 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)
|
||||
|
||||
config = configuration_from_options(opts)
|
||||
if Jekyll.env == "development"
|
||||
config["url"] = default_url(config)
|
||||
end
|
||||
[Build, Serve].each { |klass| klass.process(config) }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -135,7 +136,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def format_url(ssl_enabled, address, port, baseurl = nil)
|
||||
format("%{prefix}://%{address}:%{port}%{baseurl}", {
|
||||
format("%<prefix>s://%<address>s:%<port>i%<baseurl>s", {
|
||||
:prefix => ssl_enabled ? "https" : "http",
|
||||
:address => address,
|
||||
:port => port,
|
||||
@@ -233,7 +234,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def mime_types
|
||||
file = File.expand_path("../mime.types", File.dirname(__FILE__))
|
||||
file = File.expand_path("../mime.types", __dir__)
|
||||
WEBrick::HTTPUtils.load_mime_types(file)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,7 @@ module Jekyll
|
||||
|
||||
def search_file(req, res, basename)
|
||||
# /file.* > /file/index.html > /file.html
|
||||
super || super(req, res, "#{basename}.html")
|
||||
super || super(req, res, ".html") || super(req, res, "#{basename}.html")
|
||||
end
|
||||
|
||||
# rubocop:disable Style/MethodName
|
||||
|
||||
@@ -6,70 +6,72 @@ 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" => %w(
|
||||
node_modules vendor/bundle/ vendor/cache/ vendor/gems/ vendor/ruby/
|
||||
"safe" => false,
|
||||
"include" => [".htaccess"],
|
||||
"exclude" => %w(
|
||||
Gemfile Gemfile.lock node_modules vendor/bundle/ vendor/cache/ vendor/gems/
|
||||
vendor/ruby/
|
||||
),
|
||||
"keep_files" => [".git", ".svn"],
|
||||
"encoding" => "utf-8",
|
||||
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
||||
"keep_files" => [".git", ".svn"],
|
||||
"encoding" => "utf-8",
|
||||
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
||||
"strict_front_matter" => false,
|
||||
|
||||
# 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" => [],
|
||||
"plugins" => [],
|
||||
|
||||
# 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" => nil, # this mounts at /, i.e. no subdirectory
|
||||
"show_dir_listing" => false,
|
||||
"detach" => false, # default to not detaching the server
|
||||
"port" => "4000",
|
||||
"host" => "127.0.0.1",
|
||||
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
|
||||
"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" => [],
|
||||
|
||||
"liquid" => {
|
||||
"liquid" => {
|
||||
"error_mode" => "warn",
|
||||
},
|
||||
|
||||
"rdiscount" => {
|
||||
"rdiscount" => {
|
||||
"extensions" => [],
|
||||
},
|
||||
|
||||
"redcarpet" => {
|
||||
"redcarpet" => {
|
||||
"extensions" => [],
|
||||
},
|
||||
|
||||
"kramdown" => {
|
||||
"kramdown" => {
|
||||
"auto_ids" => true,
|
||||
"toc_levels" => "1..6",
|
||||
"entity_output" => "as_char",
|
||||
@@ -136,7 +138,7 @@ module Jekyll
|
||||
SafeYAML.load_file(filename) || {}
|
||||
else
|
||||
raise ArgumentError, "No parser for '#{filename}' is available.
|
||||
Use a .toml or .y(a)ml file instead."
|
||||
Use a .y(a)ml or .toml file instead."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -228,9 +230,10 @@ module Jekyll
|
||||
# Provide backwards-compatibility
|
||||
check_auto(config)
|
||||
check_server(config)
|
||||
check_plugins(config)
|
||||
|
||||
renamed_key "server_port", "port", config
|
||||
renamed_key "plugins", "plugins_dir", config
|
||||
renamed_key "gems", "plugins", config
|
||||
renamed_key "layouts", "layouts_dir", config
|
||||
renamed_key "data_source", "data_dir", config
|
||||
|
||||
@@ -384,5 +387,24 @@ module Jekyll
|
||||
"`_config.yml` file."
|
||||
end
|
||||
end
|
||||
|
||||
# Private: Checks if the `plugins` config is a String
|
||||
#
|
||||
# config - the config hash
|
||||
#
|
||||
# Raises a Jekyll::Errors::InvalidConfigurationError if the config `plugins`
|
||||
# is a string
|
||||
private
|
||||
def check_plugins(config)
|
||||
if config.key?("plugins") && config["plugins"].is_a?(String)
|
||||
Jekyll.logger.error "Configuration Error:", "You specified the" \
|
||||
" `plugins` config in your configuration file as a string, please" \
|
||||
" use an array instead. If you wanted to set the directory of your" \
|
||||
" plugins, use the config key `plugins_dir` instead."
|
||||
raise Jekyll::Errors::InvalidConfigurationError,
|
||||
"'plugins' should not be a string, but was: " \
|
||||
"#{config["plugins"].inspect}. Use 'plugins_dir' instead."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the String prefix.
|
||||
def self.highlighter_prefix(highlighter_prefix = nil)
|
||||
if !defined?(@highlighter_prefix) || !highlighter_prefix.nil?
|
||||
unless defined?(@highlighter_prefix) && highlighter_prefix.nil?
|
||||
@highlighter_prefix = highlighter_prefix
|
||||
end
|
||||
@highlighter_prefix
|
||||
@@ -22,7 +22,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the String suffix.
|
||||
def self.highlighter_suffix(highlighter_suffix = nil)
|
||||
if !defined?(@highlighter_suffix) || !highlighter_suffix.nil?
|
||||
unless defined?(@highlighter_suffix) && highlighter_suffix.nil?
|
||||
@highlighter_suffix = highlighter_suffix
|
||||
end
|
||||
@highlighter_suffix
|
||||
|
||||
@@ -43,13 +43,9 @@ module Jekyll
|
||||
|
||||
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
|
||||
)
|
||||
hash.keys.each do |key|
|
||||
hash[key.to_sym] = hash[key]
|
||||
make_accessible(hash[key]) if hash[key].is_a?(Hash)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -86,7 +82,7 @@ module Jekyll
|
||||
private
|
||||
def strip_coderay_prefix(hash)
|
||||
hash.each_with_object({}) do |(key, val), hsh|
|
||||
cleaned_key = key.gsub(%r!\Acoderay_!, "")
|
||||
cleaned_key = key.to_s.gsub(%r!\Acoderay_!, "")
|
||||
|
||||
if key != cleaned_key
|
||||
Jekyll::Deprecator.deprecation_message(
|
||||
|
||||
@@ -48,8 +48,10 @@ module Jekyll
|
||||
end
|
||||
rescue SyntaxError => e
|
||||
Jekyll.logger.warn "YAML Exception reading #{filename}: #{e.message}"
|
||||
raise e if self.site.config["strict_front_matter"]
|
||||
rescue => e
|
||||
Jekyll.logger.warn "Error reading file #{filename}: #{e.message}"
|
||||
raise e if self.site.config["strict_front_matter"]
|
||||
end
|
||||
|
||||
self.data ||= {}
|
||||
@@ -69,7 +71,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def validate_permalink!(filename)
|
||||
if self.data["permalink"] && self.data["permalink"].empty?
|
||||
if self.data["permalink"] && self.data["permalink"].to_s.empty?
|
||||
raise Errors::InvalidPermalinkError, "Invalid permalink in #{filename}"
|
||||
end
|
||||
end
|
||||
@@ -78,7 +80,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the transformed contents.
|
||||
def transform
|
||||
_renderer.transform
|
||||
_renderer.convert(content)
|
||||
end
|
||||
|
||||
# Determine the extension depending on content_type.
|
||||
@@ -158,7 +160,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if extname == .coffee, false otherwise.
|
||||
def coffeescript_file?
|
||||
".coffee" == ext
|
||||
ext == ".coffee"
|
||||
end
|
||||
|
||||
# Determine whether the file should be rendered with Liquid.
|
||||
|
||||
@@ -5,7 +5,7 @@ module Jekyll
|
||||
def process(args)
|
||||
arg_is_present? args, "--server", "The --server command has been replaced by the \
|
||||
'serve' subcommand."
|
||||
arg_is_present? args, "--serve", "The --server command has been replaced by the \
|
||||
arg_is_present? args, "--serve", "The --serve command has been replaced by the \
|
||||
'serve' subcommand."
|
||||
arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \
|
||||
use the 'build' subcommand."
|
||||
@@ -38,7 +38,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def deprecation_message(message)
|
||||
Jekyll.logger.error "Deprecation:", message
|
||||
Jekyll.logger.warn "Deprecation:", message
|
||||
end
|
||||
|
||||
def defaults_deprecate_type(old, current)
|
||||
@@ -46,6 +46,5 @@ module Jekyll
|
||||
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use \
|
||||
'type: #{current}'."
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
module Jekyll
|
||||
class Document
|
||||
include Comparable
|
||||
extend Forwardable
|
||||
|
||||
attr_reader :path, :site, :extname, :collection
|
||||
attr_accessor :content, :output
|
||||
|
||||
def_delegator :self, :read_post_data, :post_read
|
||||
|
||||
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m
|
||||
DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$!
|
||||
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$!
|
||||
@@ -147,7 +150,7 @@ module Jekyll
|
||||
#
|
||||
# Returns true if extname == .coffee, false otherwise.
|
||||
def coffeescript_file?
|
||||
".coffee" == extname
|
||||
extname == ".coffee"
|
||||
end
|
||||
|
||||
# Determine whether the file should be rendered with Liquid.
|
||||
@@ -158,12 +161,19 @@ module Jekyll
|
||||
!(coffeescript_file? || yaml_file?)
|
||||
end
|
||||
|
||||
# Determine whether the file should be rendered with a layout.
|
||||
#
|
||||
# Returns true if the Front Matter specifies that `layout` is set to `none`.
|
||||
def no_layout?
|
||||
data["layout"] == "none"
|
||||
end
|
||||
|
||||
# Determine whether the file should be placed into layouts.
|
||||
#
|
||||
# Returns false if the document is either an asset file or a yaml file,
|
||||
# true otherwise.
|
||||
# Returns false if the document is set to `layouts: none`, or is either an
|
||||
# asset file or a yaml file. Returns true otherwise.
|
||||
def place_in_layout?
|
||||
!(asset_file? || yaml_file?)
|
||||
!(asset_file? || yaml_file? || no_layout?)
|
||||
end
|
||||
|
||||
# The URL template where the document would be accessible.
|
||||
@@ -256,11 +266,8 @@ module Jekyll
|
||||
merge_defaults
|
||||
read_content(opts)
|
||||
read_post_data
|
||||
rescue SyntaxError => e
|
||||
Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{e.message}"
|
||||
rescue => e
|
||||
raise e if e.is_a? Jekyll::Errors::FatalException
|
||||
Jekyll.logger.error "Error:", "could not read file #{path}: #{e.message}"
|
||||
handle_read_error(e)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -364,7 +371,7 @@ module Jekyll
|
||||
if data.key?(method.to_s)
|
||||
Jekyll::Deprecator.deprecation_message "Document##{method} is now a key "\
|
||||
"in the #data hash."
|
||||
Jekyll::Deprecator.deprecation_message "Called by #{caller.first}."
|
||||
Jekyll::Deprecator.deprecation_message "Called by #{caller(0..0)}."
|
||||
data[method.to_s]
|
||||
else
|
||||
super
|
||||
@@ -375,6 +382,38 @@ module Jekyll
|
||||
data.key?(method.to_s) || super
|
||||
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(%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
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
def merge_categories!(other)
|
||||
if other.key?("categories") && !other["categories"].nil?
|
||||
@@ -422,6 +461,19 @@ module Jekyll
|
||||
generate_excerpt
|
||||
end
|
||||
|
||||
private
|
||||
def handle_read_error(error)
|
||||
if error.is_a? SyntaxError
|
||||
Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{error.message}"
|
||||
else
|
||||
Jekyll.logger.error "Error:", "could not read file #{path}: #{error.message}"
|
||||
end
|
||||
|
||||
if site.config["strict_front_matter"] || error.is_a?(Jekyll::Errors::FatalException)
|
||||
raise error
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def populate_title
|
||||
if relative_path =~ DATE_FILENAME_MATCHER
|
||||
@@ -445,41 +497,6 @@ module Jekyll
|
||||
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?
|
||||
|
||||
@@ -19,6 +19,10 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
def key?(key)
|
||||
(@obj.collections.key?(key) && key != "posts") || super
|
||||
end
|
||||
|
||||
def posts
|
||||
@site_posts ||= @obj.posts.docs.sort { |a, b| b <=> a }
|
||||
end
|
||||
|
||||
@@ -36,7 +36,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
def included?(entry)
|
||||
glob_include?(site.include, entry)
|
||||
glob_include?(site.include, entry) ||
|
||||
glob_include?(site.include, File.basename(entry))
|
||||
end
|
||||
|
||||
def special?(entry)
|
||||
|
||||
@@ -9,9 +9,10 @@ module Jekyll
|
||||
InvalidYAMLFrontMatterError = Class.new(FatalException)
|
||||
MissingDependencyException = Class.new(FatalException)
|
||||
|
||||
InvalidDateError = Class.new(FatalException)
|
||||
InvalidPostNameError = Class.new(FatalException)
|
||||
PostURLError = Class.new(FatalException)
|
||||
InvalidURLError = Class.new(FatalException)
|
||||
InvalidDateError = Class.new(FatalException)
|
||||
InvalidPostNameError = Class.new(FatalException)
|
||||
PostURLError = Class.new(FatalException)
|
||||
InvalidURLError = Class.new(FatalException)
|
||||
InvalidConfigurationError = Class.new(FatalException)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,12 +23,25 @@ module Jekyll
|
||||
require name
|
||||
rescue LoadError
|
||||
Jekyll.logger.debug "Couldn't load #{name}. Skipping."
|
||||
yield(name) if block_given?
|
||||
yield(name, version_constraint(name)) if block_given?
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# The version constraint required to activate a given gem.
|
||||
# Usually the gem version requirement is "> 0," because any version
|
||||
# will do. In the case of jekyll-docs, however, we require the exact
|
||||
# same version as Jekyll.
|
||||
#
|
||||
# Returns a String version constraint in a parseable form for
|
||||
# RubyGems.
|
||||
def version_constraint(gem_name)
|
||||
return "= #{Jekyll::VERSION}" if gem_name.to_s.eql?("jekyll-docs")
|
||||
"> 0"
|
||||
end
|
||||
|
||||
#
|
||||
# Require a gem or gems. If it's not present, show a very nice error
|
||||
# message that explains everything and is much more helpful than the
|
||||
|
||||
@@ -80,6 +80,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the formatted String.
|
||||
def date_to_long_string(date)
|
||||
return date if date.to_s.empty?
|
||||
time(date).strftime("%d %B %Y")
|
||||
end
|
||||
|
||||
@@ -94,6 +95,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the formatted String.
|
||||
def date_to_xmlschema(date)
|
||||
return date if date.to_s.empty?
|
||||
time(date).xmlschema
|
||||
end
|
||||
|
||||
@@ -108,6 +110,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the formatted String.
|
||||
def date_to_rfc822(date)
|
||||
return date if date.to_s.empty?
|
||||
time(date).rfc822
|
||||
end
|
||||
|
||||
@@ -280,10 +283,11 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
def pop(array, input = 1)
|
||||
def pop(array, num = 1)
|
||||
return array unless array.is_a?(Array)
|
||||
num = Liquid::Utils.to_integer(num)
|
||||
new_ary = array.dup
|
||||
new_ary.pop(input.to_i || 1)
|
||||
new_ary.pop(num)
|
||||
new_ary
|
||||
end
|
||||
|
||||
@@ -294,10 +298,11 @@ module Jekyll
|
||||
new_ary
|
||||
end
|
||||
|
||||
def shift(array, input = 1)
|
||||
def shift(array, num = 1)
|
||||
return array unless array.is_a?(Array)
|
||||
num = Liquid::Utils.to_integer(num)
|
||||
new_ary = array.dup
|
||||
new_ary.shift(input.to_i || 1)
|
||||
new_ary.shift(num)
|
||||
new_ary
|
||||
end
|
||||
|
||||
@@ -310,11 +315,11 @@ module Jekyll
|
||||
|
||||
def sample(input, num = 1)
|
||||
return input unless input.respond_to?(:sample)
|
||||
n = num.to_i rescue 1
|
||||
if n == 1
|
||||
num = Liquid::Utils.to_integer(num) rescue 1
|
||||
if num == 1
|
||||
input.sample
|
||||
else
|
||||
input.sample(n)
|
||||
input.sample(num)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -345,25 +350,20 @@ module Jekyll
|
||||
|
||||
private
|
||||
def time(input)
|
||||
case input
|
||||
when Time
|
||||
input.clone
|
||||
when Date
|
||||
input.to_time
|
||||
when String
|
||||
Time.parse(input) rescue Time.at(input.to_i)
|
||||
when Numeric
|
||||
Time.at(input)
|
||||
else
|
||||
date = Liquid::Utils.to_date(input)
|
||||
unless date.respond_to?(:to_time)
|
||||
raise Errors::InvalidDateError,
|
||||
"Invalid Date: '#{input.inspect}' is not a valid datetime."
|
||||
end.localtime
|
||||
end
|
||||
date.to_time.dup.localtime
|
||||
end
|
||||
|
||||
private
|
||||
def item_property(item, property)
|
||||
if item.respond_to?(:to_liquid)
|
||||
item.to_liquid[property.to_s]
|
||||
property.to_s.split(".").reduce(item.to_liquid) do |subvalue, attribute|
|
||||
subvalue[attribute]
|
||||
end
|
||||
elsif item.respond_to?(:data)
|
||||
item.data[property.to_s]
|
||||
else
|
||||
@@ -402,9 +402,11 @@ module Jekyll
|
||||
operator = parser.consume?(:comparison)
|
||||
condition =
|
||||
if operator
|
||||
Liquid::Condition.new(left_expr, operator, parser.expression)
|
||||
Liquid::Condition.new(Liquid::Expression.parse(left_expr),
|
||||
operator,
|
||||
Liquid::Expression.parse(parser.expression))
|
||||
else
|
||||
Liquid::Condition.new(left_expr)
|
||||
Liquid::Condition.new(Liquid::Expression.parse(left_expr))
|
||||
end
|
||||
parser.consume(:end_of_string)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def parse_expression(str)
|
||||
Liquid::Variable.new(str, {})
|
||||
Liquid::Variable.new(str, Liquid::ParseContext.new)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -10,9 +10,12 @@ module Jekyll
|
||||
# Returns the absolute URL as a String.
|
||||
def absolute_url(input)
|
||||
return if input.nil?
|
||||
return input if Addressable::URI.parse(input).absolute?
|
||||
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
|
||||
Addressable::URI.parse(
|
||||
site.config["url"].to_s + relative_url(input)
|
||||
).normalize.to_s
|
||||
end
|
||||
|
||||
# Produces a URL relative to the domain root based on site.baseurl.
|
||||
@@ -22,14 +25,29 @@ module Jekyll
|
||||
# Returns a URL relative to the domain root as a String.
|
||||
def relative_url(input)
|
||||
return if input.nil?
|
||||
site = @context.registers[:site]
|
||||
parts = [site.config["baseurl"], input]
|
||||
parts = [sanitized_baseurl, input]
|
||||
Addressable::URI.parse(
|
||||
parts.compact.map { |part| ensure_leading_slash(part.to_s) }.join
|
||||
).normalize.to_s
|
||||
end
|
||||
|
||||
# Strips trailing `/index.html` from URLs to create pretty permalinks
|
||||
#
|
||||
# input - the URL with a possible `/index.html`
|
||||
#
|
||||
# Returns a URL with the trailing `/index.html` removed
|
||||
def strip_index(input)
|
||||
return if input.nil? || input.to_s.empty?
|
||||
input.sub(%r!/index\.html?$!, "/")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sanitized_baseurl
|
||||
site = @context.registers[:site]
|
||||
site.config["baseurl"].to_s.chomp("/")
|
||||
end
|
||||
|
||||
def ensure_leading_slash(input)
|
||||
return input if input.nil? || input.empty? || input.start_with?("/")
|
||||
"/#{input}"
|
||||
|
||||
@@ -60,7 +60,7 @@ module Jekyll
|
||||
|
||||
# register a single hook to be called later, internal API
|
||||
def self.register_one(owner, event, priority, &block)
|
||||
@registry[owner] ||={
|
||||
@registry[owner] ||= {
|
||||
:post_init => [],
|
||||
:pre_render => [],
|
||||
:post_render => [],
|
||||
|
||||
@@ -32,7 +32,7 @@ module Jekyll
|
||||
|
||||
row_data.each_index do |cell_index|
|
||||
str << "-" * widths[cell_index]
|
||||
str << "-+-" unless cell_index == row_data.length-1
|
||||
str << "-+-" unless cell_index == row_data.length - 1
|
||||
end
|
||||
|
||||
str << "\n"
|
||||
@@ -49,7 +49,7 @@ module Jekyll
|
||||
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"
|
||||
|
||||
@@ -127,7 +127,7 @@ module Jekyll
|
||||
# layouts - The Hash of {"name" => "layout"}.
|
||||
# site_payload - The site payload Hash.
|
||||
#
|
||||
# Returns nothing.
|
||||
# Returns String rendered page.
|
||||
def render(layouts, site_payload)
|
||||
site_payload["page"] = to_liquid
|
||||
site_payload["paginator"] = pager.to_liquid
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user