mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
17 lines
696 B
HTML
17 lines
696 B
HTML
{{ $related_posts := slice -}}
|
|
{{ range .Params.related_posts -}}
|
|
{{ $related_posts = $related_posts | append ($.Site.GetPage (printf "/post/%s" .)) -}}
|
|
{{ end -}}
|
|
{{ $related := $related_posts | append (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | uniq | first 5 }}
|
|
{{ with $related }}
|
|
<aside class="related-content--wrapper">
|
|
<h2 class="section-title">{{ T "article.relatedContent" }}</h2>
|
|
<div class="related-content">
|
|
<div class="flex article-list--tile">
|
|
{{ range . }}
|
|
{{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "articleList") }}
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
{{ end }} |