To clarify: You want the number of posts per category, not the number of topics per category?
Either way I can say that it certainly is possible.
I am personally quite new to ember.js so I can only offer this in theory at the moment.
import Component from "@glimmer/component";
import Service, { inject as service } from "@ember/service";
import { action } from "@ember/object";
export default class CategoryStats extends Component {
@service site
categoryId = **input category id number**;
postcount = this.site.categories[this.categoryId-1].post_count;
}
Because each category does keep track of the total number of posts, and the site keeps track of each category in a categories array, you could add an ember component like the one above and then output the {{postcount}} to the template from the Custom Header Links, or wherever else you’d like.
However, I am currently too dumb to know how pass in that categoryId value as an input, so I will have to punt this to someone smarter or more experienced.