Commit 93b90382 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Introducing pagination

parent be979e7f
......@@ -23,7 +23,8 @@ gem 'jekyll-theme-lcsb-default', '~> 0.2.5', :git => "
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-paginate-v2", "~> 1.7"
gem "jekyll-feed", "~> 0.6"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
......@@ -107,6 +107,30 @@ unless you want to contribute back to the upstream project.
* [jekyll-branched]( demonstrates how you can keep your GitLab Pages site in one branch and your project's source code in another.
* The [jekyll-themes]( group contains a collection of example projects you can fork (like this one) having different visual styles.
## Enabling and configuring pagination
The template includes `jekyll-paginate-v2` plugin by default, but it's turned off.
To use it, configure the pagination following instructions from the next paragraph, go to `` file and change `enabled: false` to `enabled: true`, and `published: false` to `published: true`. Later, create a directory called `_posts` in the project root directory and fill it with posts.
You may also need to disable showing ``, by setting `published: false` in its contents.
There are two sections in `_config.yml`, that refer to pagination: first, ` - jekyll-paginate-v2` line in plugins section, and then the configuration dictionary:
enabled: true # Note, that setting it to disabled does not disable it completely, as it has to be also set to false in `` file
title: ':title - page :num of :max' # Customize the text
per_page: 8 # How many posts should be displayed on one page
permalink: '/page/:num/' # The URL to the index of pagination
limit: 0
sort_field: 'date' # How the posts should be sorted. can also be: `title` or any page attribute
sort_reverse: true
trail: # How many pages should be shown in paginator.
before: 2 # Show 2 before the current one, e.g. `< 5 6 CURRENT ...`
after: 2 # Show 2 after the current one, e.g. `... CURRENT 6 7 >`
To disable it completely, set `enabled` to `false`, remove the aforementioned sections from the configuration, and `gem "jekyll-paginate-v2", "~> 1.7"` from `Gemfile` (from the project's root), and remove `` file from project's root directory.
Refer to its [documentation]( for more detailed instructions.
## Troubleshooting
1. CSS is missing! That means two things:
......@@ -34,10 +34,24 @@ markdown: kramdown
theme: jekyll-theme-lcsb-default
- jekyll-feed
- jekyll-paginate-v2
# Produces a cleaner folder structure when using categories
permalink: /:year/:month/:title.html
# Pagination Settings
enabled: true
title: ':title - page :num of :max'
per_page: 7
permalink: '/page/:num/'
limit: 0
sort_field: 'date'
sort_reverse: true
before: 2
after: 2
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
......@@ -2,6 +2,7 @@
layout: page
title: About
permalink: /about/
order: 2
This is the LCSB Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [](
......@@ -2,6 +2,7 @@
layout: page
title: Help
permalink: /the-help/
order: 3
This is the `help` page.
\ No newline at end of file
......@@ -3,6 +3,8 @@
# Edit theme's home layout instead if you wanna make some changes
# See:
layout: default
title: Index
order: 1
This is the `default lcsb theme` for gitlab pages...
# To enable the pagination, do the following changes in this file:
# published: true
# pagination:
# enabled: true
# And inside, add `published: false`
# You don't need to edit this file, it's empty on purpose.
# Edit theme's home layout instead if you wanna make some changes
# See:
title: index
layout: paginated_index
published: false
enabled: false
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment