<!-- Reusable template for related posts (at the end of posts single pages) -->
{{ if .Param "related" }}
  {{ $related := .Site.RegularPages.Related . | first 5 }}
  {{ with $related }}
    <section class="related">
      <h2>See Also</h2>
      <ul class="related-posts">
        {{ range . }}
          <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
        {{ end }}
      </ul>
    </section>
  {{ end }}
{{ end }}