removed jekyll's paginations

First, it supports only one page path, so /ru/blog and /blog will have different
view. But there is a plugin jekyll-paginator, but it seems doesn't work and
github doesn't support an additional plugins.
Second, paginator doesn't work correctly with pages with different tags
(e.g. en and ru).
This commit is contained in:
arcan1s 2014-01-17 14:29:32 +04:00
parent 3b1250a201
commit a3cfb820aa
6 changed files with 55 additions and 64 deletions

View File

@ -5,7 +5,7 @@ layouts: ./_layouts
include: ['.htaccess'] include: ['.htaccess']
exclude: ['.gitignore','Gemfile','Gemfile.lock','README.md','TODO'] exclude: ['.gitignore','Gemfile','Gemfile.lock','README.md','TODO']
keep_files: ['.git','.svn'] keep_files: ['.git','.svn']
gems: [jekyll-pagination] gems: []
future: true future: true
limit_posts: 0 limit_posts: 0
@ -14,10 +14,7 @@ pygments: true
relative_permalinks: true relative_permalinks: true
permalink: pretty permalink: pretty
paginate: 10 paginate_path: 'blog/:num'
paginate_path:
- 'blog/:num'
- 'ru/blog/:num'
markdown: rdiscount markdown: rdiscount
markdown_ext: markdown,mkd,mkdn,md markdown_ext: markdown,mkd,mkdn,md
@ -30,7 +27,7 @@ host: 0.0.0.0
port: 4000 port: 4000
baseurl: / baseurl: /
url: http://localhost:4000 url: http://localhost:4000
lsi: true lsi: false
maruku: maruku:
use_tex: false use_tex: false

View File

@ -1,4 +1,5 @@
--- ---
category: en
layout: paper layout: paper
last: 14 January 2014 last: 14 January 2014
tags: zshrc, configuration, linux tags: zshrc, configuration, linux

19
blog/archive.html Normal file
View File

@ -0,0 +1,19 @@
---
layout: default
title: Archive
comment: false
share: false
back: 2
---
<body>
<div class="wrapper">
<header>
<h1>{{ page.title }}</h1>
</header>
<section>
{% for post in site.categories.en %}
<p align="justify"><i>{{ post.date | date_to_string}}</i> &raquo; <a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a> ({{ post.tags }})</p>
{% endfor %}
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>

View File

@ -9,38 +9,15 @@ back: 1
<div class="wrapper"> <div class="wrapper">
<header> <header>
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>
<h3><a name="archive" class="anchor" href="#archive"><span class="octicon octicon-link"></span></a><a href="/blog/archive">Archive</a></h3>
</header> </header>
<section> <section>
{% for post in paginator.posts %} {% for post in site.categories.en limit:10 %}
<h1><a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a></h1> <h1><a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a></h1>
<p align="justify"><i>{{ post.date | date_to_string}}</i></p> <p align="justify"><i>{{ post.date | date_to_string}}</i></p>
<p align="justify">{{ post.description }}</p> <p align="justify">{{ post.description }}</p>
<p align="justify"><b>Tags</b>: {{ post.tags }}</p> <p align="justify"><b>Tags</b>: {{ post.tags }}</p>
{% endfor %} {% endfor %}
{% if paginator.total_pages > 1 %}
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ '/blog' }}">{{ page }}</a>
{% else %}
<a href="{{ site.paginate_path | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
{% endif %}
{% endif %}
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script> <script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>

20
ru/blog/archive.html Normal file
View File

@ -0,0 +1,20 @@
---
category: ru
layout: default
title: Архив материалов
comment: false
share: false
back: 2
---
<body>
<div class="wrapper">
<header>
<h1>{{ page.title }}</h1>
</header>
<section>
{% for post in site.categories.ru%}
<p align="justify"><i>{{ post.date | date_to_string}}</i> &raquo; <a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a> ({{ post.tags }})</p>
{% endfor %}
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>

View File

@ -10,38 +10,15 @@ back: 1
<div class="wrapper"> <div class="wrapper">
<header> <header>
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>
<h3><a name="archive" class="anchor" href="#archive"><span class="octicon octicon-link"></span></a><a href="/ru/blog/archive">Архив материалов</a></h3>
</header> </header>
<section> <section>
{% for post in paginator.posts %} {% for post in site.categories.ru limit:10 %}
<h1><a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a></h1> <h1><a name="{{ post.short }}" class="anchor" href="#{{ post.short }}"><span class="octicon octicon-link"></span></a><a href="{{ post.url }}">{{ post.title }}</a></h1>
<p align="justify"><i>{{ post.date | date_to_string}}</i></p> <p align="justify"><i>{{ post.date | date_to_string}}</i></p>
<p align="justify">{{ post.description }}</p> <p align="justify">{{ post.description }}</p>
<p align="justify"><b>Тэги</b>: {{ post.tags }}</p> <p align="justify"><b>Тэги</b>: {{ post.tags }}</p>
{% endfor %} {% endfor %}
{% if paginator.total_pages > 1 %}
{% if paginator.previous_page %}
<a href="/ru{{ paginator.previous_page_path }}">&laquo; Предыдущая</a>
{% else %}
<span>&laquo; Предыдущая</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ '/ru/blog' }}">{{ page }}</a>
{% else %}
<a href="/ru{{ site.paginate_path | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="/ru{{ paginator.next_page_path }}">Следующая &raquo;</a>
{% else %}
<span>Следующая &raquo;</span>
{% endif %}
{% endif %}
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script> <script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>