# Pagination behavior for Custom Output in 0.31+ vs. 0.42+

**URL:** <https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676>\
**Category:** support\
**Tags:** pagination\
**Created:** [June 29, 2018, 7:45pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676 "2018-06-29T19:45:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirkjs](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@kirkjs](https://discourse.gohugo.io/u/kirkjs)\
**Post date:** [June 29, 2018, 7:45pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676/1 "2018-06-29T19:45:42Z")

</div>

I’ve been trying to figure out some slowdowns related to generating JSON indexes as described [here](https://halfelf.org/2017/hugos-making-json/) and noticed a difference in the way that 0.31.1 and 0.42 renders Custom Output formats. 0.31.1 produces one JSON file for the entire site.

```auto
> hugo version
Hugo Static Site Generator v0.31.1 darwin/amd64 BuildDate: 2017-11-27T06:26:26-05:00
> hugo --templateMetrics
... 
    38.678751ms 38.678751ms 38.678751ms 1 index.json
...
> ls **/index.json
layouts/index.json	public/index.json

```

0.42.2 renders an index.json page for every pagination page.

```auto
> ~/Downloads/hugo version
Hugo Static Site Generator v0.42.2 darwin/amd64 BuildDate: 2018-06-28T12:36:21Z
> ~/Downloads/hugo --templateMetrics
...
   5.307117485s 112.917393ms 259.236136ms 47 index.json
...
> ls **/index.json
layouts/index.json public/page/23/index.json	public/page/38/index.json
public/index.json* public/page/24/index.json	public/page/39/index.json
public/page/10/index.json	public/page/25/index.json	public/page/4/index.json
public/page/11/index.json	public/page/26/index.json	public/page/40/index.json
public/page/12/index.json	public/page/27/index.json	public/page/41/index.json
public/page/13/index.json	public/page/28/index.json	public/page/42/index.json
public/page/14/index.json	public/page/29/index.json	public/page/43/index.json
public/page/15/index.json	public/page/3/index.json	public/page/44/index.json
public/page/16/index.json	public/page/30/index.json	public/page/45/index.json
public/page/17/index.json	public/page/31/index.json	public/page/46/index.json
public/page/18/index.json	public/page/32/index.json	public/page/47/index.json
public/page/19/index.json	public/page/33/index.json	public/page/5/index.json
public/page/2/index.json	public/page/34/index.json	public/page/6/index.json
public/page/20/index.json	public/page/35/index.json	public/page/7/index.json
public/page/21/index.json	public/page/36/index.json	public/page/8/index.json
public/page/22/index.json	public/page/37/index.json	public/page/9/index.json

```

Calling `jsonify` seems to be expensive. Existing documentation says that pagination applies if the template specifies pagination but doesn’t specify whether it would be applied to all index pages. Pagination is referenced in index.html but not index.json. Is there a way to exclude index.json from pagination?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [June 29, 2018, 7:59pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676/2 "2018-06-29T19:59:15Z")

</div>

This looks like a bug, and I’m a little bit curious as to how this was not discovered, I suspect it is a rather new issue. Can you create a GitHub issue about this and I will fix this? We may create a better definition in the future, but for now: The main output format (usually HTML) is the only source getting paginated output.

---

<div class="post-metadata">

**Author:** ![kirkjs](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@kirkjs](https://discourse.gohugo.io/u/kirkjs)\
**Post date:** [June 29, 2018, 8:05pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676/3 "2018-06-29T20:05:03Z")

</div>

Thank you. I’ll file an issue on github.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [June 29, 2018, 8:06pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676/4 "2018-06-29T20:06:16Z")

</div>

> [@bep](#):
>
> The main output format (usually HTML) is the only source getting paginated output.

That said, I will have to look into this. I assume that if you have a JSON template with a paginator, that should work.

---

<div class="post-metadata">

**Author:** ![kirkjs](https://avatars.discourse-cdn.com/v4/letter/k/7feea3/32.png) [@kirkjs](https://discourse.gohugo.io/u/kirkjs)\
**Post date:** [June 29, 2018, 8:16pm UTC](https://discourse.gohugo.io/t/pagination-behavior-for-custom-output-in-0-31-vs-0-42/12676/5 "2018-06-29T20:16:21Z")

</div>

Issue filed on github as [https://github.com/gohugoio/hugo/issues/4890](https://github.com/gohugoio/hugo/issues/4890) , I also attached the index.json file I’ve been using.
