Works together with Jekyll's Pagination function to generate a truncated list of links to pages. Fully customizable in Liquid and CSS.
- In your
_config.yml
, add the line:
paginate: 5
Note the number you set for paginate
is the number of posts/page.
2. Copy _includes/paginator-links.html
to your own _includes/
folder.
3. Copy paginator-links.css
to your own root folder. (See below)
- Customize this CSS file later to change the look and feel of your links!
- In your
index.html
(or wherever you're paginating), paste the following segment:
<style>{% include paginator-links.css %}</style>
{% include paginator-links.html maxPages=5 %}
Here, maxPages
is the maximum page numbers shown in the link bar. Use an odd number for best results (so we can center the current page number).
Some useful selectors to use in the stylesheet paginator-links.css
.
Everything in this demo is in the root folder of the repository because of the way GitHub Pages renders project pages. Unfortunately there is no work-around for this. However, in user pages you may use any arbitrary directory, so paginator-links.css
can be stored in the css/
or styles/
folder of your choice.