From 49231c7be32e5a8707e0acecf9f6affe9bca562d Mon Sep 17 00:00:00 2001 From: Al Murad Uzzaman Date: Sat, 14 Mar 2026 09:11:36 +0600 Subject: [PATCH] chore: updated imageMod and font settings --- astro.config.mjs | 4 +++- package.json | 10 +++++----- readme.md | 6 +++--- src/layouts/components/ImageMod.astro | 19 +++++++++++++++++-- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 00af0ef..f34f6ae 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -23,7 +23,9 @@ function parseFontString(fontStr) { } } - return { name, weights }; + // remove + from font name and add space + const cleanName = name.replace(/\+/g, " "); + return { name: cleanName, weights }; } // Build fonts configuration from theme.json diff --git a/package.json b/package.json index 200b2d4..4f47516 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "astroplate", - "version": "6.0.1", + "version": "6.0.2", "description": "Astro and Tailwindcss boilerplate", "author": "zeon.studio", "license": "MIT", @@ -24,7 +24,7 @@ "@astrojs/sitemap": "3.7.1", "@digi4care/astro-google-tagmanager": "^1.6.0", "@justinribeiro/lite-youtube": "^1.9.0", - "astro": "6.0.2", + "astro": "6.0.4", "astro-auto-import": "^0.5.1", "astro-swiper": "^2.2.1", "date-fns": "^4.1.0", @@ -39,13 +39,13 @@ "remark-collapse": "^0.1.2", "remark-toc": "^9.0.0", "sharp": "^0.34.5", - "vite": "^7.3.1" + "vite": "^8.0.0" }, "devDependencies": { "@tailwindcss/forms": "^0.5.11", "@tailwindcss/typography": "^0.5.19", "@tailwindcss/vite": "^4.2.1", - "@types/node": "25.4.0", + "@types/node": "25.5.0", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "concurrently": "^9.2.1", @@ -56,6 +56,6 @@ "tailwind-bootstrap-grid": "^7.0.0", "tailwindcss": "^4.2.1", "typescript": "^5.9.3", - "wrangler": "^4.72.0" + "wrangler": "^4.73.0" } } diff --git a/readme.md b/readme.md index f60d1d6..a0bbeb0 100755 --- a/readme.md +++ b/readme.md @@ -12,8 +12,8 @@

- - Astro Version 6.0.2 + + Astro Version 6.0.4 @@ -70,7 +70,7 @@ ### 📦 Dependencies -- astro v6.0.2 +- astro v6.0.4 - node v22.12.0+ (see `.nvmrc`) - yarn v1.22+ - tailwind v4+ diff --git a/src/layouts/components/ImageMod.astro b/src/layouts/components/ImageMod.astro index 4087c38..a2d4ca9 100644 --- a/src/layouts/components/ImageMod.astro +++ b/src/layouts/components/ImageMod.astro @@ -11,12 +11,24 @@ interface Props { loading?: "eager" | "lazy" | null | undefined; decoding?: "async" | "auto" | "sync" | null | undefined; format?: "auto" | "avif" | "jpeg" | "png" | "svg" | "webp"; + fit?: "cover" | "contain" | "fill" | "none" | "scale-down"; class?: string; style?: any; } // Destructuring Astro.props to get the component's props -let { src, alt, width, height, loading, decoding, class: className, format, style } = Astro.props; +let { + src, + alt, + width, + height, + loading, + decoding, + class: className, + format, + style, + fit, +} = Astro.props; src = `/public${src}`; @@ -28,7 +40,9 @@ const isValidPath = images[src] ? true : false; // Log a warning message in red if the image is not found !isValidPath && - console.error(`\x1b[31mImage not found - ${src}.\x1b[0m Make sure the image is in the /public/images folder.`); + console.error( + `\x1b[31mImage not found - ${src}.\x1b[0m Make sure the image is in the /public/images folder.`, + ); --- { @@ -39,6 +53,7 @@ const isValidPath = images[src] ? true : false; width={width} height={height} loading={loading} + fit={fit ? fit : "contain"} decoding={decoding} class={className} format={format}