Categories for a different collection

Is there a way to iterate over the categories for a different collection.( other than posts ). site.categories shows all the categories and posts for the “post” collection. I have posts under the personal collection ( within _personal folder ) for which i want to build a category/post within category page.

the words category and tag have a special use within the posts collection only - they allow the site.category (or tag) stuff to work.

That said, if you have front matter in a collection that is not the posts collection it will just end up being a normal front matter variable and you can loop over the collection and check to see if the item has that front matter variable - but it won’t show up in site.categories unless it is a post.

I would discourage you from using the words category, tag, categories, tags unless you are on a post though - since they are special words of sorts for jekyll.

So on your personal collection you could have a front matter variable called type or something and then you could do something with it to mimic the category stuff. If you want to pull all the posts and personal things that have the same cat/type you could probably add the 2 results together in liquid but that could get a bit messy.

The “personal” collection just has posts that i do not want to be linked and seo’ed. ( basically hidden). Other than that , they also contain "post"s and belong to a category and they also use the post layout.
I am open to renaming the category of a personal post to “type”

I am able to get all the personal posts with the following , but i can’t get “categories” or “type” of a post.
{% assign personal_posts = site.collections | where: 'label', collection %}

I want to get all categories/types of posts and posts belonging to that type for a personal posts.

I think for the personal collection you can get all the personal items by doing site.personal. So you could either assign it and try to do a where (which should work I think) or just do it in a loop and put an if in the loop to see if it matches.

maybe something like
{% assign personal_posts = site.personal | where: 'type', 'sometype' %}

not sure on the formatting of the where but something like that might work.