monad 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CONTRIBUTING.markdown +91 -0
- data/Gemfile +1 -1
- data/History.markdown +772 -0
- data/{README.md → README.markdown} +5 -2
- data/Rakefile +163 -1
- data/bin/monad +86 -30
- data/features/create_sites.feature +54 -25
- data/features/data.feature +65 -0
- data/features/data_sources.feature +10 -10
- data/features/drafts.feature +5 -5
- data/features/embed_filters.feature +10 -10
- data/features/include_tag.feature +48 -0
- data/features/markdown.feature +5 -5
- data/features/pagination.feature +38 -10
- data/features/permalinks.feature +31 -11
- data/features/post_data.feature +41 -41
- data/features/post_excerpts.feature +50 -0
- data/features/site_configuration.feature +47 -26
- data/features/site_data.feature +30 -24
- data/features/step_definitions/{monad_steps.rb → jekyll_steps.rb} +66 -52
- data/features/support/env.rb +27 -8
- data/lib/jekyll.rb +99 -0
- data/lib/jekyll/cleaner.rb +73 -0
- data/lib/{monad → jekyll}/command.rb +6 -6
- data/lib/{monad → jekyll}/commands/build.rb +9 -9
- data/lib/jekyll/commands/doctor.rb +67 -0
- data/lib/jekyll/commands/new.rb +67 -0
- data/lib/jekyll/commands/serve.rb +65 -0
- data/lib/{monad → jekyll}/configuration.rb +60 -18
- data/lib/{monad → jekyll}/converter.rb +1 -1
- data/lib/{monad → jekyll}/converters/identity.rb +1 -1
- data/lib/{monad → jekyll}/converters/markdown.rb +2 -2
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +29 -0
- data/lib/{monad → jekyll}/converters/markdown/maruku_parser.rb +12 -8
- data/lib/{monad → jekyll}/converters/markdown/rdiscount_parser.rb +4 -2
- data/lib/{monad → jekyll}/converters/markdown/redcarpet_parser.rb +1 -1
- data/lib/{monad → jekyll}/converters/textile.rb +1 -1
- data/lib/{monad → jekyll}/convertible.rb +39 -17
- data/lib/{monad → jekyll}/core_ext.rb +22 -4
- data/lib/jekyll/deprecator.rb +36 -0
- data/lib/{monad → jekyll}/draft.rb +1 -1
- data/lib/{monad → jekyll}/drivers/json_driver.rb +1 -1
- data/lib/{monad → jekyll}/drivers/yaml_driver.rb +1 -1
- data/lib/{monad → jekyll}/errors.rb +1 -1
- data/lib/jekyll/excerpt.rb +113 -0
- data/lib/{monad → jekyll}/filters.rb +16 -6
- data/lib/{monad → jekyll}/generator.rb +1 -1
- data/lib/jekyll/generators/pagination.rb +214 -0
- data/lib/{monad → jekyll}/layout.rb +4 -1
- data/lib/{monad → jekyll}/mime.types +0 -0
- data/lib/{monad → jekyll}/page.rb +36 -39
- data/lib/{monad → jekyll}/plugin.rb +1 -1
- data/lib/{monad → jekyll}/post.rb +58 -123
- data/lib/jekyll/related_posts.rb +59 -0
- data/lib/{monad → jekyll}/site.rb +120 -123
- data/lib/{monad → jekyll}/static_file.rb +1 -1
- data/lib/jekyll/stevenson.rb +89 -0
- data/lib/jekyll/tags/gist.rb +48 -0
- data/lib/{monad → jekyll}/tags/highlight.rb +3 -3
- data/lib/jekyll/tags/include.rb +135 -0
- data/lib/{monad → jekyll}/tags/post_url.rb +8 -6
- data/lib/jekyll/url.rb +67 -0
- data/lib/monad.rb +36 -27
- data/lib/site_template/_config.yml +2 -1
- data/lib/site_template/_layouts/default.html +21 -23
- data/lib/site_template/_layouts/post.html +1 -1
- data/lib/site_template/_posts/{0000-00-00-welcome-to-monad.markdown.erb → 0000-00-00-welcome-to-jekyll.markdown.erb} +6 -6
- data/lib/site_template/css/main.css +22 -27
- data/lib/site_template/index.html +2 -2
- data/monad.gemspec +153 -52
- data/site/.gitignore +4 -0
- data/site/CNAME +1 -0
- data/site/README +1 -0
- data/site/_config.yml +6 -0
- data/site/_includes/analytics.html +32 -0
- data/site/_includes/docs_contents.html +16 -0
- data/site/_includes/docs_contents_mobile.html +23 -0
- data/site/_includes/docs_option.html +11 -0
- data/site/_includes/docs_ul.html +20 -0
- data/site/_includes/footer.html +15 -0
- data/site/_includes/header.html +18 -0
- data/site/_includes/news_contents.html +23 -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 +14 -0
- data/site/_includes/section_nav.html +22 -0
- data/site/_includes/top.html +17 -0
- data/site/_layouts/default.html +12 -0
- data/site/_layouts/docs.html +23 -0
- data/site/_layouts/news.html +19 -0
- data/site/_layouts/news_item.html +27 -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/css/gridism.css +110 -0
- data/site/css/normalize.css +1 -0
- data/site/css/pygments.css +70 -0
- data/site/css/style.css +946 -0
- data/site/docs/configuration.md +373 -0
- data/site/docs/contributing.md +128 -0
- data/site/docs/datafiles.md +63 -0
- data/site/docs/deployment-methods.md +109 -0
- data/site/docs/drafts.md +20 -0
- data/site/docs/extras.md +56 -0
- data/site/docs/frontmatter.md +180 -0
- data/site/docs/github-pages.md +91 -0
- data/site/docs/heroku.md +9 -0
- data/site/docs/history.md +722 -0
- data/site/docs/index.md +52 -0
- data/site/docs/installation.md +76 -0
- data/site/docs/migrations.md +257 -0
- data/site/docs/pages.md +86 -0
- data/site/docs/pagination.md +211 -0
- data/site/docs/permalinks.md +180 -0
- data/site/docs/plugins.md +508 -0
- data/site/docs/posts.md +181 -0
- data/site/docs/quickstart.md +32 -0
- data/site/docs/resources.md +46 -0
- data/site/docs/sites.md +29 -0
- data/site/docs/structure.md +190 -0
- data/site/docs/templates.md +319 -0
- data/site/docs/troubleshooting.md +150 -0
- data/site/docs/upgrading.md +146 -0
- data/site/docs/usage.md +63 -0
- data/site/docs/variables.md +322 -0
- data/site/favicon.png +0 -0
- data/site/feed.xml +36 -0
- data/site/freenode.txt +1 -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/logo-2x.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/img/tube.png +0 -0
- data/site/img/tube1x.png +0 -0
- data/site/index.html +90 -0
- data/site/js/modernizr-2.5.3.min.js +4 -0
- data/site/news/index.html +10 -0
- data/site/news/releases/index.html +10 -0
- data/test/helper.rb +6 -3
- data/test/source/+/foo.md +7 -0
- data/test/source/_data/languages.yml +2 -0
- data/test/source/_data/members.yaml +7 -0
- data/test/source/_data/products.yml +4 -0
- data/test/source/_includes/params.html +7 -0
- data/test/source/_layouts/default.html +1 -1
- data/test/source/_layouts/post/simple.html +1 -0
- data/test/source/_plugins/dummy.rb +1 -1
- data/test/source/_posts/2013-01-02-post-excerpt.markdown +1 -1
- data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +23 -0
- data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
- data/test/source/deal.with.dots.html +1 -1
- data/test/source/products.yml +4 -0
- data/test/test_configuration.rb +46 -11
- data/test/test_convertible.rb +2 -2
- data/test/test_excerpt.rb +78 -0
- data/test/test_filters.rb +4 -4
- data/test/test_generated_site.rb +13 -13
- data/test/test_json_driver.rb +9 -9
- data/test/test_kramdown.rb +32 -5
- data/test/test_new_command.rb +8 -8
- data/test/test_page.rb +12 -3
- data/test/test_pager.rb +34 -33
- data/test/test_post.rb +34 -26
- data/test/test_redcloth.rb +3 -3
- data/test/test_related_posts.rb +47 -0
- data/test/test_site.rb +102 -44
- data/test/test_tags.rb +168 -23
- data/test/test_url.rb +28 -0
- data/test/test_yaml_driver.rb +6 -6
- metadata +215 -137
- data/lib/monad/commands/doctor.rb +0 -29
- data/lib/monad/commands/new.rb +0 -50
- data/lib/monad/commands/serve.rb +0 -33
- data/lib/monad/converters/markdown/kramdown_parser.rb +0 -44
- data/lib/monad/deprecator.rb +0 -32
- data/lib/monad/generators/pagination.rb +0 -143
- data/lib/monad/logger.rb +0 -54
- data/lib/monad/tags/gist.rb +0 -30
- data/lib/monad/tags/include.rb +0 -37
@@ -0,0 +1,319 @@
|
|
1
|
+
---
|
2
|
+
layout: docs
|
3
|
+
title: Templates
|
4
|
+
prev_section: migrations
|
5
|
+
next_section: permalinks
|
6
|
+
permalink: /docs/templates/
|
7
|
+
---
|
8
|
+
|
9
|
+
Jekyll uses the [Liquid](http://wiki.shopify.com/Liquid) templating language to
|
10
|
+
process templates. All of the standard Liquid [tags](http://wiki.shopify.com/Logic) and
|
11
|
+
[filters](http://wiki.shopify.com/Filters) are
|
12
|
+
supported. Jekyll even adds a few handy filters and tags of its own to make
|
13
|
+
common tasks easier.
|
14
|
+
|
15
|
+
## Filters
|
16
|
+
|
17
|
+
<div class="mobile-side-scroller">
|
18
|
+
<table>
|
19
|
+
<thead>
|
20
|
+
<tr>
|
21
|
+
<th>Description</th>
|
22
|
+
<th><span class="filter">Filter</span> and <span class="output">Output</span></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td>
|
28
|
+
<p class='name'><strong>Date to XML Schema</strong></p>
|
29
|
+
<p>Convert a Date into XML Schema (ISO 8601) format.</p>
|
30
|
+
</td>
|
31
|
+
<td class='align-center'>
|
32
|
+
<p>
|
33
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_xmlschema }}{% endraw %}</code>
|
34
|
+
</p>
|
35
|
+
<p>
|
36
|
+
<code class='output'>2008-11-17T13:07:54-08:00</code>
|
37
|
+
</p>
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td>
|
42
|
+
<p class='name'><strong>Date to RFC-822 Format</strong></p>
|
43
|
+
<p>Convert a Date into the RFC-822 format used for RSS feeds.</p>
|
44
|
+
</td>
|
45
|
+
<td class='align-center'>
|
46
|
+
<p>
|
47
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_rfc822 }}{% endraw %}</code>
|
48
|
+
</p>
|
49
|
+
<p>
|
50
|
+
<code class='output'>Mon, 17 Nov 2008 13:07:54 -0800</code>
|
51
|
+
</p>
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td>
|
56
|
+
<p class='name'><strong>Date to String</strong></p>
|
57
|
+
<p>Convert a date to short format.</p>
|
58
|
+
</td>
|
59
|
+
<td class='align-center'>
|
60
|
+
<p>
|
61
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_string }}{% endraw %}</code>
|
62
|
+
</p>
|
63
|
+
<p>
|
64
|
+
<code class='output'>17 Nov 2008</code>
|
65
|
+
</p>
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td>
|
70
|
+
<p class='name'><strong>Date to Long String</strong></p>
|
71
|
+
<p>Format a date to long format.</p>
|
72
|
+
</td>
|
73
|
+
<td class='align-center'>
|
74
|
+
<p>
|
75
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_long_string }}{% endraw %}</code>
|
76
|
+
</p>
|
77
|
+
<p>
|
78
|
+
<code class='output'>17 November 2008</code>
|
79
|
+
</p>
|
80
|
+
</td>
|
81
|
+
</tr>
|
82
|
+
<tr>
|
83
|
+
<td>
|
84
|
+
<p class='name'><strong>XML Escape</strong></p>
|
85
|
+
<p>Escape some text for use in XML.</p>
|
86
|
+
</td>
|
87
|
+
<td class='align-center'>
|
88
|
+
<p>
|
89
|
+
<code class='filter'>{% raw %}{{ page.content | xml_escape }}{% endraw %}</code>
|
90
|
+
</p>
|
91
|
+
</td>
|
92
|
+
</tr>
|
93
|
+
<tr>
|
94
|
+
<td>
|
95
|
+
<p class='name'><strong>CGI Escape</strong></p>
|
96
|
+
<p>
|
97
|
+
CGI escape a string for use in a URL. Replaces any special characters
|
98
|
+
with appropriate %XX replacements.
|
99
|
+
</p>
|
100
|
+
</td>
|
101
|
+
<td class='align-center'>
|
102
|
+
<p>
|
103
|
+
<code class='filter'>{% raw %}{{ “foo,bar;baz?” | cgi_escape }}{% endraw %}</code>
|
104
|
+
</p>
|
105
|
+
<p>
|
106
|
+
<code class='output'>foo%2Cbar%3Bbaz%3F</code>
|
107
|
+
</p>
|
108
|
+
</td>
|
109
|
+
</tr>
|
110
|
+
<tr>
|
111
|
+
<td>
|
112
|
+
<p class='name'><strong>URI Escape</strong></p>
|
113
|
+
<p>
|
114
|
+
URI escape a string.
|
115
|
+
</p>
|
116
|
+
</td>
|
117
|
+
<td class='align-center'>
|
118
|
+
<p>
|
119
|
+
<code class='filter'>{% raw %}{{ “'foo, bar \\baz?'” | uri_escape }}{% endraw %}</code>
|
120
|
+
</p>
|
121
|
+
<p>
|
122
|
+
<code class='output'>foo,%20bar%20%5Cbaz?</code>
|
123
|
+
</p>
|
124
|
+
</td>
|
125
|
+
</tr>
|
126
|
+
<tr>
|
127
|
+
<td>
|
128
|
+
<p class='name'><strong>Number of Words</strong></p>
|
129
|
+
<p>Count the number of words in some text.</p>
|
130
|
+
</td>
|
131
|
+
<td class='align-center'>
|
132
|
+
<p>
|
133
|
+
<code class='filter'>{% raw %}{{ page.content | number_of_words }}{% endraw %}</code>
|
134
|
+
</p>
|
135
|
+
<p>
|
136
|
+
<code class='output'>1337</code>
|
137
|
+
</p>
|
138
|
+
</td>
|
139
|
+
</tr>
|
140
|
+
<tr>
|
141
|
+
<td>
|
142
|
+
<p class='name'><strong>Array to Sentence</strong></p>
|
143
|
+
<p>Convert an array into a sentence. Useful for listing tags.</p>
|
144
|
+
</td>
|
145
|
+
<td class='align-center'>
|
146
|
+
<p>
|
147
|
+
<code class='filter'>{% raw %}{{ page.tags | array_to_sentence_string }}{% endraw %}</code>
|
148
|
+
</p>
|
149
|
+
<p>
|
150
|
+
<code class='output'>foo, bar, and baz</code>
|
151
|
+
</p>
|
152
|
+
</td>
|
153
|
+
</tr>
|
154
|
+
<tr>
|
155
|
+
<td>
|
156
|
+
<p class='name'><strong>Textilize</strong></p>
|
157
|
+
<p>Convert a Textile-formatted string into HTML, formatted via RedCloth</p>
|
158
|
+
</td>
|
159
|
+
<td class='align-center'>
|
160
|
+
<p>
|
161
|
+
<code class='filter'>{% raw %}{{ page.excerpt | textilize }}{% endraw %}</code>
|
162
|
+
</p>
|
163
|
+
</td>
|
164
|
+
</tr>
|
165
|
+
<tr>
|
166
|
+
<td>
|
167
|
+
<p class='name'><strong>Markdownify</strong></p>
|
168
|
+
<p>Convert a Markdown-formatted string into HTML.</p>
|
169
|
+
</td>
|
170
|
+
<td class='align-center'>
|
171
|
+
<p>
|
172
|
+
<code class='filter'>{% raw %}{{ page.excerpt | markdownify }}{% endraw %}</code>
|
173
|
+
</p>
|
174
|
+
</td>
|
175
|
+
</tr>
|
176
|
+
</tbody>
|
177
|
+
</table>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
## Tags
|
181
|
+
|
182
|
+
### Includes
|
183
|
+
|
184
|
+
If you have small page fragments that you wish to include in multiple places on
|
185
|
+
your site, you can use the `include` tag.
|
186
|
+
|
187
|
+
{% highlight ruby %}
|
188
|
+
{% raw %}{% include footer.html %}{% endraw %}
|
189
|
+
{% endhighlight %}
|
190
|
+
|
191
|
+
Jekyll expects all include files to be placed in an `_includes` directory at the
|
192
|
+
root of your source directory. This will embed the contents of
|
193
|
+
`<source>/_includes/footer.html` into the calling file.
|
194
|
+
|
195
|
+
<div class="note">
|
196
|
+
<h5>ProTip™: Use variables as file name</h5>
|
197
|
+
<p>
|
198
|
+
|
199
|
+
The name of the file you wish to embed can be literal (as in the example above),
|
200
|
+
or you can use a variable, using liquid-like variable syntax as in
|
201
|
+
<code>{% raw %}{% include {{my_variable}} %}{% endraw %}</code>.
|
202
|
+
|
203
|
+
Note that unlike usual liquid variable syntax, you cannot have spaces inside the curly braces.
|
204
|
+
|
205
|
+
</p>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
You can also pass parameters to an include:
|
209
|
+
|
210
|
+
{% highlight ruby %}
|
211
|
+
{% raw %}{% include footer.html param="value" %}{% endraw %}
|
212
|
+
{% endhighlight %}
|
213
|
+
|
214
|
+
These parameters are available via Liquid in the include:
|
215
|
+
|
216
|
+
{% highlight ruby %}
|
217
|
+
{% raw %}{{ include.param }}{% endraw %}
|
218
|
+
{% endhighlight %}
|
219
|
+
|
220
|
+
### Code snippet highlighting
|
221
|
+
|
222
|
+
Jekyll has built in support for syntax highlighting of [over 100
|
223
|
+
languages](http://pygments.org/languages/) thanks to
|
224
|
+
[Pygments](http://pygments.org/). To use Pygments, you must have Python installed on your
|
225
|
+
system and set `pygments` to `true` in your site's configuration file.
|
226
|
+
|
227
|
+
To render a code block with syntax highlighting, surround your code as follows:
|
228
|
+
|
229
|
+
{% highlight text %}
|
230
|
+
{% raw %}
|
231
|
+
{% highlight ruby %}
|
232
|
+
def foo
|
233
|
+
puts 'foo'
|
234
|
+
end
|
235
|
+
{% endhighlight %}
|
236
|
+
{% endraw %}
|
237
|
+
{% endhighlight %}
|
238
|
+
|
239
|
+
The argument to the `highlight` tag (`ruby` in the example above) is the
|
240
|
+
language identifier. To find the appropriate identifier to use for the language
|
241
|
+
you want to highlight, look for the “short name” on the [Lexers
|
242
|
+
page](http://pygments.org/docs/lexers/).
|
243
|
+
|
244
|
+
#### Line numbers
|
245
|
+
|
246
|
+
There is a second argument to `highlight` called `linenos` that is optional.
|
247
|
+
Including the `linenos` argument will force the highlighted code to include line
|
248
|
+
numbers. For instance, the following code block would include line numbers next
|
249
|
+
to each line:
|
250
|
+
|
251
|
+
{% highlight text %}
|
252
|
+
{% raw %}
|
253
|
+
{% highlight ruby linenos %}
|
254
|
+
def foo
|
255
|
+
puts 'foo'
|
256
|
+
end
|
257
|
+
{% endhighlight %}
|
258
|
+
{% endraw %}
|
259
|
+
{% endhighlight %}
|
260
|
+
|
261
|
+
#### Stylesheets for syntax highlighting
|
262
|
+
|
263
|
+
In order for the highlighting to show up, you’ll need to include a highlighting
|
264
|
+
stylesheet. For an example stylesheet you can look at
|
265
|
+
[syntax.css](http://github.com/mojombo/tpw/tree/master/css/syntax.css). These
|
266
|
+
are the same styles as used by GitHub and you are free to use them for your own
|
267
|
+
site. If you use `linenos`, you might want to include an additional CSS class
|
268
|
+
definition for the `.lineno` class in `syntax.css` to distinguish the line
|
269
|
+
numbers from the highlighted code.
|
270
|
+
|
271
|
+
### Post URL
|
272
|
+
|
273
|
+
If you would like to include a link to a post on your site, the `post_url` tag
|
274
|
+
will generate the correct permalink URL for the post you specify.
|
275
|
+
|
276
|
+
{% highlight text %}
|
277
|
+
{% raw %}
|
278
|
+
{% post_url 2010-07-21-name-of-post %}
|
279
|
+
{% endraw %}
|
280
|
+
{% endhighlight %}
|
281
|
+
|
282
|
+
There is no need to include the file extension when using the `post_url` tag.
|
283
|
+
|
284
|
+
You can also use this tag to create a link to a post in Markdown as follows:
|
285
|
+
|
286
|
+
{% highlight text %}
|
287
|
+
{% raw %}
|
288
|
+
[Name of Link]({% post_url 2010-07-21-name-of-post %})
|
289
|
+
{% endraw %}
|
290
|
+
{% endhighlight %}
|
291
|
+
|
292
|
+
### Gist
|
293
|
+
|
294
|
+
Use the `gist` tag to easily embed a GitHub Gist onto your site:
|
295
|
+
|
296
|
+
{% highlight text %}
|
297
|
+
{% raw %}
|
298
|
+
{% gist 5555251 %}
|
299
|
+
{% endraw %}
|
300
|
+
{% endhighlight %}
|
301
|
+
|
302
|
+
You may also optionally specify the filename in the gist to display:
|
303
|
+
|
304
|
+
{% highlight text %}
|
305
|
+
{% raw %}
|
306
|
+
{% gist 5555251 result.md %}
|
307
|
+
{% endraw %}
|
308
|
+
{% endhighlight %}
|
309
|
+
|
310
|
+
The `gist` tag also works with private gists, which require the gist owner's
|
311
|
+
github username:
|
312
|
+
|
313
|
+
{% highlight text %}
|
314
|
+
{% raw %}
|
315
|
+
{% gist parkr/931c1c8d465a04042403 %}
|
316
|
+
{% endraw %}
|
317
|
+
{% endhighlight %}
|
318
|
+
|
319
|
+
The private gist syntax also supports filenames.
|
@@ -0,0 +1,150 @@
|
|
1
|
+
---
|
2
|
+
layout: docs
|
3
|
+
title: Troubleshooting
|
4
|
+
prev_section: deployment-methods
|
5
|
+
next_section: sites
|
6
|
+
permalink: /docs/troubleshooting/
|
7
|
+
---
|
8
|
+
|
9
|
+
If you ever run into problems installing or using Jekyll, here's a few tips
|
10
|
+
that might be of help. If the problem you’re experiencing isn’t covered below,
|
11
|
+
please [report an issue]({{ site.repository }}/issues/new) so the
|
12
|
+
Jekyll community can make everyone’s experience better.
|
13
|
+
|
14
|
+
## Installation Problems
|
15
|
+
|
16
|
+
If you encounter errors during gem installation, you may need to install
|
17
|
+
the header files for compiling extension modules for ruby 1.9.1. This
|
18
|
+
can be done on Ubuntu or Debian by running:
|
19
|
+
|
20
|
+
{% highlight bash %}
|
21
|
+
sudo apt-get install ruby1.9.1-dev
|
22
|
+
{% endhighlight %}
|
23
|
+
|
24
|
+
On Red Hat, CentOS, and Fedora systems you can do this by running:
|
25
|
+
|
26
|
+
{% highlight bash %}
|
27
|
+
sudo yum install ruby-devel
|
28
|
+
{% endhighlight %}
|
29
|
+
|
30
|
+
On [NearlyFreeSpeech](http://nearlyfreespeech.net/) you need to run the
|
31
|
+
command with the following environment variable:
|
32
|
+
|
33
|
+
{% highlight bash %}
|
34
|
+
RB_USER_INSTALL=true gem install jekyll
|
35
|
+
{% endhighlight %}
|
36
|
+
|
37
|
+
On OSX, you may need to update RubyGems:
|
38
|
+
|
39
|
+
{% highlight bash %}
|
40
|
+
sudo gem update --system
|
41
|
+
{% endhighlight %}
|
42
|
+
|
43
|
+
If you still have issues, you may need to [use XCode to install Command Line
|
44
|
+
Tools](http://www.zlu.me/blog/2012/02/21/install-native-ruby-gem-in-mountain-lion-preview/)
|
45
|
+
that will allow you to install native gems using the following command:
|
46
|
+
|
47
|
+
{% highlight bash %}
|
48
|
+
sudo gem install jekyll
|
49
|
+
{% endhighlight %}
|
50
|
+
|
51
|
+
To install RubyGems on Gentoo:
|
52
|
+
|
53
|
+
{% highlight bash %}
|
54
|
+
sudo emerge -av dev-ruby/rubygems
|
55
|
+
{% endhighlight %}
|
56
|
+
|
57
|
+
On Windows, you may need to install [RubyInstaller
|
58
|
+
DevKit](http://wiki.github.com/oneclick/rubyinstaller/development-kit).
|
59
|
+
|
60
|
+
## Problems running Jekyll
|
61
|
+
|
62
|
+
On Debian or Ubuntu, you may need to add `/var/lib/gems/1.8/bin/` to your path
|
63
|
+
in order to have the `jekyll` executable be available in your Terminal.
|
64
|
+
|
65
|
+
## Base-URL Problems
|
66
|
+
|
67
|
+
If you are using base-url option like:
|
68
|
+
|
69
|
+
{% highlight bash %}
|
70
|
+
jekyll serve --baseurl '/blog'
|
71
|
+
{% endhighlight %}
|
72
|
+
|
73
|
+
… then make sure that you access the site at:
|
74
|
+
|
75
|
+
{% highlight bash %}
|
76
|
+
http://localhost:4000/blog/index.html
|
77
|
+
{% endhighlight %}
|
78
|
+
|
79
|
+
It won’t work to just access:
|
80
|
+
|
81
|
+
{% highlight bash %}
|
82
|
+
http://localhost:4000/blog
|
83
|
+
{% endhighlight %}
|
84
|
+
|
85
|
+
## Configuration problems
|
86
|
+
|
87
|
+
The order of precedence for conflicting [configuration settings](../configuration/)
|
88
|
+
is as follows:
|
89
|
+
|
90
|
+
1. Command-line flags
|
91
|
+
2. Configuration file settings
|
92
|
+
3. Defaults
|
93
|
+
|
94
|
+
That is: defaults are overridden by options specified in `_config.yml`,
|
95
|
+
and flags specified at the command-line will override all other settings
|
96
|
+
specified elsewhere.
|
97
|
+
|
98
|
+
## Markup Problems
|
99
|
+
|
100
|
+
The various markup engines that Jekyll uses may have some issues. This
|
101
|
+
page will document them to help others who may run into the same
|
102
|
+
problems.
|
103
|
+
|
104
|
+
### Maruku
|
105
|
+
|
106
|
+
If your link has characters that need to be escaped, you need to use
|
107
|
+
this syntax:
|
108
|
+
|
109
|
+
{% highlight text %}
|
110
|
+
![Alt text](http://yuml.me/diagram/class/[Project]->[Task])
|
111
|
+
{% endhighlight %}
|
112
|
+
|
113
|
+
If you have an empty tag, i.e. `<script src="js.js"></script>`, Maruku
|
114
|
+
transforms this into `<script src="js.js" />`. This causes problems in
|
115
|
+
Firefox and possibly other browsers and is [discouraged in
|
116
|
+
XHTML.](http://www.w3.org/TR/xhtml1/#C_3) An easy fix is to put a space
|
117
|
+
between the opening and closing tags.
|
118
|
+
|
119
|
+
### RedCloth
|
120
|
+
|
121
|
+
Versions 4.1.1 and higher do not obey the notextile tag. [This is a known
|
122
|
+
bug](http://aaronqian.com/articles/2009/04/07/redcloth-ate-my-notextile.html)
|
123
|
+
and will hopefully be fixed for 4.2. You can still use 4.1.9, but the
|
124
|
+
test suite requires that 4.1.0 be installed. If you use a version of
|
125
|
+
RedCloth that does not have the notextile tag, you may notice that
|
126
|
+
syntax highlighted blocks from Pygments are not formatted correctly,
|
127
|
+
among other things. If you’re seeing this just install 4.1.0.
|
128
|
+
|
129
|
+
### Liquid
|
130
|
+
|
131
|
+
The latest version, version 2.0, seems to break the use of `{{ "{{" }}` in
|
132
|
+
templates. Unlike previous versions, using `{{ "{{" }}` in 2.0 triggers the
|
133
|
+
following error:
|
134
|
+
|
135
|
+
{% highlight bash %}
|
136
|
+
'{{ "{{" }}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)
|
137
|
+
{% endhighlight %}
|
138
|
+
|
139
|
+
### Excerpts
|
140
|
+
|
141
|
+
Since v1.0.0, Jekyll has had automatically-generated post excerpts. Since
|
142
|
+
v1.1.0, Jekyll also passes these excerpts through Liquid, which can cause
|
143
|
+
strange errors where references don't exist or a tag hasn't been closed. If you
|
144
|
+
run into these errors, try setting `excerpt_separator: ""` in your
|
145
|
+
`_config.yml`, or set it to some nonsense string.
|
146
|
+
|
147
|
+
<div class="note">
|
148
|
+
<h5>Please report issues you encounter!</h5>
|
149
|
+
<p>If you come across a bug, please <a href="{{ site.repository }}/issues/new">create an issue</a> on GitHub describing the problem and any work-arounds you find so we can document it here for others.</p>
|
150
|
+
</div>
|