A taxonomy value isn't in site.Taxonomies until it's referenced in front matter somewhere first

A taxonomy value isn’t in site.Taxonomies until it’s referenced in front matter somewhere first.

Is that expected?

I’m not sure what you mean by that. With a default config and no content:

  {{ range $taxonomy, $_ := site.Taxonomies  }}
    {{ $taxonomy | warnf "%s"}}
  {{ end }}

The console emits:

WARN  categories
WARN  tags

My apologies, I should have included an example of what I was seeing.

I have an “authors” taxonomy configured. I created content/authors/foo/_index.md with

+++
title = "Foo"
default = true
+++

However, when rendering a page that has no declared values for the authors taxonomy in its front matter, and I iterate site.Taxonomies.authors looking for any “default” authors, the Foo author isn’t there. When I explicitly add authors = ["foo"] to another page, then Foo shows up in the authors taxonomy iteration.

That’s what I’d expect.

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