Add keywords (or other indexed fields) to front matter:
keywords:
- technologies
In the layout:
<section class="related">
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>Related pages</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
</section>
with skips the block when nothing related is found.
Settings
Default indices use keywords and dates. Customize in config.toml:
[related]
threshold = 80.0
includeNewer = false
toLower = false
[[related.indices]]
name = "keywords"
weight = 100.00
[[related.indices]]
name = "date"
weight = 10.00
includeNewer = true— older pages can pick up newer related content.threshold— 0–100; lower values show more, less relevant matches.toLower— lowercases keywords/queries to increase matches.weight— relative importance of each index.
You can add indices for tags, author, or any other front-matter field.
Andrew Dorokhov