From 7419ba488017ca22fe3a90831467544c14a6bb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20H=C3=B6rtenhuber?= Date: Fri, 15 Mar 2024 22:12:56 +0000 Subject: [PATCH] remove filter and handle images as first paragraph --- astro.config.mjs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 9e948202..b27893cd 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -30,18 +30,13 @@ export default defineConfig({ } else { // return the first paragraph otherwise - // get the index of the first paragraph - const firstParagraphIndex = parent?.children.findIndex((child) => child.type === "paragraph"); + // get the index of the first paragraph and check that it doesn't start with an image + const firstParagraphIndex = parent?.children.findIndex((child) => child.type === "paragraph" && !child.children[0].value?.startsWith(' { - if (!path.startsWith("/src/content/blog")) { - return false; // Return falsey value to skip - } - return options; - }, }, ], ],