2020-02-19 01:29:45 +00:00
|
|
|
{{ if ($.Param "enableSidebarPostsByOrder" | default false) }}
|
|
|
|
{{ $filteredSections := .Site.Pages }}
|
|
|
|
{{ range $.Param "notAllowedTypesInHomeSidebar" }}
|
|
|
|
{{ $filteredSections = (where $filteredSections "Type" "!=" (lower .)) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2020-02-19 12:09:41 +00:00
|
|
|
{{ $hasOrder := false }}
|
|
|
|
{{ range first ($.Param "itemsPerCategory") ($filteredSections.ByParam "order") }}
|
|
|
|
{{ if .Params.order }}
|
|
|
|
{{ $hasOrder = true }}
|
2020-02-19 01:29:45 +00:00
|
|
|
{{ end }}
|
2020-02-19 12:09:41 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if $hasOrder }}
|
|
|
|
<div class="sidebar-recent__title p2">{{ i18n "posts-by-order" | default "TOP POSTS" }}</div>
|
|
|
|
<ul class="sidebar-recent__ul">
|
|
|
|
{{ range first ($.Param "itemsPerCategory") ($filteredSections.ByParam "order") }}
|
|
|
|
{{ if .Params.order }}
|
|
|
|
<li>
|
|
|
|
<a href="{{ .RelPermalink }}" class="sidebar-recent__a p2">{{ .Title }}</a>
|
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
<hr class="hr-fade sidebar-hr" />
|
|
|
|
{{ end }}
|
2020-02-19 01:29:45 +00:00
|
|
|
{{ end }}
|