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:14:05 -05:00
|
|
|
{{ if site.Params.randomRelated | default false }}
|
|
|
|
{{ $postsList = shuffle $postsList }}
|
|
|
|
{{ end }}
|
2021-04-15 00:46:53 -05:00
|
|
|
<div class="relatedArticlesContainer">
|
|
|
|
<hr />
|
|
|
|
<h2>More posts like this</h2>
|
2021-04-15 03:04:06 -05:00
|
|
|
<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 00:46:53 -05:00
|
|
|
</div>
|
|
|
|
{{ end }}
|