Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pages and import more wiki content
- Loading branch information
Showing
9 changed files
with
1,601 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
auto: true | ||
auto: false | ||
server: true | ||
permalink: /docs/:categories/:title | ||
pygments: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
layout: docs | ||
title: Pagination | ||
prev_section: permalinks | ||
next_section: plugins | ||
--- | ||
|
||
Note: Pagination does not work with markdown files, it only works with html file extensions. | ||
|
||
Just follow these steps to add pagination to your blog: | ||
|
||
## \_config.yml | ||
add the pagination setting: | ||
|
||
{% highlight yaml %} | ||
markdown: rdiscount | ||
pygments: true | ||
lsi: true | ||
exclude: ['README.markdown', 'README_FOR_COLLABORATORS.markdown', 'Gemfile.lock', 'Gemfile'] | ||
production: false | ||
//add this line to add pagination | ||
paginate: 3 //the number of post per page | ||
{% endhighlight %} | ||
|
||
## index.html | ||
just add the posts and the pagination links: | ||
|
||
{% highlight html %} | ||
--- | ||
layout: default | ||
title: Blog | ||
--- | ||
|
||
{{ "{% for post in paginator.posts " }}%} | ||
|
||
<!-- here add you post markup --> | ||
<h1><a href="{{ "{{ post.url " }}}}">{{ "{{ post.title " }}}}</a></h1> | ||
<p class="author"> | ||
<span class="date">{{ "{{post.date" }}}}</span> | ||
</p> | ||
<div class="content"> | ||
{{ "{{ post.content " }}}} | ||
</div> | ||
{{ "{% endfor " }}%} | ||
|
||
<!-- Pagination links --> | ||
<div class="pagination"> | ||
{{ "{% if paginator.previous_page " }}%} | ||
<a href="/page{{ "{{paginator.previous_page" }}}}" class="previous">Previous</a> | ||
{{ "{% else " }}%} | ||
<span class="previous">Previous</span> | ||
{{ "{% endif " }}%} | ||
<span class="page_number ">Page: {{ "{{paginator.page" }}}} of {{ "{{paginator.total_pages" }}}}</span> | ||
{{ "{% if paginator.next_page " }}%} | ||
<a href="/page{{ "{{paginator.next_page" }}}}" class="next ">Next</a> | ||
{{ "{% else " }}%} | ||
<span class="next ">Next</span> | ||
{{ "{% endif " }}%} | ||
</div> | ||
|
||
{% endhighlight %} | ||
|
||
## A note about page1 | ||
|
||
Jekyll does not produce a page1 folder so using the above code will not work when a link is produced of the form "/page1". The following textile will handle page1 and render a list of each page with links to all but the current page. | ||
|
||
{% highlight html %} | ||
<div id="post-pagination" class="pagination"> | ||
|
||
{{ "{% if paginator.previous_page " }}%} | ||
<p class="previous"> | ||
{{ "{% if paginator.previous_page == 1 " }}%} | ||
<a href="/">Previous</a> | ||
{{ "{% else " }}%} | ||
<a href="/page{{ "{{paginator.previous_page" }}}}">Previous</a> | ||
{{ "{% endif " }}%} | ||
</p> | ||
{{ "{% else " }}%} | ||
<p class="previous disabled"> | ||
<span>Previous</span> | ||
</p> | ||
{{ "{% endif " }}%} | ||
|
||
<ul class="pages"> | ||
<li class="page"> | ||
{{ "{% if paginator.page == 1 " }}%} | ||
<span class="current-page">1</span> | ||
{{ "{% else " }}%} | ||
<a href="/">1</a> | ||
{{ "{% endif " }}%} | ||
</li> | ||
|
||
{{ "{% for count in (2..paginator.total_pages) " }}%} | ||
<li class="page"> | ||
{{ "{% if count == paginator.page " }}%} | ||
<span class="current-page">{{ "{{count" }}}}</span> | ||
{{ "{% else " }}%} | ||
<a href="/page{{ "{{count" }}}}">{{ "{{count" }}}}</a> | ||
{{ "{% endif " }}%} | ||
</li> | ||
{{ "{% endfor " }}%} | ||
</ul> | ||
|
||
{{ "{% if paginator.next_page " }}%} | ||
<p class="next"> | ||
<a href="/page{{ "{{paginator.next_page" }}}}">Next</a> | ||
</p> | ||
{{ "{% else " }}%} | ||
<p class="next disabled"> | ||
<span>Next</span> | ||
</p> | ||
{{ "{% endif " }}%} | ||
|
||
</div> | ||
{% endhighlight %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
layout: docs | ||
title: Permalinks | ||
prev_section: assets | ||
next_section: pagination | ||
--- | ||
|
||
Jekyll supports a flexible way to build your site’s URLs. You can | ||
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`. | ||
|
||
Template Variables | ||
|
||
**Variable** **Description** | ||
`year` Year from the post’s filename | ||
`month` Month from the post’s filename | ||
`day` Day from the post’s filename | ||
`title` Title from the post’s filename | ||
`categories` 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. | ||
`i_month` Month from the post’s filename without leading zeros. | ||
`i_day` Day from the post’s filename without leading zeros. | ||
|
||
Built-in styles | ||
|
||
**Name** **Template** | ||
`date` `/:categories/:year/:month/:day/:title.html` | ||
`pretty` `/:categories/:year/:month/:day/:title/` | ||
`none` `/:categories/:title.html` | ||
|
||
Examples | ||
|
||
Given a post named: `/2009-04-29-slap-chop.textile` | ||
|
||
**Setting** **Result** | ||
`None specified.` `/2009/04/29/slap-chop.html` | ||
`permalink: pretty` `/2009/04/29/slap-chop/index.html` | ||
`permalink: /:month-:day-:year/:title.html` `/04-29-2009/slap-chop.html` | ||
`permalink: /blog/:year/:month/:day/:title` `/blog/2009/04/29/slap-chop/index.html` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,6 +427,8 @@ pre, code { | |
|
||
.highlight { | ||
padding: 10px 0; | ||
width: 100%; | ||
overflow: scroll; | ||
} | ||
|
||
|
||
|