Shadowen / jekyll-paginator-links

Generates links for Jekyll's paginator rendering

Home Page:http://wesley.heungs.com/projects/jekyll-paginator-links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Works together with Jekyll's Pagination function to generate a truncated list of links to pages. Fully customizable in Liquid and CSS.

image

Live demo

Usage

  1. 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!
  1. 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).

Customizing

Some useful selectors to use in the stylesheet paginator-links.css.

CSS Selector Component Description
.paginator-links image A wrapper for the entire generated set of links.
.paginator-links .start-ellipsis::before image The content attribute is the text shown when page numbers have been truncated from the beginning of the list.
.paginator-links .end-ellipsis::before image The content attribute is the text shown when page numbers have been truncated from the end of the list.
.paginator-links .seperator::before image The characters to use as seperators between page numbers.
.paginator-links .first-page::before image The content attribute is the text to use for the link to the first page. If blank, the "First Page" link will not be displayed.
.paginator-links .previous-page::before image The content attribute of this is the text to use for the link to the previous page. If blank, the "Previous Page" link will not be displayed.
.paginator-links .next-page::before image The content attribute of this is the text to use for the link to the next page. If blank, the "Next Page" link will not be displayed.
.paginator-links .last-page::before image The content attribute of this is the text to use for the link to the last page. If blank, the "Last Page" link will not be displayed.
.paginator-links .numbers image A div wrapping directly around the all the numbers, but not the ellipses or navigation buttons.
.paginator-links .number image The styling for each individual number.
.paginator-links a image The actual hyperlink. :link and :visited pseudoclasses are useful here.
.paginator-links .number.current image The currently selected page.

Why root

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.

Inspiration

About

Generates links for Jekyll's paginator rendering

http://wesley.heungs.com/projects/jekyll-paginator-links


Languages

Language:HTML 44.1%Language:Ruby 35.3%Language:CSS 20.6%