%%
date:: [[2022-12-31]]
%%
# [[How to display related posts in Hugo]]
You can have [[Hugo]] automatically include a section in your blog post at the very end that shows related blog posts by adding this code to your post template: [^hugo]
```html
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>See Also</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
```
In my case, I added it to `themes/cactus/layouts/blog/single.html`.
[^hugo]: Hugo. *Related content*. Retrieved from: https://gohugo.io/content-management/related/