jekyll 1.0.0.beta3 → 1.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- data/CONTRIBUTING.md +3 -2
- data/History.txt +10 -0
- data/README.textile +1 -2
- data/bin/jekyll +1 -4
- data/features/step_definitions/jekyll_steps.rb +0 -8
- data/jekyll.gemspec +5 -4
- data/lib/jekyll.rb +13 -3
- data/lib/jekyll/filters.rb +14 -0
- data/lib/jekyll/generators/pagination.rb +20 -8
- data/lib/jekyll/post.rb +4 -0
- data/lib/jekyll/site.rb +1 -0
- data/site/_posts/2012-07-01-configuration.md +84 -83
- data/site/_posts/2012-07-01-contributing.md +58 -37
- data/site/_posts/2012-07-01-extras.md +43 -31
- data/site/_posts/2012-07-01-frontmatter.md +60 -16
- data/site/_posts/2012-07-01-github-pages.md +39 -8
- data/site/_posts/2012-07-01-home.md +30 -11
- data/site/_posts/2012-07-01-installation.md +31 -8
- data/site/_posts/2012-07-01-migrations.md +34 -10
- data/site/_posts/2012-07-01-pages.md +49 -26
- data/site/_posts/2012-07-01-pagination.md +136 -43
- data/site/_posts/2012-07-01-permalinks.md +25 -15
- data/site/_posts/2012-07-01-plugins.md +94 -50
- data/site/_posts/2012-07-01-posts.md +75 -24
- data/site/_posts/2012-07-01-structure.md +68 -8
- data/site/_posts/2012-07-01-templates.md +62 -45
- data/site/_posts/2012-07-01-usage.md +36 -17
- data/site/_posts/2012-07-01-variables.md +133 -23
- data/site/css/style.css +1 -1
- data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
- data/test/test_filters.rb +17 -0
- data/test/test_post.rb +23 -0
- data/test/test_site.rb +3 -1
- metadata +11 -4
@@ -5,7 +5,13 @@ prev_section: usage
|
|
5
5
|
next_section: configuration
|
6
6
|
---
|
7
7
|
|
8
|
-
Jekyll at its core
|
8
|
+
Jekyll is, at its core, a text transformation engine. The concept behind the
|
9
|
+
system is this: you give it text written in your favorite markup language, be
|
10
|
+
that Markdown, Textile, or just plain HTML, and it churns that through a layout
|
11
|
+
or series of layout files. Throughout that process you can tweak how you want
|
12
|
+
the site URLs to look, what data gets displayed in the layout and more. This is
|
13
|
+
all done through editing text files, and the static web site is the final
|
14
|
+
product.
|
9
15
|
|
10
16
|
A basic Jekyll site usually looks something like this:
|
11
17
|
|
@@ -40,7 +46,13 @@ An overview of what each of these does:
|
|
40
46
|
<p><code>_config.yml</code></p>
|
41
47
|
</td>
|
42
48
|
<td>
|
43
|
-
<p>
|
49
|
+
<p>
|
50
|
+
|
51
|
+
Stores <a href="../configuration">configuration</a> data. Many of
|
52
|
+
these options can be specified from the command line executable but
|
53
|
+
it’s easier to specify them here so you don’t have to remember them.
|
54
|
+
|
55
|
+
</p>
|
44
56
|
</td>
|
45
57
|
</tr>
|
46
58
|
<tr>
|
@@ -48,7 +60,15 @@ An overview of what each of these does:
|
|
48
60
|
<p><code>_includes</code></p>
|
49
61
|
</td>
|
50
62
|
<td>
|
51
|
-
<p>
|
63
|
+
<p>
|
64
|
+
|
65
|
+
These are the partials that can be mixed and matched by your layouts
|
66
|
+
and posts to facilitate reuse. The liquid tag
|
67
|
+
<code>{% raw %}{% include file.ext %}{% endraw %}</code>
|
68
|
+
can be used to include the partial in
|
69
|
+
<code>_includes/file.ext</code>.
|
70
|
+
|
71
|
+
</p>
|
52
72
|
</td>
|
53
73
|
</tr>
|
54
74
|
<tr>
|
@@ -56,7 +76,15 @@ An overview of what each of these does:
|
|
56
76
|
<p><code>_layouts</code></p>
|
57
77
|
</td>
|
58
78
|
<td>
|
59
|
-
<p>
|
79
|
+
<p>
|
80
|
+
|
81
|
+
These are the templates that wrap posts. Layouts are chosen on a post-
|
82
|
+
by-post basis in the <a href="../frontmatter">YAML front matter</a>,
|
83
|
+
which is described in the next section. The liquid tag
|
84
|
+
<code>{% raw %}{{ content }}{% endraw %}</code>
|
85
|
+
is used to inject content into the web page.
|
86
|
+
|
87
|
+
</p>
|
60
88
|
</td>
|
61
89
|
</tr>
|
62
90
|
<tr>
|
@@ -64,7 +92,16 @@ An overview of what each of these does:
|
|
64
92
|
<p><code>_posts</code></p>
|
65
93
|
</td>
|
66
94
|
<td>
|
67
|
-
<p>
|
95
|
+
<p>
|
96
|
+
|
97
|
+
Your dynamic content, so to speak. The format of these files is
|
98
|
+
important, and must follow the format:
|
99
|
+
<code>YEAR-MONTH-DAY-title.MARKUP</code>.
|
100
|
+
The <a href="../permalinks">permalinks</a> can be customized for each
|
101
|
+
post, but the date and markup language are determined solely by the
|
102
|
+
file name.
|
103
|
+
|
104
|
+
</p>
|
68
105
|
</td>
|
69
106
|
</tr>
|
70
107
|
<tr>
|
@@ -72,7 +109,13 @@ An overview of what each of these does:
|
|
72
109
|
<p><code>_site</code></p>
|
73
110
|
</td>
|
74
111
|
<td>
|
75
|
-
<p>
|
112
|
+
<p>
|
113
|
+
|
114
|
+
This is where the generated site will be placed (by default) once
|
115
|
+
Jekyll is done transforming it. It's probably a good idea to add this
|
116
|
+
to your <code>.gitignore</code> file.
|
117
|
+
|
118
|
+
</p>
|
76
119
|
</td>
|
77
120
|
</tr>
|
78
121
|
<tr>
|
@@ -80,7 +123,15 @@ An overview of what each of these does:
|
|
80
123
|
<p><code>index.html</code> and other HTML, Markdown, Textile files</p>
|
81
124
|
</td>
|
82
125
|
<td>
|
83
|
-
<p>
|
126
|
+
<p>
|
127
|
+
|
128
|
+
Provided that the file has a <a href="../frontmatter">YAML Front
|
129
|
+
Matter</a> section, it will be transformed by Jekyll. The same will
|
130
|
+
happen for any <code>.html</code>, <code>.markdown</code>,
|
131
|
+
<code>.md</code>, or <code>.textile</code> file in your site's root
|
132
|
+
directory or directories not listed above.
|
133
|
+
|
134
|
+
</p>
|
84
135
|
</td>
|
85
136
|
</tr>
|
86
137
|
<tr>
|
@@ -88,7 +139,16 @@ An overview of what each of these does:
|
|
88
139
|
<p>Other Files/Folders</p>
|
89
140
|
</td>
|
90
141
|
<td>
|
91
|
-
<p>
|
142
|
+
<p>
|
143
|
+
|
144
|
+
Every other directory and file except for those listed above—such as
|
145
|
+
<code>css</code> and <code>images</code> folders,
|
146
|
+
<code>favicon.ico</code> files, and so forth—will be copied verbatim
|
147
|
+
to the generated site. There are plenty of <a href="../sites">sites
|
148
|
+
already using Jekyll</a> if you're curious to see how they're laid
|
149
|
+
out.
|
150
|
+
|
151
|
+
</p>
|
92
152
|
</td>
|
93
153
|
</tr>
|
94
154
|
</tbody>
|
@@ -5,7 +5,11 @@ prev_section: migrations
|
|
5
5
|
next_section: permalinks
|
6
6
|
---
|
7
7
|
|
8
|
-
Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to
|
8
|
+
Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to
|
9
|
+
process templates. All of the [standard Liquid tags and
|
10
|
+
filters](http://wiki.github.com/shopify/liquid/liquid-for-designers) are
|
11
|
+
supported, Jekyll even adds a few handy filters and tags of its own to make
|
12
|
+
common tasks easier.
|
9
13
|
|
10
14
|
## Filters
|
11
15
|
|
@@ -24,7 +28,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
24
28
|
</td>
|
25
29
|
<td class='align-center'>
|
26
30
|
<p>
|
27
|
-
<code class='filter'>{
|
31
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_xmlschema }}{% endraw %}</code>
|
28
32
|
</p>
|
29
33
|
<p>
|
30
34
|
<code class='output'>2008-11-17T13:07:54-08:00</code>
|
@@ -38,7 +42,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
38
42
|
</td>
|
39
43
|
<td class='align-center'>
|
40
44
|
<p>
|
41
|
-
<code class='filter'>{
|
45
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_string }}{% endraw %}</code>
|
42
46
|
</p>
|
43
47
|
<p>
|
44
48
|
<code class='output'>17 Nov 2008</code>
|
@@ -52,7 +56,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
52
56
|
</td>
|
53
57
|
<td class='align-center'>
|
54
58
|
<p>
|
55
|
-
<code class='filter'>{
|
59
|
+
<code class='filter'>{% raw %}{{ site.time | date_to_long_string }}{% endraw %}</code>
|
56
60
|
</p>
|
57
61
|
<p>
|
58
62
|
<code class='output'>17 November 2008</code>
|
@@ -66,18 +70,21 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
66
70
|
</td>
|
67
71
|
<td class='align-center'>
|
68
72
|
<p>
|
69
|
-
<code class='filter'>{
|
73
|
+
<code class='filter'>{% raw %}{{ page.content | xml_escape }}{% endraw %}</code>
|
70
74
|
</p>
|
71
75
|
</td>
|
72
76
|
</tr>
|
73
77
|
<tr>
|
74
78
|
<td>
|
75
79
|
<p class='name'><strong>CGI Escape</strong></p>
|
76
|
-
<p>
|
80
|
+
<p>
|
81
|
+
CGI escape a string for use in a URL. Replaces any special characters
|
82
|
+
with appropriate %XX replacements.
|
83
|
+
</p>
|
77
84
|
</td>
|
78
85
|
<td class='align-center'>
|
79
86
|
<p>
|
80
|
-
<code class='filter'>{
|
87
|
+
<code class='filter'>{% raw %}{{ “foo,bar;baz?” | cgi_escape }}{% endraw %}</code>
|
81
88
|
</p>
|
82
89
|
<p>
|
83
90
|
<code class='output'>foo%2Cbar%3Bbaz%3F</code>
|
@@ -91,7 +98,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
91
98
|
</td>
|
92
99
|
<td class='align-center'>
|
93
100
|
<p>
|
94
|
-
<code class='filter'>{
|
101
|
+
<code class='filter'>{% raw %}{{ page.content | number_of_words }}{% endraw %}</code>
|
95
102
|
</p>
|
96
103
|
<p>
|
97
104
|
<code class='output'>1337</code>
|
@@ -105,7 +112,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
105
112
|
</td>
|
106
113
|
<td class='align-center'>
|
107
114
|
<p>
|
108
|
-
<code class='filter'>{
|
115
|
+
<code class='filter'>{% raw %}{{ page.tags | array_to_sentence_string }}{% endraw %}</code>
|
109
116
|
</p>
|
110
117
|
<p>
|
111
118
|
<code class='output'>foo, bar, and baz</code>
|
@@ -119,7 +126,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
119
126
|
</td>
|
120
127
|
<td class='align-center'>
|
121
128
|
<p>
|
122
|
-
<code class='filter'>{
|
129
|
+
<code class='filter'>{% raw %}{{ page.excerpt | textilize }}{% endraw %}</code>
|
123
130
|
</p>
|
124
131
|
</td>
|
125
132
|
</tr>
|
@@ -130,7 +137,7 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
130
137
|
</td>
|
131
138
|
<td class='align-center'>
|
132
139
|
<p>
|
133
|
-
<code class='filter'>{
|
140
|
+
<code class='filter'>{% raw %}{{ page.excerpt | markdownify }}{% endraw %}</code>
|
134
141
|
</p>
|
135
142
|
</td>
|
136
143
|
</tr>
|
@@ -139,79 +146,89 @@ Jekyll uses the [Liquid](http://www.liquidmarkup.org/) templating language to pr
|
|
139
146
|
|
140
147
|
## Tags
|
141
148
|
|
142
|
-
### Includes
|
149
|
+
### Includes
|
143
150
|
|
144
|
-
If you have small page fragments that you wish to include in multiple
|
145
|
-
|
151
|
+
If you have small page fragments that you wish to include in multiple places on
|
152
|
+
your site, you can use the `include` tag.
|
146
153
|
|
147
154
|
{% highlight ruby %}
|
148
|
-
{
|
155
|
+
{% raw %}{% include sig.md %}{% endraw %}
|
149
156
|
{% endhighlight %}
|
150
157
|
|
151
|
-
Jekyll expects all include files to be placed in an `_includes`
|
152
|
-
|
153
|
-
|
154
|
-
file.
|
158
|
+
Jekyll expects all include files to be placed in an `_includes` directory at the
|
159
|
+
root of your source directory. This will embed the contents of
|
160
|
+
`<source>/_includes/sig.md` into the calling file.
|
155
161
|
|
156
162
|
### Code snippet highlighting
|
157
163
|
|
158
164
|
Jekyll has built in support for syntax highlighting of [over 100
|
159
165
|
languages](http://pygments.org/languages/) thanks to
|
160
|
-
[Pygments](http://pygments.org/). In order to take advantage of this
|
161
|
-
|
162
|
-
|
163
|
-
[Pygments enabled](../extras).
|
166
|
+
[Pygments](http://pygments.org/). In order to take advantage of this you’ll need
|
167
|
+
to have Pygments installed, and the `pygmentize` binary must be in your `$PATH`.
|
168
|
+
When you run Jekyll, make sure you run it with [Pygments enabled](../extras).
|
164
169
|
|
165
170
|
To render a code block with syntax highlighting, surround your code as follows:
|
166
171
|
|
172
|
+
{% highlight text %}
|
173
|
+
{% raw %}
|
167
174
|
{% highlight ruby %}
|
168
|
-
{{ "{% highlight ruby " }}%}
|
169
175
|
def foo
|
170
176
|
puts 'foo'
|
171
177
|
end
|
172
|
-
{
|
178
|
+
{% endhighlight %}
|
179
|
+
{% endraw %}
|
173
180
|
{% endhighlight %}
|
174
181
|
|
175
|
-
The argument to the `highlight` tag (`ruby` in the example above) is the
|
182
|
+
The argument to the `highlight` tag (`ruby` in the example above) is the
|
183
|
+
language identifier. To find the appropriate identifier to use for the language
|
184
|
+
you want to highlight, look for the “short name” on the [Lexers
|
185
|
+
page](http://pygments.org/docs/lexers/).
|
176
186
|
|
177
187
|
#### Line numbers
|
178
188
|
|
179
|
-
There is a second argument to `highlight` called `linenos` that is
|
180
|
-
|
181
|
-
|
182
|
-
|
189
|
+
There is a second argument to `highlight` called `linenos` that is optional.
|
190
|
+
Including the `linenos` argument will force the highlighted code to include line
|
191
|
+
numbers. For instance, the following code block would include line numbers next
|
192
|
+
to each line:
|
183
193
|
|
184
|
-
{% highlight
|
185
|
-
{
|
194
|
+
{% highlight text %}
|
195
|
+
{% raw %}
|
196
|
+
{% highlight ruby linenos %}
|
186
197
|
def foo
|
187
198
|
puts 'foo'
|
188
199
|
end
|
189
|
-
{
|
200
|
+
{% endhighlight %}
|
201
|
+
{% endraw %}
|
190
202
|
{% endhighlight %}
|
191
203
|
|
192
204
|
#### Stylesheets for syntax highlighting
|
193
205
|
|
194
|
-
In order for the highlighting to show up, you’ll need to include a
|
195
|
-
|
196
|
-
[syntax.css](http://github.com/mojombo/tpw/tree/master/css/syntax.css).
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
206
|
+
In order for the highlighting to show up, you’ll need to include a highlighting
|
207
|
+
stylesheet. For an example stylesheet you can look at
|
208
|
+
[syntax.css](http://github.com/mojombo/tpw/tree/master/css/syntax.css). These
|
209
|
+
are the same styles as used by GitHub and you are free to use them for your own
|
210
|
+
site. If you use `linenos`, you might want to include an additional CSS class
|
211
|
+
definition for the `.lineno` class in `syntax.css` to distinguish the line
|
212
|
+
numbers from the highlighted code.
|
201
213
|
|
202
214
|
### Post URL
|
203
215
|
|
204
|
-
If you would like to include a link to a post on your site, the `post_url` tag
|
216
|
+
If you would like to include a link to a post on your site, the `post_url` tag
|
217
|
+
will generate the correct permalink URL for the post you specify.
|
205
218
|
|
206
|
-
{% highlight
|
207
|
-
{
|
219
|
+
{% highlight text %}
|
220
|
+
{% raw %}
|
221
|
+
{% post_url 2010-07-21-name-of-post %}
|
222
|
+
{% endraw %}
|
208
223
|
{% endhighlight %}
|
209
224
|
|
210
225
|
There is no need to include the file extension when using the `post_url` tag.
|
211
226
|
|
212
227
|
You can also use this tag to create a link to a post in Markdown as follows:
|
213
228
|
|
214
|
-
{% highlight
|
215
|
-
|
229
|
+
{% highlight text %}
|
230
|
+
{% raw %}
|
231
|
+
[Name of Link]({% post_url 2010-07-21-name-of-post %})
|
232
|
+
{% endraw %}
|
216
233
|
{% endhighlight %}
|
217
234
|
|
@@ -5,34 +5,53 @@ prev_section: installation
|
|
5
5
|
next_section: structure
|
6
6
|
---
|
7
7
|
|
8
|
-
The Jekyll gem makes a `jekyll` executable available to you in your Terminal
|
8
|
+
The Jekyll gem makes a `jekyll` executable available to you in your Terminal
|
9
|
+
window. You can use this command in a number of ways:
|
9
10
|
|
10
11
|
{% highlight bash %}
|
11
|
-
jekyll build
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
jekyll build --
|
18
|
-
|
19
|
-
|
12
|
+
$ jekyll build
|
13
|
+
# => The current folder will be generated into ./_site
|
14
|
+
|
15
|
+
$ jekyll build --destination <destination>
|
16
|
+
# => The current folder will be generated into <destination>
|
17
|
+
|
18
|
+
$ jekyll build --source <source> --destination <destination>
|
19
|
+
# => The <source> folder will be generated into <destination>
|
20
|
+
|
21
|
+
$ jekyll build --watch
|
22
|
+
# => The current folder will be generated into ./_site,
|
23
|
+
# and watch for changes and regenerate automatically.
|
20
24
|
{% endhighlight %}
|
21
25
|
|
22
|
-
Jekyll also comes with a built-in development server that will allow you to
|
26
|
+
Jekyll also comes with a built-in development server that will allow you to
|
27
|
+
preview what the generated site will look like in your browser locally.
|
23
28
|
|
24
29
|
{% highlight bash %}
|
25
|
-
jekyll serve
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
$ jekyll serve
|
31
|
+
# => A development server will run at http://localhost:4000/
|
32
|
+
|
33
|
+
$ jekyll serve --watch
|
34
|
+
# => As above, but watch for changes and regenerate automatically.
|
29
35
|
{% endhighlight %}
|
30
36
|
|
31
|
-
|
37
|
+
This is just a few of the available [configuration options](../configuration).
|
38
|
+
Many configuration options can either be specified as flags on the command line,
|
39
|
+
or alternatively (and more commonly) they can be specified in a `_config.yml`
|
40
|
+
file at the root of the source directory. Jekyll will automatically use the
|
41
|
+
options from this file when run. For example, if you place the following lines
|
42
|
+
in your `_config.yml` file:
|
32
43
|
|
33
44
|
{% highlight yaml %}
|
34
45
|
source: _source
|
35
46
|
destination: _deploy
|
36
47
|
{% endhighlight %}
|
37
48
|
|
38
|
-
|
49
|
+
Then the following two commands will be equivalent:
|
50
|
+
|
51
|
+
{% highlight bash %}
|
52
|
+
$ jekyll build
|
53
|
+
$ jekyll build --source _source --destination _deploy
|
54
|
+
{% endhighlight %}
|
55
|
+
|
56
|
+
For more about the possible configuration options, see the
|
57
|
+
[configuration](../configuration) page.
|
@@ -5,7 +5,11 @@ prev_section: pages
|
|
5
5
|
next_section: migrations
|
6
6
|
---
|
7
7
|
|
8
|
-
Jekyll traverses your site looking for files to process. Any files with [YAML
|
8
|
+
Jekyll traverses your site looking for files to process. Any files with [YAML
|
9
|
+
Front Matter](../frontmatter) are subject to processing. For each of these
|
10
|
+
files, Jekyll makes a variety of data available via the [Liquid templating
|
11
|
+
system](http://wiki.github.com/shopify/liquid/liquid-for-designers). The
|
12
|
+
following is a reference of the available data.
|
9
13
|
|
10
14
|
## Global Variables
|
11
15
|
|
@@ -19,19 +23,41 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
19
23
|
<tbody>
|
20
24
|
<tr>
|
21
25
|
<td><p><code>site</code></p></td>
|
22
|
-
<td><p>
|
26
|
+
<td><p>
|
27
|
+
|
28
|
+
Sitewide information + configuration settings from
|
29
|
+
<code>_config.yml</code>. See below for details.
|
30
|
+
|
31
|
+
</p></td>
|
23
32
|
</tr>
|
24
33
|
<tr>
|
25
34
|
<td><p><code>page</code></p></td>
|
26
|
-
<td><p>
|
35
|
+
<td><p>
|
36
|
+
|
37
|
+
Page specific information + the <a href="../frontmatter">YAML Front
|
38
|
+
Matter</a>. Custom variables set via the YAML front matter will be
|
39
|
+
available here. See below for details.
|
40
|
+
|
41
|
+
</p></td>
|
27
42
|
</tr>
|
28
43
|
<tr>
|
29
44
|
<td><p><code>content</code></p></td>
|
30
|
-
<td><p>
|
45
|
+
<td><p>
|
46
|
+
|
47
|
+
In layout files, the rendered content of the Post or Page being wrapped.
|
48
|
+
Not defined in Post or Page files.
|
49
|
+
|
50
|
+
</p></td>
|
31
51
|
</tr>
|
32
52
|
<tr>
|
33
53
|
<td><p><code>paginator</code></p></td>
|
34
|
-
<td><p>
|
54
|
+
<td><p>
|
55
|
+
|
56
|
+
When the <code>paginate</code> configuration option is set, this
|
57
|
+
variable becomes available for use. See <a
|
58
|
+
href="../pagination">Pagination</a> for details.
|
59
|
+
|
60
|
+
</p></td>
|
35
61
|
</tr>
|
36
62
|
</tbody>
|
37
63
|
</table>
|
@@ -48,27 +74,61 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
48
74
|
<tbody>
|
49
75
|
<tr>
|
50
76
|
<td><p><code>site.time</code></p></td>
|
51
|
-
<td><p>
|
77
|
+
<td><p>
|
78
|
+
|
79
|
+
The current time (when you run the <code>jekyll</code> command).
|
80
|
+
|
81
|
+
</p></td>
|
52
82
|
</tr>
|
53
83
|
<tr>
|
54
84
|
<td><p><code>site.posts</code></p></td>
|
55
|
-
<td><p>
|
85
|
+
<td><p>
|
86
|
+
|
87
|
+
A reverse chronological list of all Posts.
|
88
|
+
|
89
|
+
</p></td>
|
56
90
|
</tr>
|
57
91
|
<tr>
|
58
92
|
<td><p><code>site.related_posts</code></p></td>
|
59
|
-
<td><p>
|
93
|
+
<td><p>
|
94
|
+
|
95
|
+
If the page being processed is a Post, this contains a list of up to ten
|
96
|
+
related Posts. By default, these are low quality but fast to compute.
|
97
|
+
For high quality but slow to compute results, run the
|
98
|
+
<code>jekyll</code> command with the <code>--lsi</code> (latent semantic
|
99
|
+
indexing) option.
|
100
|
+
|
101
|
+
</p></td>
|
60
102
|
</tr>
|
61
103
|
<tr>
|
62
104
|
<td><p><code>site.categories.CATEGORY</code></p></td>
|
63
|
-
<td><p>
|
105
|
+
<td><p>
|
106
|
+
|
107
|
+
The list of all Posts in category <code>CATEGORY</code>.
|
108
|
+
|
109
|
+
</p></td>
|
64
110
|
</tr>
|
65
111
|
<tr>
|
66
112
|
<td><p><code>site.tags.TAG</code></p></td>
|
67
|
-
<td><p>
|
113
|
+
<td><p>
|
114
|
+
|
115
|
+
The list of all Posts with tag <code>TAG</code>.
|
116
|
+
|
117
|
+
</p></td>
|
68
118
|
</tr>
|
69
119
|
<tr>
|
70
120
|
<td><p><code>site.[CONFIGURATION_DATA]</code></p></td>
|
71
|
-
<td><p>
|
121
|
+
<td><p>
|
122
|
+
|
123
|
+
All the variables set via the command line and your
|
124
|
+
<code>_config.yml</code> are available through the <code>site</code>
|
125
|
+
variable. For example, if you have <code>url: http://mysite.com</code>
|
126
|
+
in your configuration file, then in your Posts and Pages it will be
|
127
|
+
stored in <code>site.url</code>. Jekyll does not parse changes to
|
128
|
+
<code>_config.yml</code> in <code>watch</code> mode, you must restart
|
129
|
+
Jekyll to see changes to variables.
|
130
|
+
|
131
|
+
</p></td>
|
72
132
|
</tr>
|
73
133
|
</tbody>
|
74
134
|
</table>
|
@@ -85,38 +145,83 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
85
145
|
<tbody>
|
86
146
|
<tr>
|
87
147
|
<td><p><code>page.content</code></p></td>
|
88
|
-
<td><p>
|
148
|
+
<td><p>
|
149
|
+
|
150
|
+
The un-rendered content of the Page.
|
151
|
+
|
152
|
+
</p></td>
|
89
153
|
</tr>
|
90
154
|
<tr>
|
91
155
|
<td><p><code>page.title</code></p></td>
|
92
|
-
<td><p>
|
156
|
+
<td><p>
|
157
|
+
|
158
|
+
The title of the Post.
|
159
|
+
|
160
|
+
</p></td>
|
93
161
|
</tr>
|
94
162
|
<tr>
|
95
163
|
<td><p><code>page.url</code></p></td>
|
96
|
-
<td><p>
|
164
|
+
<td><p>
|
165
|
+
|
166
|
+
The URL of the Post without the domain. e.g.
|
167
|
+
<code>/2008/12/14/my-post.html</code>
|
168
|
+
|
169
|
+
</p></td>
|
97
170
|
</tr>
|
98
171
|
<tr>
|
99
172
|
<td><p><code>page.date</code></p></td>
|
100
|
-
<td><p>
|
173
|
+
<td><p>
|
174
|
+
|
175
|
+
The Date assigned to the Post. This can be overridden in a Post’s front
|
176
|
+
matter by specifying a new date/time in the format
|
177
|
+
<code>YYYY-MM-DD HH:MM:SS</code>
|
178
|
+
|
179
|
+
</p></td>
|
101
180
|
</tr>
|
102
181
|
<tr>
|
103
182
|
<td><p><code>page.id</code></p></td>
|
104
|
-
<td><p>
|
183
|
+
<td><p>
|
184
|
+
|
185
|
+
An identifier unique to the Post (useful in RSS feeds). e.g.
|
186
|
+
<code>/2008/12/14/my-post</code>
|
187
|
+
|
188
|
+
</p></td>
|
105
189
|
</tr>
|
106
190
|
<tr>
|
107
191
|
<td><p><code>page.categories</code></p></td>
|
108
|
-
<td><p>
|
192
|
+
<td><p>
|
193
|
+
|
194
|
+
The list of categories to which this post belongs. Categories are
|
195
|
+
derived from the directory structure above the <code>_posts</code>
|
196
|
+
directory. For example, a post at
|
197
|
+
<code>/work/code/_posts/2008-12-24-closures.md</code> would have this
|
198
|
+
field set to <code>['work', 'code']</code>. These can also be specified
|
199
|
+
in the <a href="../frontmatter">YAML Front Matter</a>.
|
200
|
+
|
201
|
+
</p></td>
|
109
202
|
</tr>
|
110
203
|
<tr>
|
111
204
|
<td><p><code>page.tags</code></p></td>
|
112
|
-
<td><p>
|
205
|
+
<td><p>
|
206
|
+
|
207
|
+
The list of tags to which this post belongs. These can be specified in
|
208
|
+
the <a href="../frontmatter">YAML Front Matter</a>
|
209
|
+
|
210
|
+
</p></td>
|
113
211
|
</tr>
|
114
212
|
</tbody>
|
115
213
|
</table>
|
116
214
|
|
117
215
|
<div class="note">
|
118
216
|
<h5>ProTip™: Use custom front-matter</h5>
|
119
|
-
<p>
|
217
|
+
<p>
|
218
|
+
|
219
|
+
Any custom front matter that you specify will be available under
|
220
|
+
<code>page</code>. For example, if you specify <code>custom_css: true</code>
|
221
|
+
in a page’s front matter, that value will be available as
|
222
|
+
<code>page.custom_css</code>.
|
223
|
+
|
224
|
+
</p>
|
120
225
|
</div>
|
121
226
|
|
122
227
|
## Paginator
|
@@ -131,7 +236,7 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
131
236
|
<tbody>
|
132
237
|
<tr>
|
133
238
|
<td><p><code>paginator.per_page</code></p></td>
|
134
|
-
<td><p>Number of
|
239
|
+
<td><p>Number of Posts per page.</p></td>
|
135
240
|
</tr>
|
136
241
|
<tr>
|
137
242
|
<td><p><code>paginator.posts</code></p></td>
|
@@ -139,11 +244,11 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
139
244
|
</tr>
|
140
245
|
<tr>
|
141
246
|
<td><p><code>paginator.total_posts</code></p></td>
|
142
|
-
<td><p>Total number of
|
247
|
+
<td><p>Total number of Posts.</p></td>
|
143
248
|
</tr>
|
144
249
|
<tr>
|
145
250
|
<td><p><code>paginator.total_pages</code></p></td>
|
146
|
-
<td><p>Total number of
|
251
|
+
<td><p>Total number of Pages.</p></td>
|
147
252
|
</tr>
|
148
253
|
<tr>
|
149
254
|
<td><p><code>paginator.page</code></p></td>
|
@@ -162,5 +267,10 @@ Jekyll traverses your site looking for files to process. Any files with [YAML Fr
|
|
162
267
|
|
163
268
|
<div class="note info">
|
164
269
|
<h5>Paginator variable availability</h5>
|
165
|
-
<p>
|
270
|
+
<p>
|
271
|
+
|
272
|
+
These are only available in index files, however they can be located in a
|
273
|
+
subdirectory, such as <code>/blog/index.html</code>.
|
274
|
+
|
275
|
+
</p>
|
166
276
|
</div>
|