diff --git a/content/index.njk b/content/index.njk index 103f210..c23cd54 100644 --- a/content/index.njk +++ b/content/index.njk @@ -3,17 +3,19 @@ layout: layouts/home.njk eleventyNavigation: key: Home order: 1 +numberOfLatestPostsToShow: 3 --- {% set postsCount = collections.posts | length %} -{% set latestPostsCount = postsCount | min(3) %} +{% set latestPostsCount = postsCount | min(numberOfLatestPostsToShow) %}
More posts can be found in the archive.
+{% set morePosts = postsCount - numberOfLatestPostsToShow %} +{% if morePosts > 0 %} +{{ morePosts }} more post{% if morePosts != 1 %}s{% endif %} can be found in the archive.
{% endif %} {# List every content page in the project #}