Lacking documentation on Channels and how to actually build a custom page for it

While writing a custom theme, I decided to go with some customized templates for some pages, and using channels seemed like a good decision. The problem is that there is practically no documentation at all on how you proceed after messing up with routes. How you fetch data? What variables are exposed so the developer can actually use it? Using tag, page, post helpers yields nothing.

And, I really need to enforce this, the “writing a custom theme” page only points to handlebars docs. Which… is fine if you need to understand syntax, but as a developer I want to know, without having to grep over the code, what Ghost gives to me, how it glues the backend with my theme, etc.

I would volunteer for helping, but apparently the documentation is closed-source. Also, glancing over the organization, I found that themes are lacking more complex examples than a general blog, with tags and a about page.

So, after building a custom route, adding tags, how should I fetch the posts? Manually grabbing all posts and filtering again (it’s on the routes.yaml, after all), sounds hacky, there’s probably a correct way to do it, right? shows a good example of one way to use channels. Long story short, {{foreach "posts"}} should work in that context.

1 Like