2024-09-11 17:34:56 -04:00
|
|
|
---js
|
|
|
|
const eleventyNavigation = {
|
|
|
|
key: "Home",
|
|
|
|
order: 1
|
|
|
|
};
|
|
|
|
|
|
|
|
const numberOfLatestPostsToShow = 3;
|
2023-01-23 11:02:06 -05:00
|
|
|
---
|
|
|
|
{% set postsCount = collections.posts | length %}
|
2023-01-30 18:11:37 -05:00
|
|
|
{% set latestPostsCount = postsCount | min(numberOfLatestPostsToShow) %}
|
2023-01-23 11:02:06 -05:00
|
|
|
<h1>Latest {{ latestPostsCount }} Post{% if latestPostsCount != 1 %}s{% endif %}</h1>
|
|
|
|
|
2023-01-30 18:11:37 -05:00
|
|
|
{% set postslist = collections.posts | head(-1 * numberOfLatestPostsToShow) %}
|
2023-01-23 11:02:06 -05:00
|
|
|
{% set postslistCounter = postsCount %}
|
|
|
|
{% include "postslist.njk" %}
|
|
|
|
|
2023-01-30 18:11:37 -05:00
|
|
|
{% set morePosts = postsCount - numberOfLatestPostsToShow %}
|
|
|
|
{% if morePosts > 0 %}
|
2024-02-12 10:19:30 -05:00
|
|
|
<p>{{ morePosts }} more post{% if morePosts != 1 %}s{% endif %} can be found in <a href="blog.njk">the archive</a>.</p>
|
2023-01-23 11:02:06 -05:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{# List every content page in the project #}
|
|
|
|
{#
|
|
|
|
<ul>
|
2023-01-23 12:37:44 -05:00
|
|
|
{%- for entry in collections.all %}
|
|
|
|
<li><a href="{{ entry.url }}"><code>{{ entry.url }}</code></a></li>
|
|
|
|
{%- endfor %}
|
2023-01-23 11:02:06 -05:00
|
|
|
</ul>
|
|
|
|
#}
|