Excluding pages from Related Content list

So I have a hugo site with quite a few pages that relate - so I use this feature to have a list of related pages at the bottom of our support pages. see https://gohugo.io/content-management/related/

However there are some pages that I’d rather were not included in the related list. However I have tried all the following without success:

  • Changed the .md to .html
  • removed various items in the header like ‘group’ and ‘tags’
  • I tried putting the content it’s own directory (away from the support pages)

Any ideas? Thanks.

Hugo Static Site Generator v0.53-8FC339DC2529FF77E494A1C12CD1FF9FBCB880A4 windows/amd64 BuildDate: 2018-12-24T08:26:16Z

You can configure related indexes in config.toml to use only specific front-matter parameters.
You might want to exclude the “date” index if you don’t want to relate pages according to it.

Furthermore, it is possible to manually exclude pages from the result of .Related with complement or to just filter them out with a parameter:

{{ $related := where site.RegularPages.Related "Section" "section-that-is-excluded-from-related" 
 | first 10 }}
1 Like