Add the latest /now entry to index page

This commit is contained in:
Nathan Upchurch 2024-04-13 21:49:30 -05:00
parent 049ba826dc
commit a6bd281946
2 changed files with 22 additions and 0 deletions

View File

@ -4,11 +4,28 @@ eleventyNavigation:
key: Home
order: 1
numberOfLatestPostsToShow: 5
numberOfNowPostsToShow: 1
---
<div class="now">
<h2>What I've been up to:</h2>
{% set postsCount = collections.now | length %}
{% set latestPostsCount = postsCount | min(numberOfNowPostsToShow) %}
{% set postslist = collections.now | head(-1 * numberOfNowPostsToShow) %}
{% set postslistCounter = postsCount %}
{% set showPostListHeader = false %}
{% include "postslist.njk" %}
<a class="link-button" href="/now/">
<button type="button">
See more on the “now” page
</button>
</a>
</div>
{% set postsCount = collections.posts | length %}
{% set latestPostsCount = postsCount | min(numberOfLatestPostsToShow) %}
{% set postslist = collections.posts | head(-1 * numberOfLatestPostsToShow) %}
{% set postslistCounter = postsCount %}
{% set showPostListHeader = true %}
{% include "postslist.njk" %}
{% set morePosts = postsCount - numberOfLatestPostsToShow %}

View File

@ -200,6 +200,11 @@ header, footer, main {
nav {
grid-column: 2 / span 12;
}
.now {
display: grid;
grid-column: 1 / span 12;
padding-bottom: var(--space-xl);
}
section {
display: grid;
grid-column: 1 / span 12;