Creating a header menu link to show all post in a specific category. How?

My demo site is here.

The header menu has links for Flights, Maintenance, and Stuff. Those links were created by making folders (directories) located at…

/public_html/user/pages/02.flights/
/public_html/user/pages/03.maintenance/
/public_html/user/pages/04.stuff/

and inside each folder was a default.md file with the following code…

---
redirect: '/category:flights'
---
---
redirect: '/category:maintenance'
---
---
redirect: '/category:stuff'
---

My question: Is this to proper way to be creating header links to display category pages? I’m guessing there’s a more elegant way to do this, but I can’t figure it out.

@Alpha, Have you considered using the TaxonomyList plugin which is used by the Blog Site skeleton? See Popular Tags in the sidebar.

If you have, why did you dismiss its use and opt for menu items?

I’ve only got three categories for all my posts and I have always preferred navigating a site via a header menu (because headers always display at the top before sidebars) so I was trying my best to replicate the format that’s on the site I’m trying to update.

@Alpha, It is however very common for blog sites to show a category list, or a category cloud. Visitors are familiar with the concept…

But if you wish to stick to the menu items, you could alternatively, instead of using redirects, which might hurt your SEO if not used correctly and cause an extra roundtrip by the browser, consider turning each default.md page into a blog.md page, each with a proper collection.

For example: /public_html/user/pages/02.flights/blog.md

content:
  items:
    '@taxonomy.category': flights

Great! This is along the lines of what I was hoping for, but it’s not quite working. It shows a page without any posts.

https://dorianj3.sg-host.com/flights

@Alpha, Your page header is incorrect… Add the opening and closing ---.

You will probably also need to add other header info like pagination, hero-image, etc. See the Blog Site skeleton.

It works! This is what I wanted. Thanks.

I added sorting and pagination, but it’s not working. It’s loading every post and ordering them randomly. Any ideas?

---
content:
  items:
    '@taxonomy.category': flights
    order:
        by: date
        dir: desc
    limit: 10
    pagination: true
---```

Disregard. My tab spaces were messed up. This works.

---
content:
  items:
    '@taxonomy.category': flights
  order:
    by: date
    dir: desc
  limit: 10
  pagination: true
---