Skip to content

Commit

Permalink
show related posts if present
Browse files Browse the repository at this point in the history
  • Loading branch information
mugli committed Dec 29, 2020
1 parent f3fe741 commit f677fba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions layouts/partials/related.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<hr />
<h2>See Also</h2>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
2 changes: 2 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ <h1 class="posttitle" itemprop="name headline">
</div>
</article>

{{ partial "related.html" . }}

{{ partial "comments.html" . }}

{{ partial "page_nav_mobile.html" . }}
Expand Down

0 comments on commit f677fba

Please sign in to comment.