summaryrefslogtreecommitdiff
path: root/themes/new_theme/layouts/partials/widgets/recent.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/new_theme/layouts/partials/widgets/recent.html')
-rw-r--r--themes/new_theme/layouts/partials/widgets/recent.html9
1 files changed, 6 insertions, 3 deletions
diff --git a/themes/new_theme/layouts/partials/widgets/recent.html b/themes/new_theme/layouts/partials/widgets/recent.html
index 6aaee19..c264062 100644
--- a/themes/new_theme/layouts/partials/widgets/recent.html
+++ b/themes/new_theme/layouts/partials/widgets/recent.html
@@ -1,9 +1,12 @@
-{{- if .Site.Params.widgets.recent_articles }}
+{{- $recent := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
+{{- $recent_num := (.Site.Params.widgets.recent_num | default 10) }}
+
+{{- if $recent }}
<div class="widget-recent widget">
- <h4 class="widget__title">Recent Posts</h4>
+ <h4 class="widget__title">{{ T "recent_title" }}</h4>
<div class="widget__content">
<ul class="widget__list">
- {{- range first 10 (where .Site.Pages "Section" "blog") }}
+ {{- range first $recent_num $recent }}
<li class="widget__item"><a class="widget__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end }}
</ul>