2021-04-15 00:46:53 -05:00
|
|
|
{{ if and (.Site.Params.enableRelatedArticles | default false) .Params.tags }}
|
2021-04-15 03:04:06 -05:00
|
|
|
{{ $postsList :=
|
|
|
|
where (
|
2021-04-15 03:07:42 -05:00
|
|
|
where (
|
|
|
|
where site.RegularPages "Params.tags" "!=" nil
|
|
|
|
) "Params.tags" "intersect" .Params.tags
|
|
|
|
) "Permalink" "ne" .Permalink
|
2021-04-15 03:04:06 -05:00
|
|
|
}}
|
2021-04-15 03:24:50 -05:00
|
|
|
{{ if $postsList }}
|
|
|
|
{{ if site.Params.randomRelated | default false }}
|
|
|
|
{{ $postsList = shuffle $postsList }}
|
|
|
|
{{ end }}
|
|
|
|
<div class="relatedArticlesContainer">
|
|
|
|
<hr />
|
|
|
|
<h2>More posts like this</h2>
|
|
|
|
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}">
|
|
|
|
{{ range first (.Site.Params.relatedArticlesNum | default 2) $postsList }}
|
|
|
|
{{- partial "article_card.html" . -}}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
2021-04-15 03:04:06 -05:00
|
|
|
</div>
|
2021-04-15 03:24:50 -05:00
|
|
|
{{ end }}
|
2021-04-15 00:46:53 -05:00
|
|
|
{{ end }}
|