Customizing Ghost: Modify RSS Feed

Ghost has already implement RSS functionality, so we can get our site feed by simply calling [site]/rss.

However, since I'm not using Ghost just for a blog, but more for a personal website, there are a few problems with the current implementation:

  1. It doesn't include static page.
    In this website, I use static page to define "About Me" Page, simply because I want to have a separate page.
  2. It doesn't include all posts
    By default, it can only take up to 15 posts maximum, which I think is not correct for RSS.

So, I need to make some changes on Ghost core code

core/server/models/post.js

In this code, I introduce a new option property called limit. if the value is "all", that means I want to grab all posts

core/server/controller/frontend.js

In rss controller, I expect there might be two additional query variables, i.e. limitParam to set how many posts to be returned ("all" means return all) and staticPagesParam to set whether we want to get staticPages ("true"), non staticPages("false"), or get all ("all")

Hence, if we want to get all pages and without limit, we simply call this url

[site]/rss?limit=all&staticPages=all

Abdurrachman Habibi

Read more posts by this author.