Related Content issues

First issue

Various TOML lint tools complain about the new Index Content Headings configuration, and I think it is because the schema store has not been updated. Is that something the Hugo owners manage, or is that completely unrelated?

Second issue

Second, I originally had one large “hugo.toml” config file, and my “related content” worked as expected. I recently split that up into separate files in the configuration directory, and in this case a file called /config/_default/related.toml.

I didn’t notice at first, but it appears that while in the separate config file, the related content never appeared ({{ $related := .Site.RegularPages.Related . | first 3 }} returned 0.

When I took that section and returned it to the main “hugo.toml” file (and un-comment the [related] object, things started working again…

And just to confirm, I have 7 config files, and the others seem to work at this time. This is the only one that is mis-behaving.



# [related]
includeNewer = true
threshold = 80
toLower = true
# [[related.indices]]
# name = 'categories'
# weight = "100"
name = 'tags'
weight = "100"
name = 'date'
weight = "10"

Any idea what is going on here?

Third (minor) issue

Note also that the Hugo docs really should mention that when you split the configs into their own files, the configuration root object (params, menu, languages, etc) must be removed/commented out to make it work… I had to infer it from the example.

(edit: Just need to mention that I am not declaring any --environment when building, so it should be grabbing from the _default configuration…)


[[indices]] instead. The related object is the file itself.

Seems clear to me, but you’re welcome to submit a PR to the docs repo.

Didn’t think to remove the related. from the headings.


1 Like

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