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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-docs.rb +34 -4
  3. data/site/CNAME +1 -0
  4. data/site/README.md +16 -0
  5. data/site/_config.yml +21 -0
  6. data/site/_data/docs.yml +47 -0
  7. data/site/_docs/assets.md +93 -0
  8. data/site/_docs/collections.md +380 -0
  9. data/site/_docs/configuration.md +677 -0
  10. data/site/_docs/continuous-integration.md +221 -0
  11. data/site/_docs/contributing.md +124 -0
  12. data/site/_docs/datafiles.md +151 -0
  13. data/site/_docs/deployment-methods.md +192 -0
  14. data/site/_docs/drafts.md +20 -0
  15. data/site/_docs/extras.md +22 -0
  16. data/site/_docs/frontmatter.md +191 -0
  17. data/site/_docs/github-pages.md +134 -0
  18. data/site/_docs/history.md +2131 -0
  19. data/site/_docs/index.md +56 -0
  20. data/site/_docs/installation.md +106 -0
  21. data/site/_docs/migrations.md +9 -0
  22. data/site/_docs/pages.md +84 -0
  23. data/site/_docs/pagination.md +221 -0
  24. data/site/_docs/permalinks.md +307 -0
  25. data/site/_docs/plugins.md +891 -0
  26. data/site/_docs/posts.md +237 -0
  27. data/site/_docs/quickstart.md +27 -0
  28. data/site/_docs/resources.md +46 -0
  29. data/site/_docs/sites.md +29 -0
  30. data/site/_docs/static_files.md +52 -0
  31. data/site/_docs/structure.md +211 -0
  32. data/site/_docs/templates.md +425 -0
  33. data/site/_docs/troubleshooting.md +207 -0
  34. data/site/_docs/upgrading.md +140 -0
  35. data/site/_docs/usage.md +101 -0
  36. data/site/_docs/variables.md +390 -0
  37. data/site/_docs/windows.md +44 -0
  38. data/site/_includes/analytics.html +30 -0
  39. data/site/_includes/anchor_links.html +33 -0
  40. data/site/_includes/docs_contents.html +8 -0
  41. data/site/_includes/docs_contents_mobile.html +10 -0
  42. data/site/_includes/docs_option.html +11 -0
  43. data/site/_includes/docs_ul.html +21 -0
  44. data/site/_includes/footer.html +15 -0
  45. data/site/_includes/header.html +18 -0
  46. data/site/_includes/news_contents.html +33 -0
  47. data/site/_includes/news_contents_mobile.html +11 -0
  48. data/site/_includes/news_item.html +24 -0
  49. data/site/_includes/primary-nav-items.html +17 -0
  50. data/site/_includes/section_nav.html +39 -0
  51. data/site/_includes/top.html +17 -0
  52. data/site/_layouts/default.html +13 -0
  53. data/site/_layouts/docs.html +26 -0
  54. data/site/_layouts/news.html +19 -0
  55. data/site/_layouts/news_item.html +27 -0
  56. data/site/_layouts/page.html +18 -0
  57. data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +23 -0
  58. data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +27 -0
  59. data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +28 -0
  60. data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +25 -0
  61. data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +27 -0
  62. data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +31 -0
  63. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +20 -0
  64. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +20 -0
  65. data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +23 -0
  66. data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +19 -0
  67. data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +17 -0
  68. data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +43 -0
  69. data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +21 -0
  70. data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +30 -0
  71. data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +18 -0
  72. data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +18 -0
  73. data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +26 -0
  74. data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +19 -0
  75. data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +26 -0
  76. data/site/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +31 -0
  77. data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +18 -0
  78. data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +19 -0
  79. data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +31 -0
  80. data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +30 -0
  81. data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +19 -0
  82. data/site/_posts/2014-08-10-jekyll-2-3-0-released.markdown +41 -0
  83. data/site/_posts/2014-09-09-jekyll-2-4-0-released.markdown +25 -0
  84. data/site/_posts/2014-11-06-jekylls-midlife-crisis-jekyll-turns-2-5-0.markdown +47 -0
  85. data/site/_posts/2014-11-08-jekyll-2-5-1-released.markdown +29 -0
  86. data/site/_posts/2014-11-12-jekyll-2-5-2-released.markdown +18 -0
  87. data/site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md +27 -0
  88. data/site/_posts/2014-12-22-jekyll-2-5-3-released.markdown +20 -0
  89. data/site/_posts/2015-01-20-jekyll-meet-and-greet.markdown +20 -0
  90. data/site/_posts/2015-01-24-jekyll-3-0-0-beta1-released.markdown +40 -0
  91. data/site/_posts/2015-02-26-introducing-jekyll-talk.markdown +15 -0
  92. data/site/_posts/2015-10-26-jekyll-3-0-released.markdown +35 -0
  93. data/site/_posts/2015-11-17-jekyll-3-0-1-released.markdown +25 -0
  94. data/site/_posts/2016-01-20-jekyll-3-0-2-released.markdown +14 -0
  95. data/site/_posts/2016-02-08-jekyll-3-0-3-released.markdown +31 -0
  96. data/site/_sass/_font-awesome.scss +25 -0
  97. data/site/_sass/_gridism.scss +124 -0
  98. data/site/_sass/_mixins.scss +38 -0
  99. data/site/_sass/_normalize.scss +1 -0
  100. data/site/_sass/_pygments.scss +78 -0
  101. data/site/_sass/_style.scss +998 -0
  102. data/site/css/screen.scss +9 -0
  103. data/site/favicon.ico +0 -0
  104. data/site/fonts/fontawesome-webfont.eot +0 -0
  105. data/site/fonts/fontawesome-webfont.svg +640 -0
  106. data/site/fonts/fontawesome-webfont.ttf +0 -0
  107. data/site/fonts/fontawesome-webfont.woff +0 -0
  108. data/site/fonts/fontawesome-webfont.woff2 +0 -0
  109. data/site/freenode.txt +1 -0
  110. data/site/help/index.md +36 -0
  111. data/site/img/article-footer.png +0 -0
  112. data/site/img/footer-arrow.png +0 -0
  113. data/site/img/footer-logo.png +0 -0
  114. data/site/img/jekyll-sticker.jpg +0 -0
  115. data/site/img/logo-2x.png +0 -0
  116. data/site/img/logo-rss.png +0 -0
  117. data/site/img/octojekyll.png +0 -0
  118. data/site/index.html +90 -0
  119. data/site/js/html5shiv.min.js +4 -0
  120. data/site/js/respond.min.js +5 -0
  121. data/site/latest_version.txt +1 -0
  122. data/site/news/index.html +10 -0
  123. data/site/news/releases/index.html +10 -0
  124. metadata +138 -6
  125. data/lib/jekyll-docs/version.rb +0 -5
  126. data/lib/jekyll/commands/docs.rb +0 -30
  127. data/lib/jekyll/docs.rb +0 -7
@@ -0,0 +1,677 @@
1
+ ---
2
+ layout: docs
3
+ title: Configuration
4
+ permalink: /docs/configuration/
5
+ ---
6
+
7
+ Jekyll allows you to concoct your sites in any way you can dream up, and it’s
8
+ thanks to the powerful and flexible configuration options that this is possible.
9
+ These options can either be specified in a `_config.yml` file placed in your
10
+ site’s root directory, or can be specified as flags for the `jekyll` executable
11
+ in the terminal.
12
+
13
+ ## Configuration Settings
14
+
15
+ ### Global Configuration
16
+
17
+ The table below lists the available settings for Jekyll, and the various <code
18
+ class="option">options</code> (specified in the configuration file) and <code
19
+ class="flag">flags</code> (specified on the command-line) that control them.
20
+
21
+ <div class="mobile-side-scroller">
22
+ <table>
23
+ <thead>
24
+ <tr>
25
+ <th>Setting</th>
26
+ <th>
27
+ <span class="option">Options</span> and <span class="flag">Flags</span>
28
+ </th>
29
+ </tr>
30
+ </thead>
31
+ <tbody>
32
+ <tr class="setting">
33
+ <td>
34
+ <p class="name"><strong>Site Source</strong></p>
35
+ <p class="description">Change the directory where Jekyll will read files</p>
36
+ </td>
37
+ <td class="align-center">
38
+ <p><code class="option">source: DIR</code></p>
39
+ <p><code class="flag">-s, --source DIR</code></p>
40
+ </td>
41
+ </tr>
42
+ <tr class="setting">
43
+ <td>
44
+ <p class="name"><strong>Site Destination</strong></p>
45
+ <p class="description">Change the directory where Jekyll will write files</p>
46
+ </td>
47
+ <td class="align-center">
48
+ <p><code class="option">destination: DIR</code></p>
49
+ <p><code class="flag">-d, --destination DIR</code></p>
50
+ </td>
51
+ </tr>
52
+ <tr class="setting">
53
+ <td>
54
+ <p class="name"><strong>Safe</strong></p>
55
+ <p class="description">Disable <a href="../plugins/">custom plugins, and ignore symbolic links</a>.</p>
56
+ </td>
57
+ <td class="align-center">
58
+ <p><code class="option">safe: BOOL</code></p>
59
+ <p><code class="flag">--safe</code></p>
60
+ </td>
61
+ </tr>
62
+ <tr class="setting">
63
+ <td>
64
+ <p class="name"><strong>Exclude</strong></p>
65
+ <p class="description">
66
+ Exclude directories and/or files from the
67
+ conversion. These exclusions are relative to the site's
68
+ source directory and cannot be outside the source directory.
69
+ </p>
70
+ </td>
71
+ <td class="align-center">
72
+ <p><code class="option">exclude: [DIR, FILE, ...]</code></p>
73
+ </td>
74
+ </tr>
75
+ <tr class="setting">
76
+ <td>
77
+ <p class="name"><strong>Include</strong></p>
78
+ <p class="description">
79
+ Force inclusion of directories and/or files in the conversion.
80
+ <code>.htaccess</code> is a good example since dotfiles are excluded
81
+ by default.
82
+ </p>
83
+ </td>
84
+ <td class="align-center">
85
+ <p><code class="option">include: [DIR, FILE, ...]</code></p>
86
+ </td>
87
+ </tr>
88
+ <tr class="setting">
89
+ <td>
90
+ <p class="name"><strong>Keep files</strong></p>
91
+ <p class="description">
92
+ When clobbering the site destination, keep the selected files.
93
+ Useful for files that are not generated by jekyll; e.g. files or
94
+ assets that are generated by your build tool.
95
+ The paths are relative to the <code>destination</code>.
96
+ </p>
97
+ </td>
98
+ <td class="align-center">
99
+ <p><code class="option">keep_files: [DIR, FILE, ...]</code></p>
100
+ </td>
101
+ </tr>
102
+ <tr class="setting">
103
+ <td>
104
+ <p class="name"><strong>Time Zone</strong></p>
105
+ <p class="description">
106
+ Set the time zone for site generation. This sets the <code>TZ</code>
107
+ environment variable, which Ruby uses to handle time and date
108
+ creation and manipulation. Any entry from the
109
+ <a href="http://en.wikipedia.org/wiki/Tz_database">IANA Time Zone
110
+ Database</a> is valid, e.g. <code>America/New_York</code>. A list of all
111
+ available values can be found <a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">
112
+ here</a>. The default is the local time zone, as set by your operating system.
113
+ </p>
114
+ </td>
115
+ <td class="align-center">
116
+ <p><code class="option">timezone: TIMEZONE</code></p>
117
+ </td>
118
+ </tr>
119
+ <tr class="setting">
120
+ <td>
121
+ <p class="name"><strong>Encoding</strong></p>
122
+ <p class="description">
123
+ Set the encoding of files by name. Only available for Ruby
124
+ 1.9 or later).
125
+ The default value is <code>utf-8</code> starting in 2.0.0,
126
+ and <code>nil</code> before 2.0.0, which will yield the Ruby
127
+ default of <code>ASCII-8BIT</code>.
128
+ Available encodings can be shown by the
129
+ command <code>ruby -e 'puts Encoding::list.join("\n")'</code>.
130
+ </p>
131
+ </td>
132
+ <td class="align-center">
133
+ <p><code class="option">encoding: ENCODING</code></p>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <td>
138
+ <p class='name'><strong>Defaults</strong></p>
139
+ <p class='description'>
140
+ Set defaults for <a href="../frontmatter/" title="YAML Front Matter">YAML Front Matter</a>
141
+ variables.
142
+ </p>
143
+ </td>
144
+ <td class='align-center'>
145
+ <p>see <a href="#front-matter-defaults" title="details">below</a></p>
146
+ </td>
147
+ </tr>
148
+ </tbody>
149
+ </table>
150
+ </div>
151
+
152
+ <div class="note warning">
153
+ <h5>Destination folders are cleaned on site builds</h5>
154
+ <p>
155
+ The contents of <code>&lt;destination&gt;</code> are automatically
156
+ cleaned, by default, when the site is built. Files or folders that are not
157
+ created by your site will be removed. Some files could be retained
158
+ by specifying them within the <code>&lt;keep_files&gt;</code> configuration directive.
159
+ </p>
160
+ <p>
161
+ Do not use an important location for <code>&lt;destination&gt;</code>; instead, use it as
162
+ a staging area and copy files from there to your web server.
163
+ </p>
164
+ </div>
165
+
166
+ ### Build Command Options
167
+
168
+ <div class="mobile-side-scroller">
169
+ <table>
170
+ <thead>
171
+ <tr>
172
+ <th>Setting</th>
173
+ <th><span class="option">Options</span> and <span class="flag">Flags</span></th>
174
+ </tr>
175
+ </thead>
176
+ <tbody>
177
+ <tr class="setting">
178
+ <td>
179
+ <p class="name"><strong>Regeneration</strong></p>
180
+ <p class="description">Enable auto-regeneration of the site when files are modified.</p>
181
+ </td>
182
+ <td class="align-center">
183
+ <p><code class="flag">-w, --[no-]watch</code></p>
184
+ </td>
185
+ </tr>
186
+ <tr class="setting">
187
+ <td>
188
+ <p class="name"><strong>Configuration</strong></p>
189
+ <p class="description">Specify config files instead of using <code>_config.yml</code> automatically. Settings in later files override settings in earlier files.</p>
190
+ </td>
191
+ <td class="align-center">
192
+ <p><code class="flag">--config FILE1[,FILE2,...]</code></p>
193
+ </td>
194
+ </tr>
195
+ <tr class="setting">
196
+ <td>
197
+ <p class="name"><strong>Drafts</strong></p>
198
+ <p class="description">Process and render draft posts.</p>
199
+ </td>
200
+ <td class="align-center">
201
+ <p><code class="flag">--drafts</code></p>
202
+ </td>
203
+ </tr>
204
+ <tr class="setting">
205
+ <td>
206
+ <p class="name"><strong>Environment</strong></p>
207
+ <p class="description">Use a specific environment value in the build.</p>
208
+ </td>
209
+ <td class="align-center">
210
+ <p><code class="flag">JEKYLL_ENV=production</code></p>
211
+ </td>
212
+ </tr>
213
+ <tr class="setting">
214
+ <td>
215
+ <p class="name"><strong>Future</strong></p>
216
+ <p class="description">Publish posts with a future date.</p>
217
+ </td>
218
+ <td class="align-center">
219
+ <p><code class="option">future: BOOL</code></p>
220
+ <p><code class="flag">--future</code></p>
221
+ </td>
222
+ </tr>
223
+ <tr class="setting">
224
+ <td>
225
+ <p class="name"><strong>LSI</strong></p>
226
+ <p class="description">Produce an index for related posts.</p>
227
+ </td>
228
+ <td class="align-center">
229
+ <p><code class="option">lsi: BOOL</code></p>
230
+ <p><code class="flag">--lsi</code></p>
231
+ </td>
232
+ </tr>
233
+ <tr class="setting">
234
+ <td>
235
+ <p class="name"><strong>Limit Posts</strong></p>
236
+ <p class="description">Limit the number of posts to parse and publish.</p>
237
+ </td>
238
+ <td class="align-center">
239
+ <p><code class="option">limit_posts: NUM</code></p>
240
+ <p><code class="flag">--limit_posts NUM</code></p>
241
+ </td>
242
+ </tr>
243
+ <tr class="setting">
244
+ <td>
245
+ <p class="name"><strong>Force polling</strong></p>
246
+ <p class="description">Force watch to use polling.</p>
247
+ </td>
248
+ <td class="align-center">
249
+ <p><code class="flag">--force_polling</code></p>
250
+ </td>
251
+ </tr>
252
+ <tr class="setting">
253
+ <td>
254
+ <p class="name"><strong>Verbose output</strong></p>
255
+ <p class="description">Print verbose output.</p>
256
+ </td>
257
+ <td class="align-center">
258
+ <p><code class="flag">-V, --verbose</code></p>
259
+ </td>
260
+ </tr>
261
+ <tr class="setting">
262
+ <td>
263
+ <p class="name"><strong>Silence Output</strong></p>
264
+ <p class="description">Silence the normal output from Jekyll
265
+ during a build</p>
266
+ </td>
267
+ <td class="align-center">
268
+ <p><code class="flag">-q, --quiet</code></p>
269
+ </td>
270
+ </tr>
271
+ <tr class="setting">
272
+ <td>
273
+ <p class="name"><strong>Incremental build</strong></p>
274
+ <p class="description">
275
+ Enable the experimental incremental build feature. Incremental build only
276
+ re-builds posts and pages that have changed, resulting in significant performance
277
+ improvements for large sites, but may also break site generation in certain
278
+ cases.
279
+ </p>
280
+ </td>
281
+ <td class="align-center">
282
+ <p><code class="option">incremental: BOOL</code></p>
283
+ <p><code class="flag">-I, --incremental</code></p>
284
+ </td>
285
+ </tr>
286
+ </tbody>
287
+ </table>
288
+ </div>
289
+
290
+
291
+ ### Serve Command Options
292
+
293
+ In addition to the options below, the `serve` sub-command can accept any of the options
294
+ for the `build` sub-command, which are then applied to the site build which occurs right
295
+ before your site is served.
296
+
297
+ <div class="mobile-side-scroller">
298
+ <table>
299
+ <thead>
300
+ <tr>
301
+ <th>Setting</th>
302
+ <th><span class="option">Options</span> and <span class="flag">Flags</span></th>
303
+ </tr>
304
+ </thead>
305
+ <tbody>
306
+ <tr class="setting">
307
+ <td>
308
+ <p class="name"><strong>Local Server Port</strong></p>
309
+ <p class="description">Listen on the given port.</p>
310
+ </td>
311
+ <td class="align-center">
312
+ <p><code class="option">port: PORT</code></p>
313
+ <p><code class="flag">--port PORT</code></p>
314
+ </td>
315
+ </tr>
316
+ <tr class="setting">
317
+ <td>
318
+ <p class="name"><strong>Local Server Hostname</strong></p>
319
+ <p class="description">Listen at the given hostname.</p>
320
+ </td>
321
+ <td class="align-center">
322
+ <p><code class="option">host: HOSTNAME</code></p>
323
+ <p><code class="flag">--host HOSTNAME</code></p>
324
+ </td>
325
+ </tr>
326
+ <tr class="setting">
327
+ <td>
328
+ <p class="name"><strong>Base URL</strong></p>
329
+ <p class="description">Serve the website from the given base URL</p>
330
+ </td>
331
+ <td class="align-center">
332
+ <p><code class="option">baseurl: URL</code></p>
333
+ <p><code class="flag">--baseurl URL</code></p>
334
+ </td>
335
+ </tr>
336
+ <tr class="setting">
337
+ <td>
338
+ <p class="name"><strong>Detach</strong></p>
339
+ <p class="description">Detach the server from the terminal</p>
340
+ </td>
341
+ <td class="align-center">
342
+ <p><code class="option">detach: BOOL</code></p>
343
+ <p><code class="flag">-B, --detach</code></p>
344
+ </td>
345
+ </tr>
346
+ <tr class="setting">
347
+ <td>
348
+ <p class="name"><strong>Skips the initial site build.</strong></p>
349
+ <p class="description">Skips the initial site build which occurs before the server is started.</p>
350
+ </td>
351
+ <td class="align-center">
352
+ <p><code class="flag">--skip-initial-build</code></p>
353
+ </td>
354
+ </tr>
355
+ </tbody>
356
+ </table>
357
+ </div>
358
+
359
+ <div class="note warning">
360
+ <h5>Do not use tabs in configuration files</h5>
361
+ <p>
362
+ This will either lead to parsing errors, or Jekyll will revert to the
363
+ default settings. Use spaces instead.
364
+ </p>
365
+ </div>
366
+
367
+ ## Specifying a Jekyll environment at build time
368
+
369
+ In the build (or serve) arguments, you can specify a Jekyll environment and value. The build will then apply this value in any conditional statements in your content.
370
+
371
+ For example, suppose you set this conditional statement in your code:
372
+
373
+ {% highlight liquid %}
374
+ {% raw %}
375
+ {% if jekyll.environment == "production" %}
376
+ {% include disqus.html %}
377
+ {% endif %}
378
+ {% endraw %}
379
+ {% endhighlight %}
380
+
381
+ When you build your Jekyll site, the content inside the `if` statement won't be run unless you also specify a `production` environment in the build command, like this:
382
+
383
+ {% highlight sh %}
384
+ JEKYLL_ENV=production jekyll build
385
+ {% endhighlight %}
386
+
387
+ Specifying an environment value allows you to make certain content available only within specific environments.
388
+
389
+ The default value for `JEKYLL_ENV` is `development`. Therefore if you omit `JEKYLL_ENV` from the build arguments, the default value will be `JEKYLL_ENV=development`. Any content inside `{% raw %}{% if jekyll.environment == "development" %}{% endraw %}` tags will automatically appear in the build.
390
+
391
+ Your environment values can be anything you want (not just `development` or `production`). Some elements you might want to hide in development environments include Disqus comment forms or Google Analytics. Conversely, you might want to expose an "Edit me in GitHub" button in a development environment but not include it in production environments.
392
+
393
+ By specifying the option in the build command, you avoid having to change values in your configuration files when moving from one environment to another.
394
+
395
+ ## Front Matter defaults
396
+
397
+ Using [YAML Front Matter](../frontmatter/) is one way that you can specify configuration in the pages and posts for your site. Setting things like a default layout, or customizing the title, or specifying a more precise date/time for the post can all be added to your page or post front matter.
398
+
399
+ Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
400
+
401
+ Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your projects root directory.
402
+
403
+ The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
404
+
405
+ Let's say that you want to add a default layout to all pages and posts in your site. You would add this to your `_config.yml` file:
406
+
407
+ {% highlight yaml %}
408
+ defaults:
409
+ -
410
+ scope:
411
+ path: "" # an empty string here means all files in the project
412
+ values:
413
+ layout: "default"
414
+ {% endhighlight %}
415
+
416
+ Here, we are scoping the `values` to any file that exists in the scopes path. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
417
+
418
+ {% highlight yaml %}
419
+ defaults:
420
+ -
421
+ scope:
422
+ path: "" # an empty string here means all files in the project
423
+ type: "posts" # previously `post` in Jekyll 2.2.
424
+ values:
425
+ layout: "default"
426
+ {% endhighlight %}
427
+
428
+ Now, this will only set the layout for files where the type is `posts`.
429
+ The different types that are available to you are `pages`, `posts`, `drafts` or any collection in your site. While `type` is optional, you must specify a value for `path` when creating a `scope/values` pair.
430
+
431
+ As mentioned earlier, you can set multiple scope/values pairs for `defaults`.
432
+
433
+ {% highlight yaml %}
434
+ defaults:
435
+ -
436
+ scope:
437
+ path: ""
438
+ type: "posts"
439
+ values:
440
+ layout: "my-site"
441
+ -
442
+ scope:
443
+ path: "projects"
444
+ type: "pages" # previously `page` in Jekyll 2.2.
445
+ values:
446
+ layout: "project" # overrides previous default layout
447
+ author: "Mr. Hyde"
448
+ {% endhighlight %}
449
+
450
+ With these defaults, all posts would use the `my-site` layout. Any html files that exist in the `projects/` folder will use the `project` layout, if it exists. Those files will also have the `page.author` [liquid variable](../variables/) set to `Mr. Hyde` as well as have the category for the page set to `project`.
451
+
452
+ {% highlight yaml %}
453
+ collections:
454
+ - my_collection:
455
+ output: true
456
+
457
+ defaults:
458
+ -
459
+ scope:
460
+ path: ""
461
+ type: "my_collection" # a collection in your site, in plural form
462
+ values:
463
+ layout: "default"
464
+ {% endhighlight %}
465
+
466
+ In this example the `layout` is set to `default` inside the [collection](../collections/) with the name `my_collection`.
467
+
468
+ ### Precedence
469
+
470
+ Jekyll will apply all of the configuration settings you specify in the `defaults` section of your `_config.yml` file. However, you can choose to override settings from other scope/values pair by specifying a more specific path for the scope.
471
+
472
+ You can see that in the last example above. First, we set the default layout to `my-site`. Then, using a more specific path, we set the default layout for files in the `projects/` path to `project`. This can be done with any value that you would set in the page or post front matter.
473
+
474
+ Finally, if you set defaults in the site configuration by adding a `defaults` section to your `_config.yml` file, you can override those settings in a post or page file. All you need to do is specify the settings in the post or page front matter. For example:
475
+
476
+ {% highlight yaml %}
477
+ # In _config.yml
478
+ ...
479
+ defaults:
480
+ -
481
+ scope:
482
+ path: "projects"
483
+ type: "pages"
484
+ values:
485
+ layout: "project"
486
+ author: "Mr. Hyde"
487
+ category: "project"
488
+ ...
489
+ {% endhighlight %}
490
+
491
+ {% highlight yaml %}
492
+ # In projects/foo_project.md
493
+ ---
494
+ author: "John Smith"
495
+ layout: "foobar"
496
+ ---
497
+ The post text goes here...
498
+ {% endhighlight %}
499
+
500
+ The `projects/foo_project.md` would have the `layout` set to `foobar` instead
501
+ of `project` and the `author` set to `John Smith` instead of `Mr. Hyde` when
502
+ the site is built.
503
+
504
+ ## Default Configuration
505
+
506
+ Jekyll runs with the following configuration options by default. Alternative
507
+ settings for these options can be explicitly specified in the configuration
508
+ file or on the command-line.
509
+
510
+ <div class="note warning">
511
+ <h5>There are two unsupported kramdown options</h5>
512
+ <p>
513
+ Please note that both <code>remove_block_html_tags</code> and
514
+ <code>remove_span_html_tags</code> are currently unsupported in Jekyll due
515
+ to the fact that they are not included within the kramdown HTML converter.
516
+ </p>
517
+ </div>
518
+
519
+ {% highlight yaml %}
520
+ # Where things are
521
+ source: .
522
+ destination: ./_site
523
+ plugins_dir: ./_plugins
524
+ layouts_dir: ./_layouts
525
+ data_dir: ./_data
526
+ includes_dir: ./_includes
527
+ collections: null
528
+
529
+ # Handling Reading
530
+ safe: false
531
+ include: [".htaccess"]
532
+ exclude: []
533
+ keep_files: [".git", ".svn"]
534
+ encoding: "utf-8"
535
+ markdown_ext: "markdown,mkdown,mkdn,mkd,md"
536
+
537
+ # Filtering Content
538
+ show_drafts: null
539
+ limit_posts: 0
540
+ future: false
541
+ unpublished: false
542
+
543
+ # Plugins
544
+ whitelist: []
545
+ gems: []
546
+
547
+ # Conversion
548
+ markdown: kramdown
549
+ highlighter: rouge
550
+ lsi: false
551
+ excerpt_separator: "\n\n"
552
+ incremental: false
553
+
554
+ # Serving
555
+ detach: false
556
+ port: 4000
557
+ host: 127.0.0.1
558
+ baseurl: "" # does not include hostname
559
+
560
+ # Outputting
561
+ permalink: date
562
+ paginate_path: /page:num
563
+ timezone: null
564
+
565
+ quiet: false
566
+ defaults: []
567
+
568
+ # Markdown Processors
569
+ rdiscount:
570
+ extensions: []
571
+
572
+ redcarpet:
573
+ extensions: []
574
+
575
+ kramdown:
576
+ auto_ids: true
577
+ footnote_nr: 1
578
+ entity_output: as_char
579
+ toc_levels: 1..6
580
+ smart_quotes: lsquo,rsquo,ldquo,rdquo
581
+ enable_coderay: false
582
+
583
+ coderay:
584
+ coderay_wrap: div
585
+ coderay_line_numbers: inline
586
+ coderay_line_number_start: 1
587
+ coderay_tab_width: 4
588
+ coderay_bold_every: 10
589
+ coderay_css: style
590
+ {% endhighlight %}
591
+
592
+ ## Markdown Options
593
+
594
+ The various Markdown renderers supported by Jekyll sometimes have extra options
595
+ available.
596
+
597
+ ### Redcarpet
598
+
599
+ Redcarpet can be configured by providing an `extensions` sub-setting, whose
600
+ value should be an array of strings. Each string should be the name of one of
601
+ the `Redcarpet::Markdown` class's extensions; if present in the array, it will
602
+ set the corresponding extension to `true`.
603
+
604
+ Jekyll handles two special Redcarpet extensions:
605
+
606
+ - `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
607
+ extension (for delimiting code blocks with triple tildes or triple backticks)
608
+ to `true`, probably because GitHub's eager adoption of them is starting to make
609
+ them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
610
+ when used with Jekyll; instead, you can use this inverted version of the
611
+ extension for disabling fenced code.
612
+
613
+ Note that you can also specify a language for highlighting after the first
614
+ delimiter:
615
+
616
+ ```ruby
617
+ # ...ruby code
618
+ ```
619
+
620
+ With both fenced code blocks and highlighter enabled, this will statically
621
+ highlight the code; without any syntax highlighter, it will add a
622
+ `class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
623
+ hint by various JavaScript code highlighting libraries.
624
+
625
+ - `smart` --- This pseudo-extension turns on SmartyPants, which converts
626
+ straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
627
+
628
+ All other extensions retain their usual names from Redcarpet, and no renderer
629
+ options aside from `smart` can be specified in Jekyll. [A list of available
630
+ extensions can be found in the Redcarpet README file.][redcarpet_extensions]
631
+ Make sure you're looking at the README for the right version of
632
+ Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
633
+ extensions are:
634
+
635
+ - `tables`
636
+ - `no_intra_emphasis`
637
+ - `autolink`
638
+
639
+ [redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
640
+
641
+ ### Kramdown
642
+
643
+ In addition to the defaults mentioned above, you can also turn on recognition
644
+ of Github Flavored Markdown by passing an `input` option with a value of "GFM".
645
+
646
+ For example, in your `_config.yml`:
647
+
648
+ kramdown:
649
+ input: GFM
650
+
651
+ ### Custom Markdown Processors
652
+
653
+ If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
654
+
655
+ {% highlight ruby %}
656
+ class Jekyll::Converters::Markdown::MyCustomProcessor
657
+ def initialize(config)
658
+ require 'funky_markdown'
659
+ @config = config
660
+ rescue LoadError
661
+ STDERR.puts 'You are missing a library required for Markdown. Please run:'
662
+ STDERR.puts ' $ [sudo] gem install funky_markdown'
663
+ raise FatalException.new("Missing dependency: funky_markdown")
664
+ end
665
+
666
+ def convert(content)
667
+ ::FunkyMarkdown.new(content).convert
668
+ end
669
+ end
670
+ {% endhighlight %}
671
+
672
+ Once you've created your class and have it properly setup either as a plugin in
673
+ the `_plugins` folder or as a gem, specify it in your `_config.yml`:
674
+
675
+ {% highlight yaml %}
676
+ markdown: MyCustomProcessor
677
+ {% endhighlight %}