jekyll-docs 2.5.3 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll-docs.rb +34 -4
- data/site/CNAME +1 -0
- data/site/README.md +16 -0
- data/site/_config.yml +21 -0
- data/site/_data/docs.yml +47 -0
- data/site/_docs/assets.md +93 -0
- data/site/_docs/collections.md +380 -0
- data/site/_docs/configuration.md +677 -0
- data/site/_docs/continuous-integration.md +221 -0
- data/site/_docs/contributing.md +124 -0
- data/site/_docs/datafiles.md +151 -0
- data/site/_docs/deployment-methods.md +192 -0
- data/site/_docs/drafts.md +20 -0
- data/site/_docs/extras.md +22 -0
- data/site/_docs/frontmatter.md +191 -0
- data/site/_docs/github-pages.md +134 -0
- data/site/_docs/history.md +2131 -0
- data/site/_docs/index.md +56 -0
- data/site/_docs/installation.md +106 -0
- data/site/_docs/migrations.md +9 -0
- data/site/_docs/pages.md +84 -0
- data/site/_docs/pagination.md +221 -0
- data/site/_docs/permalinks.md +307 -0
- data/site/_docs/plugins.md +891 -0
- data/site/_docs/posts.md +237 -0
- data/site/_docs/quickstart.md +27 -0
- data/site/_docs/resources.md +46 -0
- data/site/_docs/sites.md +29 -0
- data/site/_docs/static_files.md +52 -0
- data/site/_docs/structure.md +211 -0
- data/site/_docs/templates.md +425 -0
- data/site/_docs/troubleshooting.md +207 -0
- data/site/_docs/upgrading.md +140 -0
- data/site/_docs/usage.md +101 -0
- data/site/_docs/variables.md +390 -0
- data/site/_docs/windows.md +44 -0
- data/site/_includes/analytics.html +30 -0
- data/site/_includes/anchor_links.html +33 -0
- data/site/_includes/docs_contents.html +8 -0
- data/site/_includes/docs_contents_mobile.html +10 -0
- data/site/_includes/docs_option.html +11 -0
- data/site/_includes/docs_ul.html +21 -0
- data/site/_includes/footer.html +15 -0
- data/site/_includes/header.html +18 -0
- data/site/_includes/news_contents.html +33 -0
- data/site/_includes/news_contents_mobile.html +11 -0
- data/site/_includes/news_item.html +24 -0
- data/site/_includes/primary-nav-items.html +17 -0
- data/site/_includes/section_nav.html +39 -0
- data/site/_includes/top.html +17 -0
- data/site/_layouts/default.html +13 -0
- data/site/_layouts/docs.html +26 -0
- data/site/_layouts/news.html +19 -0
- data/site/_layouts/news_item.html +27 -0
- data/site/_layouts/page.html +18 -0
- data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +23 -0
- data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +27 -0
- data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +28 -0
- data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +25 -0
- data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +27 -0
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +31 -0
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +20 -0
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +20 -0
- data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +23 -0
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +19 -0
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +17 -0
- data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +43 -0
- data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +21 -0
- data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +30 -0
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +18 -0
- data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +18 -0
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +26 -0
- data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +19 -0
- data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +26 -0
- data/site/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +31 -0
- data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +18 -0
- data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +19 -0
- data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +31 -0
- data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +30 -0
- data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +19 -0
- data/site/_posts/2014-08-10-jekyll-2-3-0-released.markdown +41 -0
- data/site/_posts/2014-09-09-jekyll-2-4-0-released.markdown +25 -0
- data/site/_posts/2014-11-06-jekylls-midlife-crisis-jekyll-turns-2-5-0.markdown +47 -0
- data/site/_posts/2014-11-08-jekyll-2-5-1-released.markdown +29 -0
- data/site/_posts/2014-11-12-jekyll-2-5-2-released.markdown +18 -0
- data/site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md +27 -0
- data/site/_posts/2014-12-22-jekyll-2-5-3-released.markdown +20 -0
- data/site/_posts/2015-01-20-jekyll-meet-and-greet.markdown +20 -0
- data/site/_posts/2015-01-24-jekyll-3-0-0-beta1-released.markdown +40 -0
- data/site/_posts/2015-02-26-introducing-jekyll-talk.markdown +15 -0
- data/site/_posts/2015-10-26-jekyll-3-0-released.markdown +35 -0
- data/site/_posts/2015-11-17-jekyll-3-0-1-released.markdown +25 -0
- data/site/_posts/2016-01-20-jekyll-3-0-2-released.markdown +14 -0
- data/site/_posts/2016-02-08-jekyll-3-0-3-released.markdown +31 -0
- data/site/_sass/_font-awesome.scss +25 -0
- data/site/_sass/_gridism.scss +124 -0
- data/site/_sass/_mixins.scss +38 -0
- data/site/_sass/_normalize.scss +1 -0
- data/site/_sass/_pygments.scss +78 -0
- data/site/_sass/_style.scss +998 -0
- data/site/css/screen.scss +9 -0
- data/site/favicon.ico +0 -0
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +640 -0
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/fonts/fontawesome-webfont.woff2 +0 -0
- data/site/freenode.txt +1 -0
- data/site/help/index.md +36 -0
- data/site/img/article-footer.png +0 -0
- data/site/img/footer-arrow.png +0 -0
- data/site/img/footer-logo.png +0 -0
- data/site/img/jekyll-sticker.jpg +0 -0
- data/site/img/logo-2x.png +0 -0
- data/site/img/logo-rss.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/index.html +90 -0
- data/site/js/html5shiv.min.js +4 -0
- data/site/js/respond.min.js +5 -0
- data/site/latest_version.txt +1 -0
- data/site/news/index.html +10 -0
- data/site/news/releases/index.html +10 -0
- metadata +138 -6
- data/lib/jekyll-docs/version.rb +0 -5
- data/lib/jekyll/commands/docs.rb +0 -30
- data/lib/jekyll/docs.rb +0 -7
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Templates
|
|
4
|
+
permalink: /docs/templates/
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Jekyll uses the [Liquid](https://github.com/Shopify/liquid/wiki) templating language to
|
|
8
|
+
process templates. All of the standard Liquid [tags](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#tags) and
|
|
9
|
+
[filters](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#standard-filters) are
|
|
10
|
+
supported. Jekyll even adds a few handy filters and tags of its own to make
|
|
11
|
+
common tasks easier.
|
|
12
|
+
|
|
13
|
+
## Filters
|
|
14
|
+
|
|
15
|
+
<div class="mobile-side-scroller">
|
|
16
|
+
<table>
|
|
17
|
+
<thead>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>Description</th>
|
|
20
|
+
<th><span class="filter">Filter</span> and <span class="output">Output</span></th>
|
|
21
|
+
</tr>
|
|
22
|
+
</thead>
|
|
23
|
+
<tbody>
|
|
24
|
+
<tr>
|
|
25
|
+
<td>
|
|
26
|
+
<p class="name"><strong>Date to XML Schema</strong></p>
|
|
27
|
+
<p>Convert a Date into XML Schema (ISO 8601) format.</p>
|
|
28
|
+
</td>
|
|
29
|
+
<td class="align-center">
|
|
30
|
+
<p>
|
|
31
|
+
<code class="filter">{% raw %}{{ site.time | date_to_xmlschema }}{% endraw %}</code>
|
|
32
|
+
</p>
|
|
33
|
+
<p>
|
|
34
|
+
<code class="output">2008-11-07T13:07:54-08:00</code>
|
|
35
|
+
</p>
|
|
36
|
+
</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td>
|
|
40
|
+
<p class="name"><strong>Date to RFC-822 Format</strong></p>
|
|
41
|
+
<p>Convert a Date into the RFC-822 format used for RSS feeds.</p>
|
|
42
|
+
</td>
|
|
43
|
+
<td class="align-center">
|
|
44
|
+
<p>
|
|
45
|
+
<code class="filter">{% raw %}{{ site.time | date_to_rfc822 }}{% endraw %}</code>
|
|
46
|
+
</p>
|
|
47
|
+
<p>
|
|
48
|
+
<code class="output">Mon, 07 Nov 2008 13:07:54 -0800</code>
|
|
49
|
+
</p>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>
|
|
54
|
+
<p class="name"><strong>Date to String</strong></p>
|
|
55
|
+
<p>Convert a date to short format.</p>
|
|
56
|
+
</td>
|
|
57
|
+
<td class="align-center">
|
|
58
|
+
<p>
|
|
59
|
+
<code class="filter">{% raw %}{{ site.time | date_to_string }}{% endraw %}</code>
|
|
60
|
+
</p>
|
|
61
|
+
<p>
|
|
62
|
+
<code class="output">07 Nov 2008</code>
|
|
63
|
+
</p>
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
<tr>
|
|
67
|
+
<td>
|
|
68
|
+
<p class="name"><strong>Date to Long String</strong></p>
|
|
69
|
+
<p>Format a date to long format.</p>
|
|
70
|
+
</td>
|
|
71
|
+
<td class="align-center">
|
|
72
|
+
<p>
|
|
73
|
+
<code class="filter">{% raw %}{{ site.time | date_to_long_string }}{% endraw %}</code>
|
|
74
|
+
</p>
|
|
75
|
+
<p>
|
|
76
|
+
<code class="output">07 November 2008</code>
|
|
77
|
+
</p>
|
|
78
|
+
</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td>
|
|
82
|
+
<p class="name"><strong>Where</strong></p>
|
|
83
|
+
<p>Select all the objects in an array where the key has the given value.</p>
|
|
84
|
+
</td>
|
|
85
|
+
<td class="align-center">
|
|
86
|
+
<p>
|
|
87
|
+
<code class="filter">{% raw %}{{ site.members | where:"graduation_year","2014" }}{% endraw %}</code>
|
|
88
|
+
</p>
|
|
89
|
+
</td>
|
|
90
|
+
</tr>
|
|
91
|
+
<tr>
|
|
92
|
+
<td>
|
|
93
|
+
<p class="name"><strong>Group By</strong></p>
|
|
94
|
+
<p>Group an array's items by a given property.</p>
|
|
95
|
+
</td>
|
|
96
|
+
<td class="align-center">
|
|
97
|
+
<p>
|
|
98
|
+
<code class="filter">{% raw %}{{ site.members | group_by:"graduation_year" }}{% endraw %}</code>
|
|
99
|
+
</p>
|
|
100
|
+
<p>
|
|
101
|
+
<code class="output">[{"name"=>"2013", "items"=>[...]},
|
|
102
|
+
{"name"=>"2014", "items"=>[...]}]</code>
|
|
103
|
+
</p>
|
|
104
|
+
</td>
|
|
105
|
+
</tr>
|
|
106
|
+
<tr>
|
|
107
|
+
<td>
|
|
108
|
+
<p class="name"><strong>XML Escape</strong></p>
|
|
109
|
+
<p>Escape some text for use in XML.</p>
|
|
110
|
+
</td>
|
|
111
|
+
<td class="align-center">
|
|
112
|
+
<p>
|
|
113
|
+
<code class="filter">{% raw %}{{ page.content | xml_escape }}{% endraw %}</code>
|
|
114
|
+
</p>
|
|
115
|
+
</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td>
|
|
119
|
+
<p class="name"><strong>CGI Escape</strong></p>
|
|
120
|
+
<p>
|
|
121
|
+
CGI escape a string for use in a URL. Replaces any special characters
|
|
122
|
+
with appropriate %XX replacements.
|
|
123
|
+
</p>
|
|
124
|
+
</td>
|
|
125
|
+
<td class="align-center">
|
|
126
|
+
<p>
|
|
127
|
+
<code class="filter">{% raw %}{{ "foo,bar;baz?" | cgi_escape }}{% endraw %}</code>
|
|
128
|
+
</p>
|
|
129
|
+
<p>
|
|
130
|
+
<code class="output">foo%2Cbar%3Bbaz%3F</code>
|
|
131
|
+
</p>
|
|
132
|
+
</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr>
|
|
135
|
+
<td>
|
|
136
|
+
<p class="name"><strong>URI Escape</strong></p>
|
|
137
|
+
<p>
|
|
138
|
+
URI escape a string.
|
|
139
|
+
</p>
|
|
140
|
+
</td>
|
|
141
|
+
<td class="align-center">
|
|
142
|
+
<p>
|
|
143
|
+
<code class="filter">{% raw %}{{ "foo, bar \baz?" | uri_escape }}{% endraw %}</code>
|
|
144
|
+
</p>
|
|
145
|
+
<p>
|
|
146
|
+
<code class="output">foo,%20bar%20%5Cbaz?</code>
|
|
147
|
+
</p>
|
|
148
|
+
</td>
|
|
149
|
+
</tr>
|
|
150
|
+
<tr>
|
|
151
|
+
<td>
|
|
152
|
+
<p class="name"><strong>Number of Words</strong></p>
|
|
153
|
+
<p>Count the number of words in some text.</p>
|
|
154
|
+
</td>
|
|
155
|
+
<td class="align-center">
|
|
156
|
+
<p>
|
|
157
|
+
<code class="filter">{% raw %}{{ page.content | number_of_words }}{% endraw %}</code>
|
|
158
|
+
</p>
|
|
159
|
+
<p>
|
|
160
|
+
<code class="output">1337</code>
|
|
161
|
+
</p>
|
|
162
|
+
</td>
|
|
163
|
+
</tr>
|
|
164
|
+
<tr>
|
|
165
|
+
<td>
|
|
166
|
+
<p class="name"><strong>Array to Sentence</strong></p>
|
|
167
|
+
<p>Convert an array into a sentence. Useful for listing tags.</p>
|
|
168
|
+
</td>
|
|
169
|
+
<td class="align-center">
|
|
170
|
+
<p>
|
|
171
|
+
<code class="filter">{% raw %}{{ page.tags | array_to_sentence_string }}{% endraw %}</code>
|
|
172
|
+
</p>
|
|
173
|
+
<p>
|
|
174
|
+
<code class="output">foo, bar, and baz</code>
|
|
175
|
+
</p>
|
|
176
|
+
</td>
|
|
177
|
+
</tr>
|
|
178
|
+
<tr>
|
|
179
|
+
<td>
|
|
180
|
+
<p class="name"><strong>Markdownify</strong></p>
|
|
181
|
+
<p>Convert a Markdown-formatted string into HTML.</p>
|
|
182
|
+
</td>
|
|
183
|
+
<td class="align-center">
|
|
184
|
+
<p>
|
|
185
|
+
<code class="filter">{% raw %}{{ page.excerpt | markdownify }}{% endraw %}</code>
|
|
186
|
+
</p>
|
|
187
|
+
</td>
|
|
188
|
+
</tr>
|
|
189
|
+
<tr>
|
|
190
|
+
<td>
|
|
191
|
+
<p class="name"><strong>Converting Sass/SCSS</strong></p>
|
|
192
|
+
<p>Convert a Sass- or SCSS-formatted string into CSS.</p>
|
|
193
|
+
</td>
|
|
194
|
+
<td class="align-center">
|
|
195
|
+
<p>
|
|
196
|
+
<code class="filter">{% raw %}{{ some_scss | scssify }}{% endraw %}</code>
|
|
197
|
+
<code class="filter">{% raw %}{{ some_sass | sassify }}{% endraw %}</code>
|
|
198
|
+
</p>
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr>
|
|
202
|
+
<td>
|
|
203
|
+
<p class="name"><strong>Slugify</strong></p>
|
|
204
|
+
<p>Convert a string into a lowercase URL "slug". See below for options.</p>
|
|
205
|
+
</td>
|
|
206
|
+
<td class="align-center">
|
|
207
|
+
<p>
|
|
208
|
+
<code class="filter">{% raw %}{{ "The _config.yml file" | slugify }}{% endraw %}</code>
|
|
209
|
+
</p>
|
|
210
|
+
<p>
|
|
211
|
+
<code class="output">the-config-yml-file</code>
|
|
212
|
+
</p>
|
|
213
|
+
<p>
|
|
214
|
+
<code class="filter">{% raw %}{{ "The _config.yml file" | slugify: 'pretty' }}{% endraw %}</code>
|
|
215
|
+
</p>
|
|
216
|
+
<p>
|
|
217
|
+
<code class="output">the-_config.yml-file</code>
|
|
218
|
+
</p>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td>
|
|
223
|
+
<p class="name"><strong>Data To JSON</strong></p>
|
|
224
|
+
<p>Convert Hash or Array to JSON.</p>
|
|
225
|
+
</td>
|
|
226
|
+
<td class="align-center">
|
|
227
|
+
<p>
|
|
228
|
+
<code class="filter">{% raw %}{{ site.data.projects | jsonify }}{% endraw %}</code>
|
|
229
|
+
</p>
|
|
230
|
+
</td>
|
|
231
|
+
</tr>
|
|
232
|
+
<tr>
|
|
233
|
+
<td>
|
|
234
|
+
<p class="name"><strong>Sort</strong></p>
|
|
235
|
+
<p>Sort an array. Optional arguments for hashes: 1. property name 2. nils order (<em>first</em> or <em>last</em>).</p>
|
|
236
|
+
</td>
|
|
237
|
+
<td class="align-center">
|
|
238
|
+
<p>
|
|
239
|
+
<code class="filter">{% raw %}{{ page.tags | sort }}{% endraw %}</code>
|
|
240
|
+
</p>
|
|
241
|
+
<p>
|
|
242
|
+
<code class="filter">{% raw %}{{ site.posts | sort: 'author' }}{% endraw %}</code>
|
|
243
|
+
</p>
|
|
244
|
+
<p>
|
|
245
|
+
<code class="filter">{% raw %}{{ site.pages | sort: 'title', 'last' }}{% endraw %}</code>
|
|
246
|
+
</p>
|
|
247
|
+
</td>
|
|
248
|
+
</tr>
|
|
249
|
+
</tbody>
|
|
250
|
+
</table>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
### Options for the `slugify` filter
|
|
254
|
+
|
|
255
|
+
The `slugify` filter accepts an option, each specifying what to filter.
|
|
256
|
+
The default is `default`. They are as follows (with what they filter):
|
|
257
|
+
|
|
258
|
+
- `none`: no characters
|
|
259
|
+
- `raw`: spaces
|
|
260
|
+
- `default`: spaces and non-alphanumeric characters
|
|
261
|
+
- `pretty`: spaces and non-alphanumeric characters except for `._~!$&'()+,;=@`
|
|
262
|
+
|
|
263
|
+
## Tags
|
|
264
|
+
|
|
265
|
+
### Includes
|
|
266
|
+
|
|
267
|
+
If you have small page fragments that you wish to include in multiple places on
|
|
268
|
+
your site, you can use the `include` tag.
|
|
269
|
+
|
|
270
|
+
{% highlight ruby %}
|
|
271
|
+
{% raw %}{% include footer.html %}{% endraw %}
|
|
272
|
+
{% endhighlight %}
|
|
273
|
+
|
|
274
|
+
Jekyll expects all include files to be placed in an `_includes` directory at the
|
|
275
|
+
root of your source directory. This will embed the contents of
|
|
276
|
+
`<source>/_includes/footer.html` into the calling file.
|
|
277
|
+
|
|
278
|
+
<div class="note">
|
|
279
|
+
<h5>ProTip™: Use variables as file name</h5>
|
|
280
|
+
<p>
|
|
281
|
+
|
|
282
|
+
The name of the file you wish to embed can be literal (as in the example above),
|
|
283
|
+
or you can use a variable, using liquid-like variable syntax as in
|
|
284
|
+
<code>{% raw %}{% include {{my_variable}} %}{% endraw %}</code>.
|
|
285
|
+
|
|
286
|
+
</p>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
You can also pass parameters to an include. Omit the quotation marks to send a variable's value. Liquid curly brackets should not be used here:
|
|
290
|
+
|
|
291
|
+
{% highlight ruby %}
|
|
292
|
+
{% raw %}{% include footer.html param="value" variable-param=page.variable %}{% endraw %}
|
|
293
|
+
{% endhighlight %}
|
|
294
|
+
|
|
295
|
+
These parameters are available via Liquid in the include:
|
|
296
|
+
|
|
297
|
+
{% highlight ruby %}
|
|
298
|
+
{% raw %}{{ include.param }}{% endraw %}
|
|
299
|
+
{% endhighlight %}
|
|
300
|
+
|
|
301
|
+
#### Including files relative to another file
|
|
302
|
+
|
|
303
|
+
You can also choose to include file fragments relative to the current file:
|
|
304
|
+
|
|
305
|
+
{% highlight ruby %}
|
|
306
|
+
{% raw %}{% include_relative somedir/footer.html %}{% endraw %}
|
|
307
|
+
{% endhighlight %}
|
|
308
|
+
|
|
309
|
+
You won't need to place your included content within the `_includes` directory. Instead,
|
|
310
|
+
the inclusion is specifically relative to the file where the tag is being used. For example,
|
|
311
|
+
if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file
|
|
312
|
+
must be within the `_posts` directory, or one of its subdirectories. You cannot include
|
|
313
|
+
files in other locations.
|
|
314
|
+
|
|
315
|
+
All the other capabilities of the `include` tag are available to the `include_relative` tag,
|
|
316
|
+
such as using variables.
|
|
317
|
+
|
|
318
|
+
### Code snippet highlighting
|
|
319
|
+
|
|
320
|
+
Jekyll has built in support for syntax highlighting of [over 100
|
|
321
|
+
languages](http://pygments.org/languages/) thanks to
|
|
322
|
+
[Pygments](http://pygments.org/). To use Pygments, you must have Python installed
|
|
323
|
+
on your system and set `highlighter` to `pygments` in your site's configuration
|
|
324
|
+
file.
|
|
325
|
+
|
|
326
|
+
Alternatively, you can use [Rouge](https://github.com/jayferd/rouge) to highlight
|
|
327
|
+
your code snippets. It doesn't support as many languages as Pygments, however it
|
|
328
|
+
should suit most use cases. Also, since [Rouge](https://github.com/jayferd/rouge)
|
|
329
|
+
is written in pure Ruby, you don't need Python on your system!
|
|
330
|
+
|
|
331
|
+
To render a code block with syntax highlighting, surround your code as follows:
|
|
332
|
+
|
|
333
|
+
{% highlight text %}
|
|
334
|
+
{% raw %}
|
|
335
|
+
{% highlight ruby %}
|
|
336
|
+
def foo
|
|
337
|
+
puts 'foo'
|
|
338
|
+
end
|
|
339
|
+
{% endhighlight %}
|
|
340
|
+
{% endraw %}
|
|
341
|
+
{% endhighlight %}
|
|
342
|
+
|
|
343
|
+
The argument to the `highlight` tag (`ruby` in the example above) is the
|
|
344
|
+
language identifier. To find the appropriate identifier to use for the language
|
|
345
|
+
you want to highlight, look for the “short name” on the [Pygments' Lexers
|
|
346
|
+
page](http://pygments.org/docs/lexers/) or the [Rouge
|
|
347
|
+
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers).
|
|
348
|
+
|
|
349
|
+
#### Line numbers
|
|
350
|
+
|
|
351
|
+
There is a second argument to `highlight` called `linenos` that is optional.
|
|
352
|
+
Including the `linenos` argument will force the highlighted code to include line
|
|
353
|
+
numbers. For instance, the following code block would include line numbers next
|
|
354
|
+
to each line:
|
|
355
|
+
|
|
356
|
+
{% highlight text %}
|
|
357
|
+
{% raw %}
|
|
358
|
+
{% highlight ruby linenos %}
|
|
359
|
+
def foo
|
|
360
|
+
puts 'foo'
|
|
361
|
+
end
|
|
362
|
+
{% endhighlight %}
|
|
363
|
+
{% endraw %}
|
|
364
|
+
{% endhighlight %}
|
|
365
|
+
|
|
366
|
+
#### Stylesheets for syntax highlighting
|
|
367
|
+
|
|
368
|
+
In order for the highlighting to show up, you’ll need to include a highlighting
|
|
369
|
+
stylesheet. For an example stylesheet you can look at
|
|
370
|
+
[syntax.css](https://github.com/mojombo/tpw/tree/master/css/syntax.css). These
|
|
371
|
+
are the same styles as used by GitHub and you are free to use them for your own
|
|
372
|
+
site. If you use `linenos`, you might want to include an additional CSS class
|
|
373
|
+
definition for the `.lineno` class in `syntax.css` to distinguish the line
|
|
374
|
+
numbers from the highlighted code.
|
|
375
|
+
|
|
376
|
+
### Post URL
|
|
377
|
+
|
|
378
|
+
If you would like to include a link to a post on your site, the `post_url` tag
|
|
379
|
+
will generate the correct permalink URL for the post you specify.
|
|
380
|
+
|
|
381
|
+
{% highlight text %}
|
|
382
|
+
{% raw %}
|
|
383
|
+
{% post_url 2010-07-21-name-of-post %}
|
|
384
|
+
{% endraw %}
|
|
385
|
+
{% endhighlight %}
|
|
386
|
+
|
|
387
|
+
If you organize your posts in subdirectories, you need to include subdirectory
|
|
388
|
+
path to the post:
|
|
389
|
+
|
|
390
|
+
{% highlight text %}
|
|
391
|
+
{% raw %}
|
|
392
|
+
{% post_url /subdir/2010-07-21-name-of-post %}
|
|
393
|
+
{% endraw %}
|
|
394
|
+
{% endhighlight %}
|
|
395
|
+
|
|
396
|
+
There is no need to include the file extension when using the `post_url` tag.
|
|
397
|
+
|
|
398
|
+
You can also use this tag to create a link to a post in Markdown as follows:
|
|
399
|
+
|
|
400
|
+
{% highlight text %}
|
|
401
|
+
{% raw %}
|
|
402
|
+
[Name of Link]({% post_url 2010-07-21-name-of-post %})
|
|
403
|
+
{% endraw %}
|
|
404
|
+
{% endhighlight %}
|
|
405
|
+
|
|
406
|
+
### Gist
|
|
407
|
+
|
|
408
|
+
Use the `gist` tag to easily embed a GitHub Gist onto your site. This works
|
|
409
|
+
with public or secret gists:
|
|
410
|
+
|
|
411
|
+
{% highlight text %}
|
|
412
|
+
{% raw %}
|
|
413
|
+
{% gist parkr/931c1c8d465a04042403 %}
|
|
414
|
+
{% endraw %}
|
|
415
|
+
{% endhighlight %}
|
|
416
|
+
|
|
417
|
+
You may also optionally specify the filename in the gist to display:
|
|
418
|
+
|
|
419
|
+
{% highlight text %}
|
|
420
|
+
{% raw %}
|
|
421
|
+
{% gist parkr/931c1c8d465a04042403 jekyll-private-gist.markdown %}
|
|
422
|
+
{% endraw %}
|
|
423
|
+
{% endhighlight %}
|
|
424
|
+
|
|
425
|
+
To use the `gist` tag, you'll need to add the [jekyll-gist](https://github.com/jekyll/jekyll-gist) gem to your project.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Troubleshooting
|
|
4
|
+
permalink: /docs/troubleshooting/
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
If you ever run into problems installing or using Jekyll, here are a few tips
|
|
8
|
+
that might be of help. If the problem you’re experiencing isn’t covered below,
|
|
9
|
+
**please [check out our other help resources](/help/)** as well.
|
|
10
|
+
|
|
11
|
+
- [Installation Problems](#installation-problems)
|
|
12
|
+
- [Problems running Jekyll](#problems-running-jekyll)
|
|
13
|
+
- [Base-URL Problems](#base-url-problems)
|
|
14
|
+
- [Configuration problems](#configuration-problems)
|
|
15
|
+
- [Markup Problems](#markup-problems)
|
|
16
|
+
|
|
17
|
+
## Installation Problems
|
|
18
|
+
|
|
19
|
+
If you encounter errors during gem installation, you may need to install
|
|
20
|
+
the header files for compiling extension modules for Ruby 2.0.0. This
|
|
21
|
+
can be done on Ubuntu or Debian by running:
|
|
22
|
+
|
|
23
|
+
{% highlight bash %}
|
|
24
|
+
sudo apt-get install ruby2.0.0-dev
|
|
25
|
+
{% endhighlight %}
|
|
26
|
+
|
|
27
|
+
On Red Hat, CentOS, and Fedora systems you can do this by running:
|
|
28
|
+
|
|
29
|
+
{% highlight bash %}
|
|
30
|
+
sudo yum install ruby-devel
|
|
31
|
+
{% endhighlight %}
|
|
32
|
+
|
|
33
|
+
On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the
|
|
34
|
+
following commands before installing Jekyll:
|
|
35
|
+
|
|
36
|
+
{% highlight bash %}
|
|
37
|
+
export GEM_HOME=/home/private/gems
|
|
38
|
+
export GEM_PATH=/home/private/gems:/usr/local/lib/ruby/gems/1.8/
|
|
39
|
+
export PATH=$PATH:/home/private/gems/bin
|
|
40
|
+
export RB_USER_INSTALL='true'
|
|
41
|
+
{% endhighlight %}
|
|
42
|
+
|
|
43
|
+
To install RubyGems on Gentoo:
|
|
44
|
+
|
|
45
|
+
{% highlight bash %}
|
|
46
|
+
sudo emerge -av dev-ruby/rubygems
|
|
47
|
+
{% endhighlight %}
|
|
48
|
+
|
|
49
|
+
On Windows, you may need to install [RubyInstaller
|
|
50
|
+
DevKit](https://wiki.github.com/oneclick/rubyinstaller/development-kit).
|
|
51
|
+
|
|
52
|
+
On Mac OS X, you may need to update RubyGems (using `sudo` only if necessary):
|
|
53
|
+
|
|
54
|
+
{% highlight bash %}
|
|
55
|
+
sudo gem update --system
|
|
56
|
+
{% endhighlight %}
|
|
57
|
+
|
|
58
|
+
If you still have issues, you can download and install new Command Line
|
|
59
|
+
Tools (such as `gcc`) using the command
|
|
60
|
+
|
|
61
|
+
{% highlight bash %}
|
|
62
|
+
xcode-select --install
|
|
63
|
+
{% endhighlight %}
|
|
64
|
+
|
|
65
|
+
which may allow you to install native gems using this command (again using
|
|
66
|
+
`sudo` only if necessary):
|
|
67
|
+
|
|
68
|
+
{% highlight bash %}
|
|
69
|
+
sudo gem install jekyll
|
|
70
|
+
{% endhighlight %}
|
|
71
|
+
|
|
72
|
+
Note that upgrading Mac OS X does not automatically upgrade Xcode itself
|
|
73
|
+
(that can be done separately via the App Store), and having an out-of-date
|
|
74
|
+
Xcode.app can interfere with the command line tools downloaded above. If
|
|
75
|
+
you run into this issue, upgrade Xcode and install the upgraded Command
|
|
76
|
+
Line Tools.
|
|
77
|
+
|
|
78
|
+
### Jekyll & Mac OS X 10.11
|
|
79
|
+
|
|
80
|
+
With the introduction of System Integrity Protection, several directories
|
|
81
|
+
that were previously writable are now considered system locations and are no
|
|
82
|
+
longer available. Given these changes, there are a couple of simple ways to get
|
|
83
|
+
up and running. One option is to change the location where the gem will be
|
|
84
|
+
installed (again using `sudo` only if necessary):
|
|
85
|
+
|
|
86
|
+
{% highlight bash %}
|
|
87
|
+
sudo gem install -n /usr/local/bin jekyll
|
|
88
|
+
{% endhighlight %}
|
|
89
|
+
|
|
90
|
+
Alternatively, Homebrew can be installed and used to set up Ruby. This can be
|
|
91
|
+
done as follows:
|
|
92
|
+
|
|
93
|
+
{% highlight bash %}
|
|
94
|
+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
95
|
+
{% endhighlight %}
|
|
96
|
+
|
|
97
|
+
Once Homebrew is installed, the second step is easy:
|
|
98
|
+
|
|
99
|
+
{% highlight bash %}
|
|
100
|
+
brew install ruby
|
|
101
|
+
{% endhighlight %}
|
|
102
|
+
|
|
103
|
+
Advanced users (with more complex needs) may find it helpful to choose one of a
|
|
104
|
+
number of Ruby version managers ([RVM][], [rbenv][], [chruby][], [etc][].) in
|
|
105
|
+
which to install Jekyll.
|
|
106
|
+
|
|
107
|
+
[RVM]: https://rvm.io
|
|
108
|
+
[rbenv]: http://rbenv.org
|
|
109
|
+
[chruby]: https://github.com/postmodern/chruby
|
|
110
|
+
[etc]: https://github.com/rvm/rvm/blob/master/docs/alt.md
|
|
111
|
+
|
|
112
|
+
If you elect to use one of the above methods to install Ruby, it might be
|
|
113
|
+
necessary to modify your `$PATH` variable using the following command:
|
|
114
|
+
|
|
115
|
+
{% highlight bash %}
|
|
116
|
+
export PATH=/usr/local/bin:$PATH
|
|
117
|
+
{% endhighlight %}
|
|
118
|
+
|
|
119
|
+
GUI apps can modify the `$PATH` as follows:
|
|
120
|
+
|
|
121
|
+
{% highlight bash %}
|
|
122
|
+
launchctl setenv PATH "/usr/local/bin:$PATH"
|
|
123
|
+
{% endhighlight %}
|
|
124
|
+
|
|
125
|
+
Either of these approaches are useful because `/usr/local` is considered a
|
|
126
|
+
"safe" location on systems which have SIP enabled, they avoid potential
|
|
127
|
+
conflicts with the version of Ruby included by Apple, and it keeps Jekyll and
|
|
128
|
+
its dependencies in a sandboxed environment. This also has the added
|
|
129
|
+
benefit of not requiring `sudo` when you want to add or remove a gem.
|
|
130
|
+
|
|
131
|
+
### Could not find a JavaScript runtime. (ExecJS::RuntimeUnavailable)
|
|
132
|
+
|
|
133
|
+
This error can occur during the installation of `jekyll-coffeescript` when
|
|
134
|
+
you don't have a proper JavaScript runtime. To solve this, either install
|
|
135
|
+
`execjs` and `therubyracer` gems, or install `nodejs`. Check out
|
|
136
|
+
[issue #2327](https://github.com/jekyll/jekyll/issues/2327) for more info.
|
|
137
|
+
|
|
138
|
+
## Problems running Jekyll
|
|
139
|
+
|
|
140
|
+
On Debian or Ubuntu, you may need to add `/var/lib/gems/1.8/bin/` to your path
|
|
141
|
+
in order to have the `jekyll` executable be available in your Terminal.
|
|
142
|
+
|
|
143
|
+
## Base-URL Problems
|
|
144
|
+
|
|
145
|
+
If you are using base-url option like:
|
|
146
|
+
|
|
147
|
+
{% highlight bash %}
|
|
148
|
+
jekyll serve --baseurl '/blog'
|
|
149
|
+
{% endhighlight %}
|
|
150
|
+
|
|
151
|
+
… then make sure that you access the site at:
|
|
152
|
+
|
|
153
|
+
{% highlight bash %}
|
|
154
|
+
http://localhost:4000/blog/index.html
|
|
155
|
+
{% endhighlight %}
|
|
156
|
+
|
|
157
|
+
It won’t work to just access:
|
|
158
|
+
|
|
159
|
+
{% highlight bash %}
|
|
160
|
+
http://localhost:4000/blog
|
|
161
|
+
{% endhighlight %}
|
|
162
|
+
|
|
163
|
+
## Configuration problems
|
|
164
|
+
|
|
165
|
+
The order of precedence for conflicting [configuration settings](../configuration/)
|
|
166
|
+
is as follows:
|
|
167
|
+
|
|
168
|
+
1. Command-line flags
|
|
169
|
+
2. Configuration file settings
|
|
170
|
+
3. Defaults
|
|
171
|
+
|
|
172
|
+
That is: defaults are overridden by options specified in `_config.yml`,
|
|
173
|
+
and flags specified at the command-line will override all other settings
|
|
174
|
+
specified elsewhere.
|
|
175
|
+
|
|
176
|
+
## Markup Problems
|
|
177
|
+
|
|
178
|
+
The various markup engines that Jekyll uses may have some issues. This
|
|
179
|
+
page will document them to help others who may run into the same
|
|
180
|
+
problems.
|
|
181
|
+
|
|
182
|
+
### Liquid
|
|
183
|
+
|
|
184
|
+
The latest version, version 2.0, seems to break the use of `{{ "{{" }}` in
|
|
185
|
+
templates. Unlike previous versions, using `{{ "{{" }}` in 2.0 triggers the
|
|
186
|
+
following error:
|
|
187
|
+
|
|
188
|
+
{% highlight bash %}
|
|
189
|
+
'{{ "{{" }}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)
|
|
190
|
+
{% endhighlight %}
|
|
191
|
+
|
|
192
|
+
### Excerpts
|
|
193
|
+
|
|
194
|
+
Since v1.0.0, Jekyll has had automatically-generated post excerpts. Since
|
|
195
|
+
v1.1.0, Jekyll also passes these excerpts through Liquid, which can cause
|
|
196
|
+
strange errors where references don't exist or a tag hasn't been closed. If you
|
|
197
|
+
run into these errors, try setting `excerpt_separator: ""` in your
|
|
198
|
+
`_config.yml`, or set it to some nonsense string.
|
|
199
|
+
|
|
200
|
+
<div class="note">
|
|
201
|
+
<h5>Please report issues you encounter!</h5>
|
|
202
|
+
<p>
|
|
203
|
+
If you come across a bug, please <a href="{{ site.help_url }}/issues/new">create an issue</a>
|
|
204
|
+
on GitHub describing the problem and any work-arounds you find so we can
|
|
205
|
+
document it here for others.
|
|
206
|
+
</p>
|
|
207
|
+
</div>
|