How do I bypass inside a link so I can access its subfolder

Hi, new Hugoers here.

I’m very new to Hugo please forgive for any of my mistakes.

So, I am following this blog to create authors using taxonomies and add the front matter of ‘photo’ for each one of them which I did it locally (img/author_photo.png) unlike the tutorial ( in the link given.


I am trying to add the corresponding photo to each author in the posts they wrote. I managed to get the img/author_photo.png through {{ }} but the link somehow becomes like this //exampledomain/page/authors/zaimazhar97/_index.mdimg/zaimazhar97.png … I am trying to reach the author’s photo at //exampledomain/authors/zaimazhar97/img/zaimazhar97.png

The code for the link I am trying to generate dynamically…

{{- range .Params.authors }}
   {{ with $.Site.GetPage "taxonomyTerm" (printf "authors/%s" (urlize .)) }}
         <img width="100px" src="{{ $.Site.BaseURL}}{{ ( printf (urlize .)) }}{{ }}" alt=""/
   {{ end }}
   <span style="font-size: 1em;"><a href="{{ $.Site.BaseURL}}{{printf "authors/"}}{{ . | urlize}}">{{ . }}</a></span>
{{{ end }}}

Thank you.

Found the solution by doing it this way : Inserting html links from markdown frontmatter.

Thank you.

1 Like

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