Author name to be link to all author posts

I have created the taxonomy “author” in my config file. (I use author in the front matter not the more common authors.)

Now, Hugo nicely generates a page for each item in the author taxonomy, for example:

Does exactly what it should–super easy.

Now, I want to the author name link at the bottom of each post to be a link to the author post list (the page generated by the taxonomy).

The author name at the bottom of a post looks like this in the layout:

 <h4 class="author-card-name"><a href="{{"/" | absURL}}">{{$ | default}}</a></h4>

I should be able to change something in the anchor tags href value to do that. I can’t figure out what to change. Seems like I should replace the “/” but with what?

I really don’t get all the template language stuff at all. What is the link to the site? is it . ? Then, I don’t get the use of > or |. It’s all pretty opaque. I want something like:

(print .Permalink “/author/” $

as input to absURL function. Note that variable $author holds the link to the author’s .toml file in the directory /data/authors where the name value, which I call author is picked up. The multiple authors stuff all works perfectly (even if you don’t like my mix of singular and plural). I just need to get the link href correct.

This is all much easier than all the shenanigans people do to create a list of posts by author. Taxonomies do nearly everything for free. The link is obvious. I just need to stick the right template code into the post layout.


Hi @lewisl – just to make sure I’m reading this right (and it’s categorized correctly), are you asking a question, or sharing a tip?

Asking what the link should be in the href parameter of the anchor tag at the bottom of the post partial layout.


<h4 class="author-card-name"><a href="{{ (print "author/" (lower $ | absURL}}">{{$ | default}}</a></h4>

Easy and logical. I was in a rush before. Still don’t always mentally parse apart the html from {{ template code }}.