Site.RegularPages.Related not showing any content?

I made a change to incorporate related pages:

And it’s not showing any content? What am I missing please?

Do I need to use taxonomies first?

Taxonomies (tags) is a one way to add relations between posts in other cases, Hugo doesn’t know how articles relate to each other as they do not index page content, so it cannot automatically build relations on that.

You can use values like authors or lists like tags, keywords.

Have a look:

I think it helps to look at the default configuration

And remember that name´ here maps to front matter keys. So if. you have a site where you e.g. use keywordsin front matter, thensite.RegularPages.Related` should return something.

I’ve never seen anyone using keywords in the front matter.

Is there some priority of what order you should be using metadata?

For example I only use title, date, and description atm.

Just to keep things simple, does it make sense to use just tags next?

You see I am just trying to work out the least effort to get my other content upto scratch since I have almost 1000 pages!

Yes, that makes sense. title and description isn’t very good for indexing with the Related feature (at least not the way we do it currently).

A trick here may be to apply some defaults tags (or keywords or whatever) via cascade (per section?), and then override over time.

“Cascade” sounds interesting.

In my tips I already have things grouped in folders dabase.com/content/tips at master · kaihendry/dabase.com · GitHub

Could these folder names form a good candidate for a cascading tag or am I better off mapping to categories or something like that?

Hmm … They look very coarse grained, so then you would probably be better off just showing a list of some other pages in the same category.

I think the value of Related to list “See Also” sections currently requires some custom keywords/tagging to be of real value. But you can take that little by little.

Ok so you are saying there is too few posts in my folder hierarchy and I’m better off using tags?

I think that’s what you’re saying. Ok, I think I’ll start adding tags to my post front matter.

No, I’m saying that your index … cardinality would be two low. “Everything” in a folder would be related, which isn’t great if you write about something specific e.g. Tigres in Honduras, it would be great if other articles about tigres popped up, and especially those about Honduras.

On a slightly related topic, the next Hugo (about a week from now) will allow indexing of document fragments (anchor IDs). I have added this primarily to do enable automatic deep linking between reference docs and guides/explanation pages in the refreshed Hugo Docs. But this may also possibly be generally useful.

Ah, so my headlines or page outline will automatically become input to Related Content?

That’s a great idea!

I’ve always thought the outline of a page should be emphasised and by right indexed.

https://gsnedders.html5.org/outliner/

For starters it will be the heading IDs (e.g. foo-bar) that will be indexed. The prime use case is to be able to insert a shortcode below a heading about “some topic” that says “You may also want to read about this here” and having a automatic reverse link to the particular heading on a given page.

That said, the Related Content is currently incredibly stupid when it comes to comparing textual content, but we’ll eventually get there.

2 Likes