From c8c98c7ef91e4238cd08a6a711de3af5e864afd9 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Sat, 30 Dec 2023 16:36:45 +0000 Subject: [PATCH] Fix tags in posts, and image sizing --- config/filters/filterBy.js | 6 ++++++ src/_includes/post.njk | 5 +++-- src/css/reset.css | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/filters/filterBy.js b/config/filters/filterBy.js index 348f9ae..7ea3c0d 100644 --- a/config/filters/filterBy.js +++ b/config/filters/filterBy.js @@ -4,4 +4,10 @@ module.exports = (eleventyConfig) => { return item.data.tags.includes(value); }) }); + + eleventyConfig.addFilter('except', (collection, value) => { + return collection.filter((item) => { + return item !== value; + }) + }); } \ No newline at end of file diff --git a/src/_includes/post.njk b/src/_includes/post.njk index 2268e83..2778125 100644 --- a/src/_includes/post.njk +++ b/src/_includes/post.njk @@ -9,11 +9,12 @@ includePrism: true
{{ content | safe }}
- {% if tags | length %} + {% set filteredTags = tags | except("posts") %} + {% if filteredTags | length %}

Tags:

diff --git a/src/css/reset.css b/src/css/reset.css index 906bd83..662a85b 100644 --- a/src/css/reset.css +++ b/src/css/reset.css @@ -52,6 +52,7 @@ img, picture { max-width: 100%; display: block; + height: auto; } /* Inherit fonts for inputs and buttons */