jekyll 0.12.1 → 1.0.0.beta1

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.

Files changed (124) hide show
  1. data/CONTRIBUTING.md +67 -0
  2. data/Gemfile +1 -1
  3. data/History.txt +50 -6
  4. data/README.textile +10 -6
  5. data/Rakefile +74 -36
  6. data/bin/jekyll +78 -276
  7. data/cucumber.yml +3 -1
  8. data/features/create_sites.feature +1 -1
  9. data/features/drafts.feature +25 -0
  10. data/features/site_configuration.feature +1 -1
  11. data/features/step_definitions/jekyll_steps.rb +13 -3
  12. data/features/support/env.rb +3 -1
  13. data/jekyll.gemspec +73 -17
  14. data/lib/jekyll.rb +31 -21
  15. data/lib/jekyll/command.rb +12 -0
  16. data/lib/jekyll/commands/build.rb +81 -0
  17. data/lib/jekyll/commands/serve.rb +28 -0
  18. data/lib/jekyll/converter.rb +1 -3
  19. data/lib/jekyll/converters/identity.rb +13 -14
  20. data/lib/jekyll/converters/markdown.rb +128 -128
  21. data/lib/jekyll/converters/textile.rb +37 -37
  22. data/lib/jekyll/convertible.rb +6 -4
  23. data/lib/jekyll/core_ext.rb +9 -1
  24. data/lib/jekyll/draft.rb +35 -0
  25. data/lib/jekyll/errors.rb +1 -3
  26. data/lib/jekyll/filters.rb +13 -4
  27. data/lib/jekyll/generator.rb +1 -4
  28. data/lib/jekyll/generators/pagination.rb +46 -46
  29. data/lib/jekyll/layout.rb +0 -2
  30. data/lib/jekyll/mime.types +1588 -0
  31. data/lib/jekyll/page.rb +24 -8
  32. data/lib/jekyll/plugin.rb +0 -2
  33. data/lib/jekyll/post.rb +66 -40
  34. data/lib/jekyll/site.rb +96 -20
  35. data/lib/jekyll/static_file.rb +0 -2
  36. data/lib/jekyll/tags/gist.rb +19 -0
  37. data/lib/jekyll/tags/highlight.rb +63 -62
  38. data/lib/jekyll/tags/include.rb +25 -25
  39. data/lib/jekyll/tags/post_url.rb +30 -25
  40. data/script/bootstrap +2 -0
  41. data/site/.gitignore +4 -0
  42. data/site/CNAME +1 -0
  43. data/site/README +1 -0
  44. data/site/_config.yml +5 -0
  45. data/site/_includes/analytics.html +32 -0
  46. data/site/_includes/docs_contents.html +82 -0
  47. data/site/_includes/footer.html +15 -0
  48. data/site/_includes/header.html +26 -0
  49. data/site/_includes/section_nav.html +22 -0
  50. data/site/_includes/top.html +14 -0
  51. data/site/_layouts/default.html +12 -0
  52. data/site/_layouts/docs.html +21 -0
  53. data/site/_posts/2012-07-01-configuration.md +277 -0
  54. data/site/_posts/2012-07-01-contributing.md +66 -0
  55. data/site/_posts/2012-07-01-deployment-methods.md +108 -0
  56. data/site/_posts/2012-07-01-extras.md +103 -0
  57. data/site/_posts/2012-07-01-frontmatter.md +120 -0
  58. data/site/_posts/2012-07-01-github-pages.md +34 -0
  59. data/site/_posts/2012-07-01-heroku.md +8 -0
  60. data/site/_posts/2012-07-01-home.md +47 -0
  61. data/site/_posts/2012-07-01-installation.md +43 -0
  62. data/site/_posts/2012-07-01-migrations.md +180 -0
  63. data/site/_posts/2012-07-01-pages.md +62 -0
  64. data/site/_posts/2012-07-01-pagination.md +116 -0
  65. data/site/_posts/2012-07-01-permalinks.md +163 -0
  66. data/site/_posts/2012-07-01-plugins.md +384 -0
  67. data/site/_posts/2012-07-01-posts.md +106 -0
  68. data/site/_posts/2012-07-01-resources.md +49 -0
  69. data/site/_posts/2012-07-01-sites.md +28 -0
  70. data/site/_posts/2012-07-01-structure.md +95 -0
  71. data/site/_posts/2012-07-01-templates.md +217 -0
  72. data/site/_posts/2012-07-01-troubleshooting.md +108 -0
  73. data/site/_posts/2012-07-01-usage.md +38 -0
  74. data/site/_posts/2012-07-01-variables.md +166 -0
  75. data/site/css/grid.css +62 -0
  76. data/site/css/normalize.css +504 -0
  77. data/site/css/pygments.css +70 -0
  78. data/site/css/style.css +697 -0
  79. data/site/docs/index.html +11 -0
  80. data/site/favicon.png +0 -0
  81. data/site/img/article-footer.png +0 -0
  82. data/site/img/footer-arrow.png +0 -0
  83. data/site/img/footer-logo.png +0 -0
  84. data/site/img/logo-2x.png +0 -0
  85. data/site/img/octojekyll.png +0 -0
  86. data/site/img/tube.png +0 -0
  87. data/site/img/tube1x.png +0 -0
  88. data/site/index.html +77 -0
  89. data/site/js/modernizr-2.5.3.min.js +4 -0
  90. data/test/fixtures/broken_front_matter2.erb +4 -0
  91. data/test/fixtures/broken_front_matter3.erb +7 -0
  92. data/test/fixtures/exploit_front_matter.erb +4 -0
  93. data/test/helper.rb +16 -0
  94. data/test/source/_posts/2013-01-12-nil-layout.textile +6 -0
  95. data/test/source/_posts/2013-01-12-no-layout.textile +5 -0
  96. data/test/source/contacts/bar.html +5 -0
  97. data/test/source/contacts/index.html +5 -0
  98. data/test/test_configuration.rb +7 -8
  99. data/test/test_convertible.rb +29 -0
  100. data/test/test_core_ext.rb +22 -0
  101. data/test/test_generated_site.rb +1 -1
  102. data/test/test_kramdown.rb +3 -3
  103. data/test/test_page.rb +88 -2
  104. data/test/test_post.rb +42 -6
  105. data/test/test_rdiscount.rb +1 -1
  106. data/test/test_redcarpet.rb +1 -1
  107. data/test/test_redcloth.rb +6 -6
  108. data/test/test_site.rb +73 -8
  109. data/test/test_tags.rb +36 -13
  110. metadata +150 -19
  111. data/lib/jekyll/migrators/csv.rb +0 -26
  112. data/lib/jekyll/migrators/drupal.rb +0 -103
  113. data/lib/jekyll/migrators/enki.rb +0 -49
  114. data/lib/jekyll/migrators/joomla.rb +0 -53
  115. data/lib/jekyll/migrators/marley.rb +0 -52
  116. data/lib/jekyll/migrators/mephisto.rb +0 -84
  117. data/lib/jekyll/migrators/mt.rb +0 -86
  118. data/lib/jekyll/migrators/posterous.rb +0 -67
  119. data/lib/jekyll/migrators/rss.rb +0 -47
  120. data/lib/jekyll/migrators/textpattern.rb +0 -58
  121. data/lib/jekyll/migrators/tumblr.rb +0 -195
  122. data/lib/jekyll/migrators/typo.rb +0 -51
  123. data/lib/jekyll/migrators/wordpress.rb +0 -294
  124. data/lib/jekyll/migrators/wordpressdotcom.rb +0 -70
@@ -0,0 +1,180 @@
1
+ ---
2
+ layout: docs
3
+ title: Blog migrations
4
+ prev_section: variables
5
+ next_section: templates
6
+ ---
7
+
8
+ If you’re switching to Jekyll from another blogging system, Jekyll’s migrators can help you with the move. Most methods listed on this page require read access to the database to generate posts from your old system. Each method generates `.markdown` posts in the `_posts` directory based on the entries in the database.
9
+
10
+ ## Preparing for migrations
11
+
12
+ The migrators are [built-in to the Jekyll gem](https://github.com/mojombo/jekyll/tree/master/lib/jekyll/migrators), and require a few things to be set up in your project directory before they are run. This should all be done from the root folder of your Jekyll project.
13
+
14
+ {% highlight bash %}
15
+ $ mkdir _import
16
+ $ gem install sequel mysqlplus
17
+ {% endhighlight %}
18
+
19
+ You should now be all set to run the migrators below.
20
+
21
+ <div class="note info">
22
+ <h5>Note: Always double-check migrated content</h5>
23
+ <p>Import scripts may not distinguish between published or private posts, so you should always check that the content Jekyll generates for you appears as you intended.</p>
24
+ </div>
25
+
26
+ ## WordPress
27
+
28
+ ### Wordpress export files
29
+
30
+ If hpricot is not already installed, you will need to run `gem install hpricot`. Next, export your blog using the Wordpress export utility. Assuming that exported file is saved as `wordpress.xml`, here is the command you need to run:
31
+
32
+ {% highlight bash %}
33
+ $ ruby -rubygems -e 'require "jekyll/migrators/wordpressdotcom";
34
+ Jekyll::WordpressDotCom.process("wordpress.xml")'
35
+ {% endhighlight %}
36
+
37
+ <div class="note">
38
+ <h5>ProTip™: Wordpress.com Export Tool</h5>
39
+ <p>If you are migrating from a Wordpress.com account, you can access the export tool at the following URL: `https://YOUR-USER-NAME.wordpress.com/wp-admin/export.php`.</p>
40
+ </div>
41
+
42
+ ### Using Wordpress MySQL server connection
43
+
44
+ If you want to import using a direct connection to the Wordpress MySQL server, here's how:
45
+
46
+ {% highlight bash %}
47
+ $ ruby -rubygems -e 'require "jekyll/migrators/wordpress";
48
+ Jekyll::WordPress.process("database", "user", "pass")'
49
+ {% endhighlight %}
50
+
51
+ If you are using Webfaction and have to set an [SSH tunnel](http://docs.webfaction.com/user-guide/databases.html?highlight=mysql#starting-an-ssh-tunnel-with-ssh), make sure to make the hostname (`127.0.0.1`) explicit, otherwise MySQL may block your access based on localhost and `127.0.0.1` not being equivalent in its authentication system:
52
+
53
+ {% highlight bash %}
54
+ $ ruby -rubygems -e 'require "jekyll/migrators/wordpress";
55
+ Jekyll::WordPress.process("database", "user", "pass", "127.0.0.1")'
56
+ {% endhighlight %}
57
+
58
+ ### Further Wordpress migration alternatives
59
+
60
+ While the above methods work, they do not import much of the metadata that is usually stored in Wordpress posts and pages. If you need to export things like pages, tags, custom fields, image attachments and so on, the following resources might be useful to you:
61
+
62
+ - [Exitwp](https://github.com/thomasf/exitwp) is a configurable tool written in Python for migrating one or more Wordpress blogs into Jekyll (Markdown) format while keeping as much metadata as possible. Exitwp also downloads attachments and pages.
63
+ - [A great article](http://vitobotta.com/how-to-migrate-from-wordpress-to-jekyll/) with a step-by-step guide for migrating a Wordpress blog to Jekyll while keeping most of the structure and metadata.
64
+ - [wpXml2Jekyll](https://github.com/theaob/wpXml2Jekyll) is an executable windows application for creating Markdown posts from your Wordpress XML file.
65
+
66
+ ## Drupal
67
+
68
+ If you’re migrating from [Drupal](), there is [a migrator](https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/drupal.rb) for you too:
69
+
70
+ {% highlight bash %}
71
+ $ ruby -rubygems -e 'require "jekyll/migrators/drupal";
72
+ Jekyll::Drupal.process("database", "user", "pass")'
73
+ {% endhighlight %}
74
+
75
+ <div class="note warning">
76
+ <h5>Warning: Drupal Version Compatibility</h5>
77
+ <p>This migrator was written for Drupal 6.1 and may not work as expected on future versions of Drupal. Please update it and send us a pull request if necessary.</p>
78
+ </div>
79
+
80
+ ## Movable Type
81
+
82
+ To import posts from Movable Type:
83
+
84
+ {% highlight bash %}
85
+ $ ruby -rubygems -e 'require "jekyll/migrators/mt";
86
+ Jekyll::MT.process("database", "user", "pass")'
87
+ {% endhighlight %}
88
+
89
+ ## Typo
90
+
91
+ To import posts from Typo:
92
+
93
+ {% highlight bash %}
94
+ $ ruby -rubygems -e 'require "jekyll/migrators/typo";
95
+ Jekyll::Typo.process("database", "user", "pass")'
96
+ {% endhighlight %}
97
+
98
+ This code also has only been tested with Typo version 4+.
99
+
100
+ ## TextPattern
101
+
102
+ To import posts from TextPattern:
103
+
104
+ {% highlight bash %}
105
+ $ ruby -rubygems -e 'require "jekyll/migrators/textpattern";
106
+ Jekyll::TextPattern.process("database_name", "username", "password", "hostname")'
107
+ {% endhighlight %}
108
+
109
+ You will need to run the above from the parent directory of your `_import` folder. For example, if `_import` is located in `/path/source/_import`, you will need to run this code from `/path/source`. The hostname defaults to `localhost`, all other variables are required. You may need to adjust the code used to filter entries. Left alone, it will attempt to pull all entries that are live or sticky.
110
+
111
+ ## Mephisto
112
+
113
+ To import posts from Mephisto:
114
+
115
+ {% highlight bash %}
116
+ $ ruby -rubygems -e 'require "jekyll/migrators/mephisto";
117
+ Jekyll::Mephisto.process("database", "user", "password")'
118
+ {% endhighlight %}
119
+
120
+ If your data is in Postgres, you should do this instead:
121
+
122
+ {% highlight bash %}
123
+ $ ruby -rubygems -e 'require "jekyll/migrators/mephisto";
124
+ Jekyll::Mephisto.postgres({:database => "database", :username=>"username", :password =>"password"})'
125
+ {% endhighlight %}
126
+
127
+ ## Blogger (Blogspot)
128
+
129
+ To import posts from Blogger, see [this post about migrating from Blogger to Jekyll](http://coolaj86.info/articles/migrate-from-blogger-to-jekyll.html). If that doesn’t work for you, you might want to try some of the following alternatives:
130
+
131
+ - [@kennym](https://github.com/kennym) created a [little migration script](https://gist.github.com/1115810), because the solutions in the previous article didn't work out for him.
132
+ - [@ngauthier](https://github.com/ngauthier) created [another importer](https://gist.github.com/1506614) that imports comments, and does so via blogger’s archive instead of the RSS feed.
133
+ - [@juniorz](https://github.com/juniorz) created [yet another importer](https://gist.github.com/1564581) that works for [Octopress](http://octopress.org). It is like [@ngauthier’s version](https://gist.github.com/1506614) but separates drafts from posts, as well as importing tags and permalinks.
134
+
135
+ ## Posterous
136
+
137
+ To import posts from your primary Posterous blog:
138
+
139
+ {% highlight bash %}
140
+ $ ruby -rubygems -e 'require "jekyll/migrators/posterous";
141
+ Jekyll::Posterous.process("my_email", "my_pass")'
142
+ {% endhighlight %}
143
+
144
+ For any other Posterous blog on your account, you will need to specify the `blog_id` for the blog:
145
+
146
+ {% highlight bash %}
147
+ $ ruby -rubygems -e 'require "jekyll/migrators/posterous";
148
+ Jekyll::Posterous.process("my_email", "my_pass", "blog_id")'
149
+ {% endhighlight %}
150
+
151
+ There is also an [alternative Posterous migrator](https://github.com/pepijndevos/jekyll/blob/patch-1/lib/jekyll/migrators/posterous.rb) that maintains permalinks and attempts to import images too.
152
+
153
+ ## Tumblr
154
+
155
+ To import posts from Tumblr:
156
+
157
+ {% highlight bash %}
158
+ $ ruby -rubygems -e 'require "jekyll/migrators/tumblr";
159
+ Jekyll::Tumblr.process("http://www.your_blog_url.com", true)'
160
+ {% endhighlight %}
161
+
162
+ There is also [a modified Tumblr migrator](https://github.com/stephenmcd/jekyll/blob/master/lib/jekyll/migrators/tumblr.rb) that exports posts as Markdown and preserves post tags.
163
+
164
+ The migrator above requires the `json` gem and Python's `html2text` to be installed as follows:
165
+
166
+ {% highlight bash %}
167
+ $ gem install json
168
+ $ pip install html2text
169
+ {% endhighlight %}
170
+
171
+ Once installed, simply use the format argument:
172
+
173
+ {% highlight bash %}
174
+ $ ruby -rubygems -e 'require "jekyll/migrators/tumblr";
175
+ Jekyll::Tumblr.process("http://www.your_blog_url.com", format="md")'
176
+ {% endhighlight %}
177
+
178
+ ## Other Systems
179
+
180
+ If you have a system that there isn’t currently a migrator for, you should consider writing one and sending us a pull request.
@@ -0,0 +1,62 @@
1
+ ---
2
+ layout: docs
3
+ title: Creating pages
4
+ prev_section: posts
5
+ next_section: variables
6
+ ---
7
+
8
+ As well as [writing posts](../posts), the other thing you may want to do with your Jekyll site is create static pages. This is pretty simple to do, simply by taking advantage of the way Jekyll copies files and directories.
9
+
10
+ ## Homepage
11
+
12
+ Just about every web server configuration you’ll come across will look for a HTML file called `index.html` (by convention) in the site root folder and display that as the homepage. Unless the web server you’re using is configured to look for some different filename as the default, this file will turn into the homepage of your Jekyll-generated site.
13
+
14
+ <div class="note">
15
+ <h5>ProTip™: Use layouts on your homepage</h5>
16
+ <p>Any HTML file on your site can make use of layouts and includes, even the homepage. It’s usually a good idea to extract everything that is the same across all your pages into an included file in a layout.</p>
17
+ </div>
18
+
19
+ ## Where additional pages live
20
+
21
+ Where you put HTML files for pages depends on how you want the pages to work, since there are two main ways of creating pages:
22
+
23
+ - By placing named HTML files for each page in the site root folder.
24
+ - Create a folder in the site root for each page, and placing an index.html file in each page folder.
25
+
26
+ Both methods work fine (and can be used in conduction with each other), with the only real difference being the resulting URLs each page has.
27
+
28
+ ### Named HTML files
29
+
30
+ The simplest way of adding a page is just to add a HTML file in the root directory with a suitable name for the page you want to create. For a site with a homepage, an about page, and a contact page, here’s what the root directory and associated URLs might look like.
31
+
32
+ {% highlight bash %}
33
+ .
34
+ |-- _config.yml
35
+ |-- _includes
36
+ |-- _layouts
37
+ |-- _posts
38
+ |-- _site
39
+ |-- about.html #=> http://yoursite.com/about.html
40
+ |-- index.html #=> http://yoursite.com/
41
+ └── contact.html #=> http://yoursite.com/contact.html
42
+ {% endhighlight %}
43
+
44
+ ### Named folders containing index HTML files
45
+
46
+ There is nothing wrong with the above method, however some people like to keep their URLs free from things like filename extensions. To achieve clean URLs for pages using Jekyll, you simply need to create a folder for each top-level page you want, and then place an `index.html` file in each page’s folder. This way the page URL ends up being the folder name, and the web server will serve up the respective `index.html` file. An example of what this structure would look like is as follows:
47
+
48
+ {% highlight bash %}
49
+ .
50
+ ├── _config.yml
51
+ ├── _includes
52
+ ├── _layouts
53
+ ├── _posts
54
+ ├── _site
55
+ ├── about
56
+ | └── index.html #=> http://yoursite.com/about/
57
+ ├── contact
58
+ | └── index.html #=> http://yoursite.com/contact/
59
+ └── index.html #=> http://yoursite.com/
60
+ {% endhighlight %}
61
+
62
+ This approach may not suit everyone, but for people who like clear URLs it’s simple and it works. In the end the decision is yours!
@@ -0,0 +1,116 @@
1
+ ---
2
+ layout: docs
3
+ title: Pagination
4
+ prev_section: permalinks
5
+ next_section: plugins
6
+ ---
7
+
8
+ With many websites—especially blogs—it’s very common to break the main listing of posts up into smaller lists and display them over multiple pages. Jekyll has pagination built-in, so you can automatically generate the appropriate files and folders you need for paginated post listings.
9
+
10
+ <div class="note info">
11
+ <h5>Pagination only works within HTML files</h5>
12
+ <p>Pagination does not work with Markdown or Textile files in your Jekyll site. It will only work when used within HTML files. Since you’ll likely be using this for the list of posts, this probably won’t be an issue.</p>
13
+ </div>
14
+
15
+ ## Enable pagination
16
+
17
+ The first thing you need to do to enable pagination for your blog is add a line to the `_config.yml` Jekyll configuration file that specifies how many items should be displayed per page. Here is what the line should look like:
18
+
19
+ {% highlight yaml %}
20
+ paginate: 5
21
+ {% endhighlight %}
22
+
23
+ The number should be the maximum number of posts you’d like to be displayed per-page in the generated site.
24
+
25
+ ## Render the paginated posts
26
+
27
+ The next thing you need to do is to actually display your posts in a list using the `paginator` variable that will now be available to you. You’ll probably want to do this in one of the main pages of your site. Here’s one example of a simple way of rendering paginated posts in a HTML file:
28
+
29
+ {% highlight html %}
30
+ ---
31
+ layout: default
32
+ title: My Blog
33
+ ---
34
+
35
+ <!-- This loops through the paginated posts -->
36
+ {{ "{% for post in paginator.posts " }}%}
37
+ <h1><a href="{{ "{{ post.url " }}}}">{{ "{{ post.title " }}}}</a></h1>
38
+ <p class="author">
39
+ <span class="date">{{ "{{post.date" }}}}</span>
40
+ </p>
41
+ <div class="content">
42
+ {{ "{{ post.content " }}}}
43
+ </div>
44
+ {{ "{% endfor " }}%}
45
+
46
+ <!-- Pagination links -->
47
+ <div class="pagination">
48
+ {{ "{% if paginator.previous_page " }}%}
49
+ <a href="/page{{ "{{paginator.previous_page" }}}}" class="previous">Previous</a>
50
+ {{ "{% else " }}%}
51
+ <span class="previous">Previous</span>
52
+ {{ "{% endif " }}%}
53
+ <span class="page_number ">Page: {{ "{{paginator.page" }}}} of {{ "{{paginator.total_pages" }}}}</span>
54
+ {{ "{% if paginator.next_page " }}%}
55
+ <a href="/page{{ "{{paginator.next_page" }}}}" class="next ">Next</a>
56
+ {{ "{% else " }}%}
57
+ <span class="next ">Next</span>
58
+ {{ "{% endif " }}%}
59
+ </div>
60
+ {% endhighlight %}
61
+
62
+ <div class="note warning">
63
+ <h5>Beware the page one edge-case</h5>
64
+ <p>Jekyll does not generate a ‘page1’ folder, so the above code will not work when a <code>/page1</code> link is produced. See below for a way to handle this if it’s a problem for you.</p>
65
+ </div>
66
+
67
+ The following HTML snippet should handle page one, and render a list of each page with links to all but the current page.
68
+
69
+ {% highlight html %}
70
+ <div id="post-pagination" class="pagination">
71
+ {{ "{% if paginator.previous_page " }}%}
72
+ <p class="previous">
73
+ {{ "{% if paginator.previous_page == 1 " }}%}
74
+ <a href="/">Previous</a>
75
+ {{ "{% else " }}%}
76
+ <a href="/page{{ "{{paginator.previous_page" }}}}">Previous</a>
77
+ {{ "{% endif " }}%}
78
+ </p>
79
+ {{ "{% else " }}%}
80
+ <p class="previous disabled">
81
+ <span>Previous</span>
82
+ </p>
83
+ {{ "{% endif " }}%}
84
+
85
+ <ul class="pages">
86
+ <li class="page">
87
+ {{ "{% if paginator.page == 1 " }}%}
88
+ <span class="current-page">1</span>
89
+ {{ "{% else " }}%}
90
+ <a href="/">1</a>
91
+ {{ "{% endif " }}%}
92
+ </li>
93
+
94
+ {{ "{% for count in (2..paginator.total_pages) " }}%}
95
+ <li class="page">
96
+ {{ "{% if count == paginator.page " }}%}
97
+ <span class="current-page">{{ "{{count" }}}}</span>
98
+ {{ "{% else " }}%}
99
+ <a href="/page{{ "{{count" }}}}">{{ "{{count" }}}}</a>
100
+ {{ "{% endif " }}%}
101
+ </li>
102
+ {{ "{% endfor " }}%}
103
+ </ul>
104
+
105
+ {{ "{% if paginator.next_page " }}%}
106
+ <p class="next">
107
+ <a href="/page{{ "{{paginator.next_page" }}}}">Next</a>
108
+ </p>
109
+ {{ "{% else " }}%}
110
+ <p class="next disabled">
111
+ <span>Next</span>
112
+ </p>
113
+ {{ "{% endif " }}%}
114
+
115
+ </div>
116
+ {% endhighlight %}
@@ -0,0 +1,163 @@
1
+ ---
2
+ layout: docs
3
+ title: Permalinks
4
+ prev_section: templates
5
+ next_section: pagination
6
+ ---
7
+
8
+ Jekyll supports a flexible way to build your site’s URLs. You can
9
+ specify the permalinks for your site through the [Configuration](../configuration) or on the [YAML Front Matter](../frontmatter) for each post. You’re free to choose one of the built-in styles to create your links or craft your own. The default style is always `date`.
10
+
11
+ ## Template variables
12
+
13
+ <table>
14
+ <thead>
15
+ <tr>
16
+ <th>Variable</th>
17
+ <th>Description</th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <tr>
22
+ <td>
23
+ <p><code>year</code></p>
24
+ </td>
25
+ <td>
26
+ <p>Year from the post’s filename</p>
27
+ </td>
28
+ </tr>
29
+ <tr>
30
+ <td>
31
+ <p><code>month</code></p>
32
+ </td>
33
+ <td>
34
+ <p>Month from the post’s filename</p>
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td>
39
+ <p><code>day</code></p>
40
+ </td>
41
+ <td>
42
+ <p>Day from the post’s filename</p>
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td>
47
+ <p><code>title</code></p>
48
+ </td>
49
+ <td>
50
+ <p>Title from the post’s filename</p>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>
55
+ <p><code>categories</code></p>
56
+ </td>
57
+ <td>
58
+ <p>The specified categories for this post. Jekyll automatically parses out double slashes in the URLs, so if no categories are present, it basically ignores this.</p>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>
63
+ <p><code>i_month</code></p>
64
+ </td>
65
+ <td>
66
+ <p> Month from the post’s filename without leading zeros.</p>
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td>
71
+ <p><code>i_day</code></p>
72
+ </td>
73
+ <td>
74
+ <p>Day from the post’s filename without leading zeros.</p>
75
+ </td>
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+
80
+ ## Built-in permalink styles
81
+
82
+ <table>
83
+ <thead>
84
+ <tr>
85
+ <th>Permalink Style</th>
86
+ <th>URL Template</th>
87
+ </tr>
88
+ </thead>
89
+ <tbody>
90
+ <tr>
91
+ <td>
92
+ <p><code>date</code></p>
93
+ </td>
94
+ <td>
95
+ <p><code>/:categories/:year/:month/:day/:title.html</code></p>
96
+ </td>
97
+ </tr>
98
+ <tr>
99
+ <td>
100
+ <p><code>pretty</code></p>
101
+ </td>
102
+ <td>
103
+ <p><code>/:categories/:year/:month/:day/:title/</code></p>
104
+ </td>
105
+ </tr>
106
+ <tr>
107
+ <td>
108
+ <p><code>none</code></p>
109
+ </td>
110
+ <td>
111
+ <p><code>/:categories/:title.html</code></p>
112
+ </td>
113
+ </tr>
114
+ </tbody>
115
+ </table>
116
+
117
+ ## Permalink style examples
118
+
119
+ Given a post named: `/2009-04-29-slap-chop.textile`
120
+
121
+ <table>
122
+ <thead>
123
+ <tr>
124
+ <th>Permalink Setting</th>
125
+ <th>Resulting Permalink URL</th>
126
+ </tr>
127
+ </thead>
128
+ <tbody>
129
+ <tr>
130
+ <td>
131
+ <p>None specified, or <code>permalink: date</code></p>
132
+ </td>
133
+ <td>
134
+ <p><code>/2009/04/29/slap-chop.html</code></p>
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <td>
139
+ <p><code>permalink: pretty</code></p>
140
+ </td>
141
+ <td>
142
+ <p><code>/2009/04/29/slap-chop/index.html</code></p>
143
+ </td>
144
+ </tr>
145
+ <tr>
146
+ <td>
147
+ <p><code>permalink: /:month-:day-:year/:title.html</code></p>
148
+ </td>
149
+ <td>
150
+ <p><code>/04-29-2009/slap-chop.html</code></p>
151
+ </td>
152
+ </tr>
153
+ <tr>
154
+ <td>
155
+ <p><code>permalink: /blog/:year/:month/:day/:title</code></p>
156
+ </td>
157
+ <td>
158
+ <p><code>/blog/2009/04/29/slap-chop/index.html</code></p>
159
+ </td>
160
+ </tr>
161
+ </tbody>
162
+ </table>
163
+