Skip to content

Commit 2b24206

Browse files
ibradosverrirs
authored andcommitted
Update READMEs re category vs categories, etc.
1 parent 9ce0e40 commit 2b24206

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

README-AUTOPAGES.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,12 @@ An example of this can be found in [examples/03-tags/_layouts/autopage_collectio
100100
### Title should not contain pagination macros
101101
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.
102102
103+
### Categories and tags with spaces
104+
If you have category or tag names with spaces, make sure you use either
105+
1. the singular forms (`tag`, `category`), or
106+
2. the plural forms (`tags`, `categories`) using the YAML array syntax.
107+
108+
See [Filtering categories](https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#filtering-categories) for more information.
109+
103110
## Common issues
104-
_None reported so far_
111+
_None reported so far_

README-GENERATOR.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,36 @@ pagination:
271271
category: software, ruby
272272
```
273273

274+
You may use also use `categories` instead:
275+
276+
``` yml
277+
pagination:
278+
enabled: true
279+
categories:
280+
- software
281+
- ruby
282+
```
283+
284+
**Note:** Do *not* use `categories` as follows:
285+
286+
``` yml
287+
categories: programming language, ruby
288+
```
289+
290+
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
291+
292+
``` yml
293+
category: programming language, ruby
294+
```
295+
296+
or
297+
298+
``` yml
299+
categories:
300+
- programming language
301+
- ruby
302+
```
303+
274304
> 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.
275305

276306
### Filtering tags
@@ -291,6 +321,16 @@ pagination:
291321
tag: cool, life
292322
```
293323

324+
As with categories, you may also use the following symtax:
325+
326+
``` yml
327+
pagination:
328+
enabled: true
329+
tags:
330+
- cool
331+
- life
332+
```
333+
294334
> 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"_
295335

296336
### Filtering locales

0 commit comments

Comments
 (0)