Using the Casper theme, is there a simple way to make a nav menu item link to a page with all posts?

I’m using the most recent version of Ghost and an up to date Casper theme (modified a little bit).

Is there a simple way to make a nav menu item link to a page with all posts?

So I want an item in the top nav menu “Blog” to link to example.com/blog/ that contains a list of all posts (not just ones with a specific tag). I know I could just add a “Blog” tag every post manually, but I’m trying to avoid this if possible, and I would much rather the link be example.com/blog/ rather than example.com/tag/blog/

You could use the Content API for this as an option. Imagine the following:

  • A call to /ghost/api/v4/content/posts, using below query parameters
  • Using limit=all (this will be slow)
  • fields=url,title,featured,published_at,custom_excerpt,visibility
  • key=xxx (Your content api key)

This would basically expose all posts, with those following fields in a little JSON blob that you could wire up to do what you are wanting.

1 Like

Thanks! I’m a little surprised that there isn’t a more straight-forward way to do this. I would have thought that most or many people would want to have a page on their site that has a list of all their posts, like this blog articles | Derek Sivers (although if I do this, I will probably add a little more info about each post than Derek has, and use pagination so that the resulting page doesn’t end up becoming ridiculously long).

Well if you add pagination and a bit more info. It almost seems like you are describing the home/index page of a blog :slight_smile:

1 Like

Isn’t what you’re describing the “home” feature of every basic setup, in it’s most simple, uncomplicated way? There you have all posts in chronological order…

1 Like

Yes, I think that you and @Caucasus-and-Mercury are both right. The reason I wasn’t thinking of it like this is that my site isn’t like a typical blog with all the posts on the homepage. The blog is just part of a larger site, similar to Derek’s website that I linked to above, and I only want to have 7 or so posts featured on the homepage.

By the way, do you know if Casper adds pagination to the homepage when you exceed the maximum number of posts, which I think is 15? So people can click “see more posts” or “next” or something to see another page of older blog posts in chronological order.

Can’t you just put the for loop in index.hbs in a new .hbs file, hook up the routes and make it work?