From a6bd281946695fdaead91743ad5ab1dcef0d2d0e Mon Sep 17 00:00:00 2001 From: Nathan Upchurch Date: Sat, 13 Apr 2024 21:49:30 -0500 Subject: [PATCH] Add the latest /now entry to index page --- content/index.njk | 17 +++++++++++++++++ public/css/index.css | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/content/index.njk b/content/index.njk index f1dea53..1ce3546 100644 --- a/content/index.njk +++ b/content/index.njk @@ -4,11 +4,28 @@ eleventyNavigation: key: Home order: 1 numberOfLatestPostsToShow: 5 +numberOfNowPostsToShow: 1 --- +
+

What I've been up to:

+{% 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" %} + + + +
+ {% 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 %} diff --git a/public/css/index.css b/public/css/index.css index f9fa013..7742f9b 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -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;