Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f9c77f0
Add methods to merge singular/plural keys, string/array values
ibrado Jan 24, 2018
9146fa0
Add all/any filter; combine plural/singular keys
ibrado Jan 24, 2018
146575b
Add example with filter: any
ibrado Jan 24, 2018
0a0f573
Also strip the filter_value
ibrado Jan 24, 2018
98a1c4a
Support values/matching hash format
ibrado Feb 1, 2018
d08c125
Update 'any' example
ibrado Feb 1, 2018
20622ab
Add 'all' example
ibrado Feb 1, 2018
e9673e2
Avoid possible side effects in changing config_key
ibrado Feb 1, 2018
942eb63
Remove extraneous plural check
ibrado Feb 1, 2018
7456dc0
Revert/enhance plural_key checks
ibrado Feb 1, 2018
14c3330
Add type check in config_hash assignment
ibrado Feb 1, 2018
18fd3a7
Fix category vs categories; use array for categories
ibrado Jan 24, 2018
edd0fd1
Fix wrong category for toyota
ibrado Jan 24, 2018
b5fd2eb
Fix tag vs tags, tags with spaces
ibrado Jan 24, 2018
d4d3ce1
Remove reference to missing icon-github.html
ibrado Jan 24, 2018
afda590
Update _config.yml to use plugins vs gems
ibrado Jan 24, 2018
9ce0e40
Also update Example 04
ibrado Jan 24, 2018
2b24206
Update READMEs re category vs categories, etc.
ibrado Feb 1, 2018
c59b81a
Add info re special characters and slugify
ibrado Feb 1, 2018
cf0d07f
Fix typo
ibrado Feb 1, 2018
7a15647
Update README.md
sverrirs Feb 8, 2018
9f77ff1
Fix typo in README.md
fertapric Mar 30, 2018
7ed9342
Autopages will use tags and categories from all collections
alzeih Feb 13, 2018
cc1f3e9
Allow a config option to bypass the delimiter split
jaredcwhite Jun 24, 2018
b68d9eb
Refactor unnecessary code
jaredcwhite Jun 25, 2018
c633a7c
Reset files to remove the no_delimiter option
jaredcwhite Jun 25, 2018
e9426ec
Use default permalink if specified; replace placeholders
ibrado Feb 2, 2018
70070fd
Use instance variable for site
ibrado Feb 2, 2018
221259b
Re implementing offset feature previously done by @benjaminleonard in…
sverrirs Aug 29, 2018
f9b661f
Readme for offset
sverrirs Aug 29, 2018
20d107d
Refactor PaginationModel debugging methods
ashmaroli Oct 31, 2018
9d269df
Array#size returns integer
ashmaroli Oct 31, 2018
a2f11c5
Paginate template only if explicitly enabled
ashmaroli Oct 31, 2018
9307266
Remove duplicate method definition
ashmaroli Oct 31, 2018
f97c0aa
Draw array across multiple lines to ease tracking
ashmaroli Nov 1, 2018
645b085
Set PaginationPage rel_path based on parent page
ashmaroli Nov 1, 2018
9409edd
Add an alias_method setter for setting urls
ashmaroli Nov 2, 2018
69764c3
Replace conditional with double pipe operator
ashmaroli Nov 2, 2018
241eb95
Compute first_index_page_url from template's url
ashmaroli Nov 1, 2018
bd73f74
Fail gracefully instead of silently fixing urls
ashmaroli Nov 2, 2018
264e922
Use Jekyll logger to print simple strings
ashmaroli Nov 3, 2018
c657c5f
Cache the value of newpage.pager.page_path in var
ashmaroli Nov 3, 2018
b7cd20c
Exclude everything not a `lib/**/*.rb`
ashmaroli Nov 9, 2018
8d45997
Set 'index' as the default basename of indexpage
ashmaroli Dec 27, 2018
4f80d93
Bumping version and building new gem
sverrirs Jan 6, 2019
40b9efe
Update README.md
sverrirs Feb 19, 2019
a641010
Added :language macro
z3nth10n Mar 19, 2019
803848c
Added :language macro for frontmatter header
z3nth10n Mar 20, 2019
34e3e6c
Added default lang
z3nth10n Mar 20, 2019
09877c0
Updated dependencies
z3nth10n Nov 22, 2019
6edc8a1
Fixed lang template problem; TODO
z3nth10n Nov 25, 2019
594f781
Solved bug with permalinks
z3nth10n Nov 30, 2019
9e50aa9
Relaxed jekyll version as dependency
z3nth10n Nov 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ engines:
enabled: false
ratings:
paths:
- "**.rb"
- "**/*.rb"
exclude_paths:
- spec/
- "*.*"
- ".*"
- "**/*.md"
- "**/*.yml"
- "*.gemspec"
- Gemfile
- LICENSE
- Rakefile
- examples/
- res/
- script/
- spec/
39 changes: 38 additions & 1 deletion README-AUTOPAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,42 @@ An example of this can be found in [examples/03-tags/_layouts/autopage_collectio
### Title should not contain pagination macros
There is no need to include the pagination title macros `:num`, `:max` or `:title` in the title configuration. The autopages will use the title configuration from the pagination configuration itself.

### Categories and tags with spaces
If you have category or tag names with spaces, make sure you use either
1. the singular forms (`tag`, `category`), or
2. the plural forms (`tags`, `categories`) using the YAML array syntax.

See [Filtering categories](https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#filtering-categories) for more information.

### Special characters

As of v1.9.4, special characters are supported in category, tag, and collection names by default:

``` yml
category: sports car, b+w
```

If you need to support the previous behavior where special characters are replaced with hyphens in URLs, use the new `slugify` option:

``` yml
autopages:
categories:
enabled: true
slugify:
mode: nil
cased: true
```

The following modes are available:

| Value| Description |
| --- | --- |
| `none` | No conversion (default) |
| `raw` | Replace sequences of spaces with a hyphen |
| `nil` | Replace non-alphabetic characters with a hyphen |
| `pretty` | Keep some non-alphabetic characters (._~!$&'()+,;=@) |

If `cased` is set to `true`, all uppercase letters are replaced with their lowercase counterparts.

## Common issues
_None reported so far_
_None reported so far_
55 changes: 55 additions & 0 deletions README-GENERATOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The **Generator** forms the core of the pagination logic. It is responsible for
+ [Filtering locales](#filtering-locales)
* [How to paginate on combination of filters](#paginate-on-combination-of-filters)
* [Overriding site configuration](#configuration-overrides)
* [Offsetting posts (how to skip newest posts)](#offsetting-posts)
* [Advanced Sorting](#advanced-sorting)
* [Creating Pagination Trails](#creating-pagination-trails)
* [How to detect auto-generated pages](#detecting-generated-pagination-pages)
Expand Down Expand Up @@ -271,6 +272,36 @@ pagination:
category: software, ruby
```

You may use also use `categories` instead:

``` yml
pagination:
enabled: true
categories:
- software
- ruby
```

**Note:** Do *not* use `categories` as follows:

``` yml
categories: programming language, ruby
```

i.e. with category names that have spaces in them. Jekyll will split the above using spaces as the delimiter, resulting in `programming`, `language,`, and `ruby` as categories. Instead, use

``` yml
category: programming language, ruby
```

or

``` yml
categories:
- programming language
- ruby
```

> To define categories you can either specify them in the front-matter or through the [directory structure](http://jekyllrb.com/docs/variables/#page-variables) of your jekyll site (Categories are derived from the directory structure above the \_posts directory). You can actually use both approaches to assign your pages to multiple categories.

### Filtering tags
Expand All @@ -291,6 +322,16 @@ pagination:
tag: cool, life
```

As with categories, you may also use the following syntax:

``` yml
pagination:
enabled: true
tags:
- cool
- life
```

> When specifying tags in your posts make sure that the values are not enclosed in single quotes (double quotes are fine). If they are you will get a cryptic error when generating your site that looks like _"Error: could not read file <FILE>: did not find expected key while parsing a block mapping at line 2 column 1"_

### Filtering locales
Expand Down Expand Up @@ -354,6 +395,20 @@ pagination:
sort_reverse: false
```

## Offsetting posts
The paging logic can be instructed to exclude the first _N_ number of newest posts from the pagination.
This can be useful in situations where your site treats the first N posts differently from the rest (e.g. a featured post that is always present).

The number of pages to skip is configured using the `offset` setting like so

``` yml
pagination:
enabled: true
offset: 3
```

This example skips the 3 newest posts from the pagination logic.

## Advanced Sorting
Sorting can be done by any field that is available in the post front-matter. You can even sort by nested fields.

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Jekyll::Paginate V2

Pagination gem built specially for Jekyll 3 and newer that is fully backwards compatable and serves as an enhanced replacement for the previously built-in [jekyll-paginate gem](https://github.com/jekyll/jekyll-paginate). View it on [rubygems.org](https://rubygems.org/gems/jekyll-paginate-v2).
Pagination gem built specially for Jekyll 3 and newer that is fully backwards compatible and serves as an enhanced replacement for the previously built-in [jekyll-paginate gem](https://github.com/jekyll/jekyll-paginate). View it on [rubygems.org](https://rubygems.org/gems/jekyll-paginate-v2).

[![Code Shelter](https://www.codeshelter.co/static/badges/badge-flat.svg)](https://www.codeshelter.co/)
[![Gem](https://img.shields.io/gem/v/jekyll-paginate-v2.svg)](https://rubygems.org/gems/jekyll-paginate-v2)
[![Join the chat at https://gitter.im/jekyll-paginate-v2/Lobby](https://badges.gitter.im/jekyll-paginate-v2/Lobby.svg)](https://gitter.im/jekyll-paginate-v2/Lobby)
[![Build Status](https://travis-ci.org/sverrirs/jekyll-paginate-v2.svg?branch=master)](https://travis-ci.org/sverrirs/jekyll-paginate-v2)
[![Dependency Status](https://gemnasium.com/badges/github.com/sverrirs/jekyll-paginate-v2.svg)](https://gemnasium.com/github.com/sverrirs/jekyll-paginate-v2)
[![Code Climate](https://codeclimate.com/github/sverrirs/jekyll-paginate-v2/badges/gpa.svg)](https://codeclimate.com/github/sverrirs/jekyll-paginate-v2)
[![security](https://hakiri.io/github/sverrirs/jekyll-paginate-v2/master.svg)](https://hakiri.io/github/sverrirs/jekyll-paginate-v2/master)
[![Gem](https://img.shields.io/gem/dt/jekyll-paginate-v2.svg)](https://rubygems.org/gems/jekyll-paginate-v2)
Expand Down Expand Up @@ -41,6 +41,8 @@ Please see the [Examples](https://github.com/sverrirs/jekyll-paginate-v2/tree/ma

> :warning: Please note that this plugin is currently NOT supported by GitHub pages. Here is a [list of all plugins supported](https://pages.github.com/versions/). There is work underway to try to get it added it but until then please follow [this GitHub guide](https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/) to enable it or use [Travis CI](https://ayastreb.me/deploy-jekyll-to-github-pages-with-travis-ci/).

> GitLab supposedly supports [any plugin](https://about.gitlab.com/comparison/gitlab-pages-vs-github-pages.html).


## Pagination Generator

Expand Down
28 changes: 0 additions & 28 deletions examples/01-typicalblog/Gemfile

This file was deleted.

11 changes: 7 additions & 4 deletions examples/01-typicalblog/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
github_username: sverrirs

gems: [jekyll-paginate-v2]

# Build settings
markdown: kramdown
theme: minima
gems:
plugins_dir:
- jekyll-paginate-v2
exclude:
- Gemfile
Expand All @@ -34,13 +36,14 @@ exclude:
permalink: /:year/:month/:title.html

# Explicitly turn off the old code
paginate: nil
paginate_path: nil
#paginate: nil
#paginate_path: nil

# Pagination Settings
pagination:
enabled: true
per_page: 3
offset: 2
permalink: '/page/:num/'
title: ':title - page :num of :max'
limit: 0
Expand All @@ -53,4 +56,4 @@ pagination:
# retains backwards compatibility with the old pagination logic
# AS OF JANUARY 2018 this code does not work anymore!
#paginate: 3
#paginate_path: "/legacy/page:num/"
#paginate_path: "/legacy/page:num/"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Welcome to Jekyll Paginate V2!"
date: 2016-11-27 19:16:49 +0100
categories: jekyll paginate
category: jekyll paginate
---
You’ll find this post in your `_posts` directory. This post along with all of the other example posts is paginated by the new [jekyll-paginate-v2 gem](https://github.com/sverrirs/jekyll-paginate-v2).

Expand Down
8 changes: 2 additions & 6 deletions examples/01-typicalblog/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ permalink: /about/

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/)

You can find the source code for the Jekyll new theme at:
{% include icon-github.html username="jekyll" %} /
[minima](https://github.com/jekyll/minima)
You can find the source code for the Jekyll new theme at: [minima](https://github.com/jekyll/minima)

You can find the source code for Jekyll at
{% include icon-github.html username="jekyll" %} /
[jekyll](https://github.com/jekyll/jekyll)
You can find the source code for Jekyll at: [jekyll](https://github.com/jekyll/jekyll)
4 changes: 2 additions & 2 deletions examples/02-category/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ future: true
# Build settings
markdown: kramdown
theme: minima
gems:
plugins:
- jekyll-paginate-v2
exclude:
- Gemfile
Expand All @@ -47,4 +47,4 @@ pagination:
title: ' - page :num'
limit: 0
sort_field: 'date'
sort_reverse: true
sort_reverse: true
8 changes: 2 additions & 6 deletions examples/02-category/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ permalink: /about/

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/)

You can find the source code for the Jekyll new theme at:
{% include icon-github.html username="jekyll" %} /
[minima](https://github.com/jekyll/minima)
You can find the source code for the Jekyll new theme at: [minima](https://github.com/jekyll/minima)

You can find the source code for Jekyll at
{% include icon-github.html username="jekyll" %} /
[jekyll](https://github.com/jekyll/jekyll)
You can find the source code for Jekyll at: [jekyll](https://github.com/jekyll/jekyll)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
layout: post
title: Porsche 918 Spyder
date: 2016-10-18 19:16:49 +0100
categories: cars, grand touring, Porsche, sports car, b+w
categories:
- cars
- grand touring
- Porsche
- sports car
- b+w
---
_From Wikipedia, the free encyclopedia_

The Porsche 918 Spyder is a mid-engined plug-in hybrid sports car by Porsche.[3] The Spyder is powered by a naturally aspirated 4.6-litre V8 engine, developing 608 metric horsepower (447 kW), with two electric motors delivering an additional 279 metric horsepower (205 kW) for a combined output of 887 metric horsepower (652 kW). The 918 Spyder's 6.8 kWh lithium-ion battery pack delivers an all-electric range of 19 km (12 mi) under EPA's five-cycle tests.[1] The car has a top speed of around 340 km/h (210 mph).[4]

The 918 Spyder is a limited edition Hypercar, with 918 units manufactured and sold as a 2014 model year. Production began on September 18, 2013, with deliveries initially scheduled to begin in December 2013.[5][6] The starting price was US$847,000.[4] The 918 Spyder was sold out in December 2014. The country with the most orders was the United States with 294 units.[7][8] Canada ordered 35 units.[9] Production ended in June 2015.[10]

The 918 Spyder was first shown as a concept at the 80th Geneva Motor Show in March 2010.[5] The production version was unveiled at the September 2013 Frankfurt Motor Show.[11] Porsche also unveiled the RSR racing variant of the 918 at the 2011 North American International Auto Show, which combines hybrid technology first used in the 997 GT3 R Hybrid, with styling from the 918 Spyder.[12] The 918 Spyder was the second plug-in hybrid car from Porsche, after the 2014 Panamera S E-Hybrid.[13]
The 918 Spyder was first shown as a concept at the 80th Geneva Motor Show in March 2010.[5] The production version was unveiled at the September 2013 Frankfurt Motor Show.[11] Porsche also unveiled the RSR racing variant of the 918 at the 2011 North American International Auto Show, which combines hybrid technology first used in the 997 GT3 R Hybrid, with styling from the 918 Spyder.[12] The 918 Spyder was the second plug-in hybrid car from Porsche, after the 2014 Panamera S E-Hybrid.[13]
8 changes: 6 additions & 2 deletions examples/02-category/cars/_posts/2016-10-19-Porsche-964.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
layout: post
title: Porsche 964
date: 2016-10-19 19:16:49 +0100
categories: cars, grand touring, Porsche, sports car
categories:
- cars
- grand touring
- Porsche
- sports car
---
_From Wikipedia, the free encyclopedia_

The Porsche 964 is the company's internal name for the Porsche 911 manufactured and sold between 1989 and 1994. Designed by Benjamin Dimson through January 1986, it featured significant styling revisions over previous 911 models, most prominently the more integrated bumpers. It was the first generation 911 to be offered with Porsche's optional Tiptronic automatic transmission and all wheel drive as options.

## Carrera 2 and 4
The 964 was considered to be 85% new as compared to its predecessor, the Carrera 3.2. The first 964s available in 1989 were all wheel drive equipped "Carrera 4" models; Porsche added the rear wheel drive Carrera 2 variant to the range in 1990. Both variants were available as a coupe, Targa or Cabriolet. The 964 Carrera was the last generation sold with the traditional removable Targa roof until the 2011 991 (993, 996, and 997 versions used instead a complex glass-roof "greenhouse" system). A new naturally aspirated engine called the M64 was used for 964 models, with a flat-6 displacement of 3.6 litres. Porsche substantially revised the suspension, replacing torsion bars with coil springs and shock absorbers.[2] Power steering and ABS brakes were added to the 911 for the first time; both were standard. The exterior bumpers and fog lamps became flush with the car for better aerodynamics. A new electric rear spoiler raised at speeds above 50 mph (80 km/h) and lowered down flush with the rear engine lid at lower speeds. A revised interior featured standard dual airbags beginning in 1990 for all North American production cars. A new automatic climate control system provided improved heating and cooling. Revised instrumentation housed a large set of warning lights that were tied into the car's central warning system, alerting the driver to a possible problem or malfunction.
The 964 was considered to be 85% new as compared to its predecessor, the Carrera 3.2. The first 964s available in 1989 were all wheel drive equipped "Carrera 4" models; Porsche added the rear wheel drive Carrera 2 variant to the range in 1990. Both variants were available as a coupe, Targa or Cabriolet. The 964 Carrera was the last generation sold with the traditional removable Targa roof until the 2011 991 (993, 996, and 997 versions used instead a complex glass-roof "greenhouse" system). A new naturally aspirated engine called the M64 was used for 964 models, with a flat-6 displacement of 3.6 litres. Porsche substantially revised the suspension, replacing torsion bars with coil springs and shock absorbers.[2] Power steering and ABS brakes were added to the 911 for the first time; both were standard. The exterior bumpers and fog lamps became flush with the car for better aerodynamics. A new electric rear spoiler raised at speeds above 50 mph (80 km/h) and lowered down flush with the rear engine lid at lower speeds. A revised interior featured standard dual airbags beginning in 1990 for all North American production cars. A new automatic climate control system provided improved heating and cooling. Revised instrumentation housed a large set of warning lights that were tied into the car's central warning system, alerting the driver to a possible problem or malfunction.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
layout: post
title: Porsche 911 GT3
date: 2016-10-20 19:16:49 +0100
categories: cars, grand touring, Porsche, sports car
categories:
- cars
- grand touring
- Porsche
- sports car
---
_From Wikipedia, the free encyclopedia_

The Porsche 911 GT3 is a high performance version of the Porsche 911 sports car primarily intended for racing. It is a line of high-performance models, which began with the 1973 911 Carrera RS. The GT3 is named after the Fédération Internationale de l'Automobile (FIA) Group GT3 class in which it was designed to compete.

A number of variations, designed for road and track duty, have been introduced since its launch in 1999. More than 14,000 911 GT3 cars have been produced.

The GT3 has had a successful racing career in the one-make national Porsche Carrera Cup series, and the international Porsche Supercup. It has won championship and endurance races, including the GT class of the American Le Mans Series seven times, first overall in the 24 Hours of Daytona, and first overall at the 24 Hours Nürburgring six times.
The GT3 has had a successful racing career in the one-make national Porsche Carrera Cup series, and the international Porsche Supercup. It has won championship and endurance races, including the GT class of the American Le Mans Series seven times, first overall in the 24 Hours of Daytona, and first overall at the 24 Hours Nürburgring six times.
Loading