Posts not showing up in collection

I am trying to create a collection specifically for my podcasts, but I am running into an issue. None of the posts are showing up.

I have got a collection working previously for my portfolio, but cannot seem to get this working.

Here is the HTML:

<div>
  {{#tag}}
    {{!-- Hero --}}
    <header class="relative overflow-hidden bg-gradient-to-tl from-blue-700 via-blue-800 to-blue-900">
      <div class="relative pb-16 sm:pb-24">
        <main class="px-4 mx-auto mt-16 max-w-7xl sm:mt-24">
          <div class="text-center">
            <img class="h-24 mx-auto mt-4" alt="Money Making Marketing Podcast" src="{{asset "images/branding/money-making-marketing-podcast.png"}}" />
            <p class="max-w-md mx-auto mt-6 text-base text-gray-200 sm:text-lg md:mt-12 md:text-xl md:max-w-2xl">
              {{description}}
            </p>
          </div>
        </main>
      </div>
    </header>
  {{/tag}}

  {{!-- Main Contents --}}
  <main>
    <div class="bg-gray-50 dark:bg-gray-900">
      <div class="px-4 py-8 mx-auto max-w-7xl sm:px-6 lg:px-8">
        {{> "podcast/podcastLinks"}}
      </div>
      <div class="px-4 pt-8 pb-16 mx-auto max-w-7xl sm:px-6 lg:px-8">
        {{> "podcast/podcastFeed"}}
      </div>
      <div class="px-4 pb-16 mx-auto max-w-7xl sm:px-6 lg:px-8">
        {{pagination}}
      </div>
    </div>
  </main>
  
</div>```

Here is the routes.yaml:
```collections:
  /blog/:
    permalink: /blog/{slug}/
    template: index
    filter: tag:-case-study+tag:-free-course
  /portfolio/:
    permalink: /portfolio/{slug}/
    template: company\portfolio
    filter: primary_tag:case-study
    data: tag.case-study
  /podcast/:
    permalink: /podcast/{slug}/
    template: podcast
    filter: primary_tag:podcast
    data: tag.podcast```

I can get posts to show up using {{#get "posts}}, but pagination doesn’t work and it isn’t limited to 10 posts per page:


{{#tag}}
  {{!-- Hero --}}
  <header class="relative overflow-hidden bg-gradient-to-tl from-blue-700 via-blue-800 to-blue-900">
    <div class="relative pb-16 sm:pb-24">
      <main class="px-4 mx-auto mt-16 max-w-7xl sm:mt-24">
        <div class="text-center">
          <img class="h-24 mx-auto mt-4" alt="Money Making Marketing Podcast" src="{{asset "images/branding/money-making-marketing-podcast.png"}}" />
          <p class="max-w-md mx-auto mt-6 text-base text-gray-200 sm:text-lg md:mt-12 md:text-xl md:max-w-2xl">
            {{description}}
          </p>
        </div>
      </main>
    </div>
  </header>
{{/tag}}

{{!-- Main Contents --}}
<main>
  <div class="bg-gray-50 dark:bg-gray-900">
    <div class="px-4 py-8 mx-auto max-w-7xl sm:px-6 lg:px-8">
      {{> "podcast/podcastLinks"}}
    </div>
    <div class="px-4 pt-8 pb-16 mx-auto max-w-7xl sm:px-6 lg:px-8">
    {{#get "posts" filter="tag:podcast" include="authors,tags"}}
      {{> "blog/postFeed"}}
    {{/get}}
    </div>
    <div class="px-4 pb-16 mx-auto max-w-7xl sm:px-6 lg:px-8">
      {{pagination}}
    </div>
  </div>
</main>

So, it turns out what I actually needed in this use case was a content hub, not a collection, due to the podcast needing to show up in the blog as well.

What this has got me wondering though is this: When I want to create a collection, separate to the blog, does this need to be setup prior to creating a post for it, or would I be able to move the post to the new collection at a later date? For example, moving a post from a blog collection to a portfolio collection?

Yep, when you change a post, the URL will update based on the tags :slight_smile:

1 Like

Brill, thanks!