I want to access a metadata value associated with a given author.
I have:
content
author
mark
_index.md
_index.md is:
+++
title = "Mark Richards"
author_image = "/images/mark-author.jpg"
+++
On a page that lists post-cards for each page in a section (so the context will be a content post–or simply a page) I want to include a teeny little photo of the author of the page that is the anchor for a link to all of that author’s posts. I already have working the code that grabs the name of the author of the post-card. With that I should be able to get the link to his/her/their picture. But, I am stumped how to do it.
The name of the author (not the title–so it is “mark” in this case, not “Mark Richards”) is:
.context.Param "author" # result is "mark"
The link to all of mark’s posts is:
{{$url := path.Join "/author/" (.context.Param "author") | urlize }} # result is /author/mark
What I now want is $img, which should be “/images/mark-author.jpg”. But, I don’t want to build it up using literals like I did before. I should be able to read it from the front matter for mark in the appropriate _index.md.
Seems like there should be a direct way using one of the taxonomy functions especially since I know the taxonomy is “author” and I have “mark”. Right now I just hardcoded the src= link in the img tag to get everything else working.
Which function? Which arguments?
By the way, this is the casper3 theme. No activity and replies on issues in that repo. The layout for the postcard uses a hard-coded link to a bogus site and a hardcoded svg drawing as the picture. So, no help there.