Delimit and markdownify together?

Hi,

I have this code:

{{ delimit .Params.authors ", " " and " }}

where authors is a list of strings.

I want to also use Markdownify to add links to the authors websites, so it would be:

authors = ["[Name 1](http://awsome_website.com)", "[Name 2](http://another_awsome_website.com)"]

However, if I add Mardownify to the code, it doesn’t work. I tried:

    {{ delimit .Params.authors | markdownify ", " " and " }}
    {{ delimit .Params.authors ", " " and " | markdownify }}
    {{ with .Params.authors }}
    {{ delimit . ", " " and "  | markdownify}}
    {{ end }}

It complains that .Params.authors is a list and not a string or that delimit gets more arguments than it should.

I’m new at gohugo (which I find amazing) so be gentle :slightly_smiling:

It should work like this:

{{ delimit .Params.authors ", " " and " | markdownify }}

What does that give you?

Hi, I get:

Error while rendering page publication\Aristidou2013.md: template: theme/publication/single.html:9:58: executing "theme/publication/single.html" at <markdownify>: wrong type for value; expected string; got template.HTML

I’m wondering if we’ve fixed that in 0.16-DEV, but try this:

{{ printf "%v" (delimit .Params.authors ", " " and ") | markdownify }}

Thanks! It worked like charm :slightly_smiling:

I use the 0.15 version.

Hai @moorereason and @apetros
i got, similar error while building my site, may i know where should we add the above code, thanks in advance

@sumendar,
Start a new thread and provide more details of exactly what you’re doing and the error message you receive. Also include the output of hugo version.