diff options
author | tosi29 <tosi16@gmail.com> | 2019-05-25 17:06:36 +0300 |
---|---|---|
committer | tosi29 <tosi16@gmail.com> | 2019-05-25 17:06:36 +0300 |
commit | 693fc1078b50017530fe30833cef03fd4d91c736 (patch) | |
tree | 2450cbce6c2ccde71b073f4e724f987a1f174420 | |
parent | 3f8cdd0bc15eda89c091f1ec2cc205e5929d4cae (diff) |
Show related posts in 'post' type only.
-rw-r--r-- | layouts/partials/relatedposts.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/layouts/partials/relatedposts.html b/layouts/partials/relatedposts.html index 6abb6d4..06a7727 100644 --- a/layouts/partials/relatedposts.html +++ b/layouts/partials/relatedposts.html @@ -1,9 +1,11 @@ -{{ $related := .Site.RegularPages.Related . | first 7 }} -{{ with $related }} -<h4>{{ T "related_posts_title" }}</h4> -<ol style="margin-left: 30px; list-style-type: decimal;"> - {{ range . }} - <li><strong><a href="{{ .RelPermalink }}">{{ .Title }}</a></strong></li> +{{ if eq .Page.Type "post" }} + {{ $related := .Site.RegularPages.Related . | first 7 }} + {{ with $related }} + <h4>{{ T "related_posts_title" }}</h4> + <ol style="margin-left: 30px; list-style-type: decimal;"> + {{ range . }} + <li><strong><a href="{{ .RelPermalink }}">{{ .Title }}</a></strong></li> + {{ end }} + </ol> {{ end }} -</ol> {{ end }}
\ No newline at end of file |