# I wrote a tool for building routes.yaml files!

**URL:** <https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215>\
**Category:** Share & showcase\
**Created:** [September 20, 2025, 7:35pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215 "2025-09-20T19:35:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 20, 2025, 7:35pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/1 "2025-09-20T19:35:48Z")

</div>

It’s very much beta at this point, but here it is!

> **[Vite + React](https://sws-routes-builder.netlify.app/)**

Reports of invalid routing files appreciated. I still need to add some additional validation, but it should make it easier to generate the routes you want. Maybe?

Note: Not all themes respect routing. Source is particularly not routes.yaml friendly. Casper is a good option, if you want to try it.

No clue what I’m talking about? [URLs & Dynamic Routing - Ghost Developer Docs](https://docs.ghost.org/themes/routing)

---

<div class="post-metadata">

**Author:** ![digitalresidue](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/digitalresidue/32/30339_2.png) [@digitalresidue](https://forum.ghost.org/u/digitalresidue)\
**Post date:** [September 22, 2025, 5:55pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/2 "2025-09-22T17:55:12Z")

</div>

> [@Cathy\_Sarisky](#):
>
> [https://sws-routes-builder.netlify.app/](https://sws-routes-builder.netlify.app/)

Love this! Thank you in advance from everyone!

---

<div class="post-metadata">

**Author:** ![ashishkumar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ashishkumar/32/37397_2.png) [@ashishkumar](https://forum.ghost.org/u/ashishkumar)\
**Post date:** [September 23, 2025, 10:53am UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/3 "2025-09-23T10:53:17Z")

</div>

Neat tool!

Bug: `limit` is an unrecognised property for both routes, and collections.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 23, 2025, 1:12pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/4 "2025-09-23T13:12:32Z")

</div>

Is ‘limit’ valid? It’s not in the docs. [URLs & Dynamic Routing - Ghost Developer Docs](https://docs.ghost.org/themes/routing)

Guess I need to go read the source code! 🙂

---

<div class="post-metadata">

**Author:** ![ashishkumar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ashishkumar/32/37397_2.png) [@ashishkumar](https://forum.ghost.org/u/ashishkumar)\
**Post date:** [September 23, 2025, 2:03pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/5 "2025-09-23T14:03:41Z")

</div>

yep. not in the docs, but i’ve been using it to great affect for quite some time. let’s you override the `posts_per_page` value set in package.json on a per-collection basis.

i’ve discovered that all querying options for the `get` helper work in the routes file.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 23, 2025, 2:04pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/6 "2025-09-23T14:04:53Z")

</div>

OK, so I learned something. As best I can tell, setting ‘limit’ in the routes file causes that route to return that number of posts, overriding the package.json posts\_per\_page. It doesn’t impact how many posts will be assigned to that route, just how many will be assigned to each page.

Which is interesting, but I’m not quite sure how I’d use it…

---

<div class="post-metadata">

**Author:** ![ashishkumar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ashishkumar/32/37397_2.png) [@ashishkumar](https://forum.ghost.org/u/ashishkumar)\
**Post date:** [September 23, 2025, 2:06pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/7 "2025-09-23T14:06:38Z")

</div>

I use it to customise the number of posts. For example, I have a newsletter where I only want a single issue to be visible at any time. I can set the limit to 1 for that collection, and I do not need to build any custom index pages. I also use this to increase the number of posts visible on the index of my linkblog. Neat stuff.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 23, 2025, 2:06pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/8 "2025-09-23T14:06:43Z")

</div>

> [@ashishkumar](#):
>
> i’ve discovered that all querying options for the `get` helper work in the routes file.

Interesting. What besides limit are you using? I can see that it appears to accept include, status, visibility, and page also, but I’m not quite sure how that translates to building a collection.

> <https://github.com/TryGhost/Ghost/blob/96868dff146b7b6768a57009e3ac3b9a41573b01/ghost/core/core/server/services/route-settings/validate.js#L93>

Update: Of course, I use filter and order all the time! 🙂

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 23, 2025, 2:07pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/9 "2025-09-23T14:07:53Z")

</div>

> [@ashishkumar](#):
>
> I can set the limit to 1 for that collection, and I do not need to build any custom index pages

Ah, I see. Of course, it’s still there, just at (yourcollectionurl)/page/2 …

---

<div class="post-metadata">

**Author:** ![ashishkumar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ashishkumar/32/37397_2.png) [@ashishkumar](https://forum.ghost.org/u/ashishkumar)\
**Post date:** [September 23, 2025, 2:08pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/10 "2025-09-23T14:08:59Z")

</div>

Snippet from my routes file:

```auto
collections:
  /blog/:
    data: tag.blog
    filter: primary_tag:blog
    permalink: /blog/{slug}/
  /scrapbook/:
    data: tag.scrapbook
    filter: primary_tag:scrapbook
    limit: 20
    permalink: /scrapbook/{slug}/
  /private-access/:
    data: tag.private-access
    filter: primary_tag:private-access
    limit: 1
    permalink: /private-access/{slug}/

```

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 23, 2025, 2:12pm UTC](https://forum.ghost.org/t/i-wrote-a-tool-for-building-routes-yaml-files/60215/11 "2025-09-23T14:12:19Z")

</div>

I’m not seeing any effect of including a visibility (tried as visibility: members) or status (as status: draft)….
