How to show total posts by each author besides their name?

Each author’s profile appears in a box below their article with their name, short description and links to their socials. I want to add the total number of posts by each author beside their name. In the front matter, there is a variable of author: author name that changes with each author.

The solution I found on Google Search

{{ $posts := (where .Site.RegularPages ".Params.Author" "==" "author_name") }}
{{ len $posts }}

author_name is the name of the author on the front matter. I use if/else to distinguish authors.

1 Like

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