Dynamic pages in Ghost

I have one idea for a simple blog. However, there’s one section that would be dynamic. I am curious whether it would be possible to create a template and then load a JSON file with the data and let Ghost generate the pages dynamically.

For example: Imagine you have a template called cat.hbs and then a cat.json file with 100 cats. Would it be possible to generate a page for each cat with custom slugs so each one of those becomes https://mycat.com/cat/snowball or https://mycat.com/cat/pancake using one template?

I’ve seen this page but I’m confused, it seems that that is oriented towards creating custom URL structures, but not custom pages.

Thanks

Any solution?

Yes. Similarly, I also want to achieve this. Do you have any workaround solution?

Thanks

1 Like

I think I’m going to use Ghost as a headless CMS and use Next.js for the frontend.

Ok. Thanks for revert.Yes.

It would be nice if Ghost provides this inbuilt module to generate dynamic pages.

Bob in any case if you would have achieved this, would be happy to learn from you this.

Everything you have described can be accomplished with the Admin API - Ghost Admin API Documentation

I don’t think Ghost would ever add something like this, because you are basically just wanting to import a flat file and create pages. There is nothing dynamic about this. Unless the cat.json file is made dynamically, in which case I’d debate that is pointless - use the API.

The Post API is quite well documented and a 1-1 with page(s). So you can use that - Ghost Admin API Documentation

Hope that helps.