I’m trying to create an iTunes XML feed for a podcast where each podcast episode will be a post on a Ghost 2.0.2 blog with the tag episode. Public available url http://bcurious.heiberg.io/
I’ve created 4 posts 3 of which have the episode tag.
I would expect http://bcurious.heiberg.io/episodes/ to list 3 episodes instead it’s just an empty page. Interestingly the title tag is bcurious (Page 1) which is curious?
I was just going to use a channel, but as I understand it channels don’t get rss feeds.
The first collection doesn’t use a filter and will own all posts, that’s why your episodes collection is empty. The collections are defined in a hierarchy.
You have to use filter: 'tag:-episode' for the first collection to exclude these posts.
Dang the docs did say that. I for some reasons forgot to think of index as a collection. In that case is there a way to create a rss feed for a channel?
It is my desire for the front page to include a list of both episodes and blog posts intermixed chronologically.
@Kate I tested too and I have a couple of questions.
Would this create some problems in the future? Instead of tag:-episode for first collection, I replaced the order. Seems fine for me. But I’m curios if something will go wrong at a certain step.
Is there a way to show both type of collections on homepage? I mean, I’m interested to see if there is a way to show both default posts and episodes in the default loop? Like @andheiberg said.
From the docs: “Posts can match the filters of multiple collections, when that happens the first collection with a match will take ownership of that post so it won’t appear under any other collections.”
If I understand correctly you can’t have a post in 2 collections.
Is there a way to exclude the episode from tag taxonomy.
Yeah it will. Pagination can break if you don’t explicitly use a filter. This is because the actual database query doesn’t use the filter and the Ghost logic has to manually filter them out. e.g. it can happen that the page limit is 10, but it only shows 7 posts and there is another page 2. That’s why we highly recommend using a filter for any collection I hope that answers your question.
Is there a way to show both type of collections on homepage? I mean, I’m interested to see if there is a way to show both default posts and episodes in the default loop? Like @andheiberg said.
You could create a channel to display all posts? A channel is a view. A channel does not define the url of a post.
Is there a way to exclude the episode from tag taxonomy.
If you define data: tag.episode, the taxonomy will redirect to /episodes/.
Success / lists 4 posts - the channel works
Success /rss/ lists 4 posts - the rss feed is using the channel or simply just using all stories. Either way I’m happy with that.
Failure /episodes/ shows 0 posts
Failure /rss/episodes/ 404’s
Failure /posts/ 404’s - why is this behaving differently than the /episodes/ endpoint?
Looks to be an issue with “post” being a reserved value? See how the tag has url /post-tag not /post. I tried editing it to /post and it refused and made a /post-tag-2.
We can use the precedence rules for collections to get around post being a reserved tag. Simply remove the post tag and use the posts collection as a catch all:
In the rss template I was trying to get a handle on what data is available by putting {{log this}} in the template. This causes errors. Is there a suggested way of determining what data is available to a template?
No data is available by default – you can get some data using the {{#get}} helper so you can manually specify exactly what you do/don’t want to include in your RSS feed. This is useful, cause it means you can make an iTunes-compatible feed, rather than just a default feed
(we’ll make some more detailed guides for things like this soon - just catching up from the launch atm)
I’m very close to having it working. Not quite sure how I will encode the link to the mp3 nor the duration of the episode.
I suppose I could just dedicate the first 2 lines of the post to it and extract it in the template. It’s very much a hack though. Any ideas how to make that more generalisable?
At the moment you’d definitely have to resort to some hacks. I would probably lean toward using the custom excerpt field, or maybe repurposing some of the social media description fields