HUGO

Count posts by taxonomy/tag per authors

Hi guys. Sorry if the title kinda confusing. But my blog have serveral writers.
I’m already implement show all posts per writer by using Data.Pages . But here the problem i’m facing. How can i show number of projects available per author. Same as {{ len .Site.Taxonomies.tag project } but for per writer
Let say they made a post t showcase though a tag call project

---
title: "Tom project"
date: 2021-09-07T13:30:03+07:00
draft: false
tag: ["Project", "Frontend"]
authors:
  - Tom
---

The second writer is David

---
title: "David Project"
date: 2021-09-07T13:30:03+07:00
draft: false
tag:  ["Project","Backend"]
authors:
  - David
---

So Tom should be 1 and either David

Hey. I finally managed to work it. By combine between Data.Pages and {{ if in .Params.tag “Projects” }}. :smiley: Just in case for future attempt

The code is

 {{ range .Data.Pages }}
                    {{ if in .Params.the "Projects" }}
                       {{ . }}
                    {{ end }}
    {{ end }}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.