Content adapter for markdown page does not create taxonomy tags

I’m trying to create a content adapter to create markdown pages with taxonomy tags, but the tags do not show in the generated /tags overview or as /tags/tag1 page. Tags from static .md pages work as expected, only the generated pages do not.

I add the tags in the page dict for .AddPage:

  {{ $content := dict 
    "mediaType" "text/markdown" 
    "value" "Hello world! (This should have tags 'tag1' and 'tag2')" }}
  {{ $title := "Hello" }}
  {{ $tags := slice "tag1" "tag2" }}
  {{ $page := dict
    "path" "hello"
    "kind" "page"
    "title" $title
    "tags" $tags
    "content" $content
  }}
  {{ $.AddPage $page }}

What am I doing wrong?

A full example is at GitHub - robcast/hugo-adapter-tags: Test Hugo content adapter with tags · GitHub

Put it under the params key:

"params" (dict "tags" $tags)

Although this is demonstrated in the documented example, the requirement is not explicitly stated. We will update the documentation shortly.

Indeed, that works! (I thought it should work exactly like normal frontmatter, where tags is not in params. I also thought I had tried it in params at some point…)

Thanks!

I’ve updated the documentation accordingly. See the second list item here:
https://gohugo.io/content-management/content-adapters/#page-map

Nice, the documentation is much clearer now on this topic!