Website/themes/mainroad/layouts/partials/widgets/recent.html

13 lines
572 B
HTML
Raw Permalink Normal View History

2018-07-11 20:45:17 +02:00
{{- if .Site.Params.widgets.recent_articles }}
<div class="widget-recent widget">
<h4 class="widget__title">{{ T "recent_title" }}</h4>
<div class="widget__content">
<ul class="widget__list">
{{- $recent_articles_num := (.Site.Params.widgets.recent_articles_num | default 10) }}
{{- range first $recent_articles_num (where .Site.RegularPages "Section" "in" (.Site.Params.postSections | default (slice "post"))) }}
<li class="widget__item"><a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end }}
</ul>
</div>
</div>
{{- end }}