Hugo: taxonomyTerm Kind output format config is ineffective

Created on 23 Mar 2018  Â·  14Comments  Â·  Source: gohugoio/hugo

Hello,

I have thoroughly verified the reproducibility of this bug.


From https://discourse.gohugo.io/t/bug-taxonomyterm-kind-output-format-config-is-ineffective/11174:

Hello,

With playing with RSS/Atom feed generation today, I have found another issue with outputformats configuration.

I am using Hugo built from latest master.

With:

[outputs]
taxonomyTerm = ["HTML", "RSS", "ATOM"]

The ATOM output format does not get generated.

And with:

[outputs]
taxonomyTerm = ["HTML"]

The RSS output format still gets generated!

Here is my complete ATOM media type and outputs config:

[mediaTypes]
  [mediaTypes."application/atom"]
    suffix = "xml"

[outputFormats.Atom]
  # https://validator.w3.org/feed/docs/atom.html#whatIsAtom
  mediaType = "application/atom"
  baseName = "atom" # generated file = <baseName>.<mediaType."application/atom".suffix> = atom.xml
  isPlainText = false

[outputs]
  home = ["HTML", "RSS", "ATOM"] # default = ["HTML", "RSS"]
  section = ["HTML", "RSS", "ATOM"] # posts/atom.xml
  taxonomy = ["HTML", "RSS", "ATOM"] # tags/foo/atom.xml
  # Fri Mar 23 17:57:08 EDT 2018 - kmodi
  # There's some issue on Hugo 0.38-DEV (older versions too)..  The "ATOM"
  # output format is not getting generated for taxonomyTerm.
  taxonomyTerm = ["HTML", "RSS", "ATOM"] # tags/atom.xml

I am using layouts/_default/list.atom.xml template file for generating atom.xml for all of the above Kinds of pages.

How to recreate this issue

git clone https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io.git --recurse-submodules site
cd site/
hugo
# No atom.xml found in public/tags/
# But you will find it at public/tags/hugo/ and other expected places.

Bug Keep

All 14 comments

@bep Can this please is categorized appropriately so that it doesn't get auto-closed? Thanks.

Can confirm. With following config

[outputs]
        home         = ["html", "rss"]
        page         = ["html", "email"]
        section      = ["html"]
        taxonomy     = ["html"]
        taxonomyTerm = ["html"]

Hugo generates index.xml (for rss) in tags/ folder as well as categories/ folder, but not in section folders. I think one time i noticed, that index.xml was not generated in tags/ folder, so it might be a race condition.

Hugo Static Site Generator v0.38.2 linux/amd64 BuildDate: 2018-04-09T08:17:17Z

@bep While you are active on the multiple outputs debug and analysis, do you think this issue is anywhere related? It's strange that setting custom output formats just for taxonomyTerm Kind pages is ineffective.

Hello, I got the same problem while creating a new output format. I need an index.xhtml file for tags. And seems to be impossible. I try a lot of combination whtout any result :disappointed: .

What could I do to help in solving this problem?

+1 on the race condition theory; I thought I was going crazy in seeing no cause-effect in the outputs section configuration and the output, but a race condition would explain it.
Also this seems to repro pretty consistently. Anything blocking the debugging of this issue?

As a workaround you can set the output formats explicitly in the front matter. For example,

file: content/tags/_index.md

---
title: Tags
outputs:
  - html
  - rss
  - atom
---

should do the trick while the issue gets fixed.

Also having this issue âś‹

On my side @paulkoppen ' solution does not work for me.

Moreover, the "hugo serve" have no idea that "index.xhtml" exists. So it always show blank page. Then I need to type "index.xhtml" in my browser for all page xD. I become crazy :man_cartwheeling:

This isn't working for me on the home page either. Same config for Atom as @kaushalmodi but .AlternativeOutputFormats is [] on home page.

Also, getting this stuff working is really absurdly fiddly, please consider reopening #3473.

@bep As you can seen, I am not the only one seeing this issue. Can you look at this again?

Found my problem with the home page, I was using index.html for the template rather than _index.html. Discovered that was an error while investigating why .IsHome was returning false for the home page.

Same here. Setting config.yml > outputs > taxonomyTerm to ["HTML"] has no effect.

Also having this issue, too...

BTW, why the taxonomyTerm config taxonomy but the taxonomy config term? It is illogical at all!

According to the taxonomies:

Taxonomy
a categorization that can be used to classify content

Term
a key within the taxonomy

However, in the Page Kinds:

Kind | Description | Example
-- | -- | --
taxonomy | A page listing regular pages from a given taxonomy term | page for the term awesome from tags taxonomy (/tags/awesome/index.html)
taxonomyTerm | A page listing terms from a given taxonomy | page for the tags taxonomy (/tags/index.html)

See, that’s totally the opposite! And while I’m coding, it always makes me confused! Finally, it just drives me crazy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sigma picture sigma  Â·  3Comments

VoidingWarranties picture VoidingWarranties  Â·  3Comments

tjamet picture tjamet  Â·  3Comments

moorereason picture moorereason  Â·  3Comments

antifuchs picture antifuchs  Â·  3Comments