30 lines
843 B
Text
30 lines
843 B
Text
---js
|
|
const eleventyNavigation = {
|
|
key: "home",
|
|
order: 1
|
|
};
|
|
|
|
const numberOfLatestPostsToShow = 3;
|
|
---
|
|
{% set postsCount = collections.posts | length %}
|
|
{% set latestPostsCount = postsCount | min(numberOfLatestPostsToShow) %}
|
|
<h1>most recent posts</h1>
|
|
|
|
{% set postslist = collections.posts | head(-1 * numberOfLatestPostsToShow) %}
|
|
{% set postslistCounter = postsCount %}
|
|
{% include "postslist.njk" %}
|
|
|
|
{% set morePosts = postsCount - numberOfLatestPostsToShow %}
|
|
{% if morePosts > 0 %}
|
|
<p>{{ morePosts }} more post{% if morePosts != 1 %}s{% endif %} can be found in <a href="blog.njk">the archive</a>.</p>
|
|
{% endif %}
|
|
|
|
{# List every content page in the project #}
|
|
{#
|
|
<ul>
|
|
{%- for entry in collections.all %}
|
|
<li><a href="{{ entry.url }}"><code>{{ entry.url }}</code></a></li>
|
|
{%- endfor %}
|
|
</ul>
|
|
#}
|
|
<a href="/feed/feed.xml">rss feed</a>
|