I am running a local installation of Ghost inside Windows using WSL (Debian). How can I add a page in my Ghost installation which will display all of my blog posts/articles? That means:
The Name of the page will be “Articles or Posts” and when I go to that page it will show all of my blog posts. I know how to add page, so I need the code snippet to show all posts/articles on that page.
Any kind of help is appreciated.
Ghost Version: 3.40.5
Platform: WSL (Debian) on Windows 10 build 20H2
Node: 12.10.1
The theme has a file called blog.hbs that has a lot of theme-specific HTML. The relevant for the blog post page uses Handlebars code that starts like this:
{{#get "posts" limit="all"}}
{{#foreach posts}}
So, you’re getting all of the posts and then you’re looping through them to do something with them. The theme authors created a card for each post.
The routes then has a collection for this page:
collections:
/blog/:
permalink: /{slug}/
template: blog
I think this post is helpful: How to create Post Archive page in your Ghost Theme? – Themeix They’re using routes instead of collections. (I’ve read about the differences between routes and collections but I still haven’t fully wrapped my mind around them.)