diff options
-rw-r--r-- | _config.yml | 3 | ||||
-rw-r--r-- | _includes/paginate.html | 37 | ||||
-rw-r--r-- | _layouts/home.html | 12 | ||||
-rw-r--r-- | _layouts/post.html | 3 | ||||
-rw-r--r-- | index.html | 2 |
5 files changed, 56 insertions, 1 deletions
diff --git a/_config.yml b/_config.yml index 7424ba6..f39f1c7 100644 --- a/_config.yml +++ b/_config.yml @@ -11,3 +11,6 @@ project: The Irssi Project description: The Client of the Future name: Irssi Core Team email: staff@irssi.org + +paginate: 8 +paginate_path: "news/:num/" diff --git a/_includes/paginate.html b/_includes/paginate.html new file mode 100644 index 0000000..df2d75a --- /dev/null +++ b/_includes/paginate.html @@ -0,0 +1,37 @@ +{% comment %} +For the pagination styles see http://getbootstrap.com/components/#pagination +{% endcomment %} +<nav> + <ul class="pagination"> + <li> + {% if paginator.previous_page %} + <a href="{{ paginator.previous_page_path }}" aria-label="Previous"> + <span aria-hidden="true">«</span> + </a> + {% else %} + <span aria-hidden="true">«</span> + {% endif %} + </li> + {% comment %} + The first page is a special flower, see + http://jekyllrb.com/docs/pagination/ + {% endcomment %} + <li{% if paginator.page == 1 %} class="active"{% endif %}> + <a href="/">1</a> + </li> + {% for i in (2..paginator.total_pages) %} + <li{% if paginator.page == i %} class="active"{% endif %}> + <a href="/{{ site.paginate_path | replace: ':num', i }}">{{ i }}</a> + </li> + {% endfor %} + <li> + {% if paginator.next_page %} + <a href="{{ paginator.next_page_path }}" aria-label="Next"> + <span aria-hidden="true">»</span> + </a> + {% else %} + <span aria-hidden="true">»</span> + {% endif %} + </li> + </ul> +</nav> diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..9a2976a --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,12 @@ +--- +layout: default +--- + +<h1>News{% if paginator.page > 1 %} Archive{% endif %}</h1> + +{% for post in paginator.posts %} + <h2><a href="{{ post.url }}">{{ post.title }}</a></h2> + {{ post.content | markdownify }} +{% endfor %} + +{% include paginate.html %} diff --git a/_layouts/post.html b/_layouts/post.html index 0d6905d..aa390ea 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,3 +1,6 @@ --- layout: default --- + +<h2>{{ page.title }}</h2> +{{ page.content|markdownify }} @@ -1,3 +1,3 @@ --- -layout: default +layout: home --- |