summaryrefslogtreecommitdiff
path: root/layouts/partials/list/recent-posts.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/list/recent-posts.html')
-rw-r--r--layouts/partials/list/recent-posts.html19
1 files changed, 8 insertions, 11 deletions
diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html
index d774138..2404910 100644
--- a/layouts/partials/list/recent-posts.html
+++ b/layouts/partials/list/recent-posts.html
@@ -18,10 +18,7 @@ List of specified number of the most recent and published posts. Accepts a dict
</h2>
</header>
- {{- $recentPosts := where site.RegularPages "Date" "!=" nil }}
- {{- $recentPosts = where $recentPosts ".Date" "le" now }}
- {{- $recentPosts = first $count $recentPosts }}
-
+ {{- $recentPosts := where site.RegularPages "Params.excludeFromLists" "!=" true | first $count }}
{{- if $recentPosts }}
<div class="recent-posts__content">
<ul class="recent-posts__list" role="list">
@@ -33,16 +30,16 @@ List of specified number of the most recent and published posts. Accepts a dict
</ul>
{{- if $showViewAll }}
- <a href="{{ with site.GetPage "/posts" }}{{ .RelPermalink }}{{ else }}/posts/{{ end }}" class="recent-posts__view-all-link">
- {{ lang.Translate "posts.view_all" | default "View all posts" }}
+ {{- with site.GetPage "/all-posts"}}
+ <a href="{{ .RelPermalink }}" class="recent-posts__view-all-link">
+ {{ lang.Translate "posts.view_all" | default "View all posts" }} ยป
</a>
+ {{- end }}
{{- end }}
</div>
{{ else }}
- <div class="recent-posts__empty">
- <p class="recent-posts__empty-message">
- {{ lang.Translate "list.empty" | default "No posts in this section." }}
- </p>
- </div>
+ <p class="recent-posts__empty-message">
+ {{ lang.Translate "list.empty" | default "No posts in this section." }}
+ </p>
{{- end }}
</section>