Skip to content

Commit

Permalink
Readme for offset
Browse files Browse the repository at this point in the history
(cherry picked from commit f9b661f)
  • Loading branch information
sverrirs committed Feb 7, 2020
1 parent cb334e8 commit ecb8bb2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 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 @@ -354,6 +355,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

0 comments on commit ecb8bb2

Please sign in to comment.