From a540c0f1a56a58550dc914486d69ac89b5590f43 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Thu, 14 Mar 2024 07:34:33 +0000 Subject: [PATCH] Couple of li'l adjustments to styles, and formatting of excerpts --- config/filters/excerpt.js | 8 ++++++-- src/_includes/base.njk | 7 ++----- src/css/exceptions/rss.css | 15 ++++----------- src/saved-links.njk | 4 +++- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/config/filters/excerpt.js b/config/filters/excerpt.js index d4b5c66..bdf39de 100644 --- a/config/filters/excerpt.js +++ b/config/filters/excerpt.js @@ -1,6 +1,10 @@ module.exports = function (eleventyConfig) { eleventyConfig.addFilter('excerpt', (content, limit = 250) => { - const excerpt = content.replace(/(<([^>]+)>)/gi, "").slice(0, limit) + " […]"; - return excerpt; + const withoutTags = content.replace(/(<([^>]+)>)/gi, ""); + + if (withoutTags.length > limit) { + return withoutTags.slice(0, limit) + " […]"; + } + return withoutTags; }); } \ No newline at end of file diff --git a/src/_includes/base.njk b/src/_includes/base.njk index e35bdb2..4b0d9df 100644 --- a/src/_includes/base.njk +++ b/src/_includes/base.njk @@ -51,11 +51,8 @@ - - - - - + +
diff --git a/src/css/exceptions/rss.css b/src/css/exceptions/rss.css index 38e7482..2067052 100644 --- a/src/css/exceptions/rss.css +++ b/src/css/exceptions/rss.css @@ -1,17 +1,10 @@ .rss { flex-grow: initial; - - img, svg { - width: 20px; - aspect-ratio: 1; - height: auto; - vertical-align: middle; - } + font-size: var(--text-size-s); + padding: 0 var(--space-size-2xs); &:hover { - svg { - background-color: var(--color-primary); - color: var(--color-secondary); - } + background-color: var(--color-primary); + color: var(--color-secondary); } } diff --git a/src/saved-links.njk b/src/saved-links.njk index e20ec6e..b8cb240 100644 --- a/src/saved-links.njk +++ b/src/saved-links.njk @@ -2,6 +2,7 @@ title: Saved links layout: base.njk --- +

{{ title }}

@@ -18,4 +19,5 @@ layout: base.njk {% endfor %} - \ No newline at end of file + +

\ No newline at end of file