Confused about taxonomy pages

A few things are going wrong in your example.

Have a read on:

That will clarify everything. You basically need the correct layout template pages, separately for the taxonomyTerm (categories, themes) and taxonomy (coffee, bar) pages. I use terms.html for taxonomyTerm pages, and reuse the default list.html for taxonomy.

Because you put foo.md pages in the content directory! Hugo has no way of knowing if you meant those to be regular content, or pages specific to your taxonomies. So it always assumes the former. Move those files to a structure like content/themes/bar/_index.md. See Page bundles | Hugo.

And lastly, I was experimenting with these very recently. You can find my detailed post with examples here. The example post links in there further link to the source Markdown files on the respective pages. The theme I use is also linked in the footer of those example pages if you want to peek at the terms.html and list.html layout files.