# Generate new pages after processing posts?

**URL:** <https://talk.jekyllrb.com/t/generate-new-pages-after-processing-posts/774>\
**Category:** Uncategorized\
**Created:** [July 12, 2017, 5:46pm UTC](https://talk.jekyllrb.com/t/generate-new-pages-after-processing-posts/774 "2017-07-12T17:46:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlnagy](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tlnagy](https://talk.jekyllrb.com/u/tlnagy)\
**Post date:** [July 12, 2017, 5:46pm UTC](https://talk.jekyllrb.com/t/generate-new-pages-after-processing-posts/774/1 "2017-07-12T17:46:41Z")

</div>

I have a bunch of posts that have the following format

```auto
# some header1 #category1 #category2

content1

# some header2 #category2 #category3

content2

```

I want to generate new per-category pages that include the parts of each posts that are followed by certain tag categories, i.e. I want to generate these 3 pages:

```auto
>>>>>>>>>>>>>>>>>>>>>>>
in /tags/category1.html

# some header1

content1

>>>>>>>>>>>>>>>>>>>>>>>
in /tags/category2.html

# some header 1

content1

# some header2

content2

>>>>>>>>>>>>>>>>>>>>>>>
in /tags/category3.html

# some header2

content2

```

I have already written a hook that processes the posts on `pre-render` and creates a mapping between tags -\> parts of posts that have related content. I store this hash in `site.data`. Now I want to generate the pages, but `generate` runs before `render` so I don’t have access to the updated `site.data` in `generate`. I looked into the `post_init` hook, but it looks like you don’t have access to the payload (to store the hash in `site.data`) so what is the best way to do this?

Any thoughts?
