diff --git a/package.json b/package.json
index 14c0dcc..140a0a1 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "astroplate",
- "version": "3.0.1",
+ "version": "3.1.0",
"description": "Astro and Tailwindcss boilerplate",
"author": "zeon.studio",
"license": "MIT",
@@ -14,12 +14,12 @@
"remove-darkmode": "node scripts/removeDarkmode.js && yarn format"
},
"dependencies": {
- "@astrojs/mdx": "^2.0.1",
- "@astrojs/react": "^3.0.7",
+ "@astrojs/mdx": "^2.0.2",
+ "@astrojs/react": "^3.0.8",
"@astrojs/rss": "^4.0.1",
"@astrojs/sitemap": "^3.0.3",
- "@astrojs/tailwind": "^5.0.3",
- "astro": "^4.0.6",
+ "@astrojs/tailwind": "^5.0.4",
+ "astro": "^4.0.7",
"astro-auto-import": "^0.4.2",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
@@ -53,7 +53,7 @@
"prettier-plugin-astro": "^0.12.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"sass": "^1.69.5",
- "tailwindcss": "^3.3.7",
+ "tailwindcss": "^3.4.0",
"tailwind-bootstrap-grid": "^5.1.0",
"typescript": "5.3.3"
}
diff --git a/src/layouts/PostSingle.astro b/src/layouts/PostSingle.astro
index 79b4cb4..939c053 100755
--- a/src/layouts/PostSingle.astro
+++ b/src/layouts/PostSingle.astro
@@ -6,12 +6,12 @@ import { getSinglePage } from "@/lib/contentParser.astro";
import dateFormat from "@/lib/utils/dateFormat";
import similarItems from "@/lib/utils/similarItems";
import { humanize, markdownify, slugify } from "@/lib/utils/textConverter";
-import { Image } from "astro:assets";
import {
FaRegClock,
FaRegFolder,
FaRegUserCircle,
} from "react-icons/fa/index.js";
+import ImageMod from "./components/ImageMod.astro";
const COLLECTION_FOLDER = "blog";
const { post } = Astro.props;
@@ -29,7 +29,7 @@ const { title, description, author, categories, image, date, tags } = post.data;
{
image && (
-
{
image && (
-
{
image && (
- }
+ alt={alt}
+ width={width}
+ height={height}
+ loading={loading}
+ decoding={decoding}
+ class={className}
+ format={format}
+ style={style}
+ />
+ )
+}
diff --git a/src/layouts/components/Logo.astro b/src/layouts/components/Logo.astro
index 1e6c94a..8b7ba5c 100644
--- a/src/layouts/components/Logo.astro
+++ b/src/layouts/components/Logo.astro
@@ -1,6 +1,6 @@
---
import config from "@/config/config.json";
-import { Image } from "astro:assets";
+import ImageMod from "./ImageMod.astro";
const { src, srcDarkmode }: { src?: string; srcDarkmode?: string } =
Astro.props;
@@ -27,7 +27,7 @@ const { theme_switcher }: { theme_switcher: boolean } = config.settings;
{
src || srcDarkmode || logo || logo_darkmode ? (
<>
-
{theme_switcher && (
-
-
-
{
+ src = `/public${src}`;
+ const images = import.meta.glob("/public/images/**/*.{jpeg,jpg,png,gif}");
+
+ // Check if the source path is valid
+ if (!src || !images[src]) {
+ console.error(
+ `\x1b[31mImage not found - ${src}.\x1b[0m Make sure the image is in the /public/images folder.`,
+ );
+
+ return ""; // Return an empty string if the image is not found
+ }
+
+ // Function to get the image info like width, height, format, etc.
+ const getImagePath = async (image: string) => {
+ try {
+ const imageData = (await images[image]()) as any;
+ return imageData;
+ } catch (error) {
+ return `Image not found - ${src}. Make sure the image is in the /public/images folder.`;
+ }
+ };
+
+ // Get the image data for the specified source path
+ const image = await getImagePath(src);
+
+ // Optimize the image for development
+ const ImageMod = await getImage({
+ src: image.default,
+ format: format,
+ });
+
+ return ImageMod.src;
+};
+
+export default bgImageMod;
diff --git a/src/pages/about.astro b/src/pages/about.astro
index ea26d87..064384d 100644
--- a/src/pages/about.astro
+++ b/src/pages/about.astro
@@ -1,7 +1,7 @@
---
+import ImageMod from "@/components/ImageMod.astro";
import Base from "@/layouts/Base.astro";
import { markdownify } from "@/lib/utils/textConverter";
-import { Image } from "astro:assets";
import { getEntry } from "astro:content";
const about = await getEntry("about", "-index");
@@ -21,7 +21,7 @@ const { title, description, meta_title, image } = about.data;
{
image && (
-
{
image && (
-
-
-