diff --git a/package.json b/package.json index 5b3822d..4222fa3 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "subfont": "subfont -ir --no-fallbacks --silent --root dist" }, "devDependencies": { - "@astrojs/image": "^0.10.0", - "@astrojs/mdx": "^0.11.5", + "@astrojs/image": "^0.11.6", + "@astrojs/mdx": "^0.11.6", "@astrojs/partytown": "^1.0.1", "@astrojs/rss": "^1.0.3", "@astrojs/sitemap": "^1.0.0", @@ -24,22 +24,22 @@ "@astrolib/seo": "^0.2.1", "@fontsource/inter": "^4.5.14", "@tailwindcss/typography": "^0.5.8", - "@typescript-eslint/eslint-plugin": "^5.42.1", - "@typescript-eslint/parser": "^5.42.1", - "astro": "^1.6.8", + "@typescript-eslint/eslint-plugin": "^5.44.0", + "@typescript-eslint/parser": "^5.44.0", + "astro": "^1.6.10", "astro-icon": "^0.8.0", - "eslint": "^8.27.0", + "eslint": "^8.28.0", "eslint-plugin-astro": "^0.21.0", "eslint-plugin-jsx-a11y": "^6.6.1", - "limax": "^v2.1.0", + "limax": "^2.1.0", "mdast-util-to-string": "^3.1.0", - "prettier": "^2.7.1", + "prettier": "^2.8.0", "prettier-plugin-astro": "^0.7.0", "reading-time": "^1.5.0", "sharp": "^0.31.2", "subfont": "^6.12.2", - "tailwindcss": "^3.2.3", - "typescript": "^4.8.4" + "tailwindcss": "^3.2.4", + "typescript": "^4.9.3" }, "engines": { "node": "^14.15.0 || >=16.0.0" diff --git a/src/components/blog/GridItem.astro b/src/components/blog/GridItem.astro index d9be43a..a88f104 100644 --- a/src/components/blog/GridItem.astro +++ b/src/components/blog/GridItem.astro @@ -1,5 +1,5 @@ --- -import Picture from '~/components/core/Picture.astro'; +import { Picture } from '@astrojs/image/components' import { findImage } from '~/utils/images'; import { getPermalink } from '~/utils/permalinks'; @@ -11,14 +11,18 @@ const image = await findImage(post.image);

) diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro index 6576b1e..b0d682c 100644 --- a/src/components/blog/SinglePost.astro +++ b/src/components/blog/SinglePost.astro @@ -1,5 +1,5 @@ --- -import Picture from '~/components/core/Picture.astro'; +import { Picture } from '@astrojs/image/components' import PostTags from '~/components/atoms/Tags.astro'; import SocialShare from '~/components/atoms/SocialShare.astro'; diff --git a/src/components/core/Picture.astro b/src/components/core/Picture.astro deleted file mode 100644 index d4efe61..0000000 --- a/src/components/core/Picture.astro +++ /dev/null @@ -1,43 +0,0 @@ ---- -import { getPicture } from '@astrojs/image'; - -const { - src, - alt, - sizes, - widths, - aspectRatio = 1, - formats = ['avif', 'webp'], - loading = 'lazy', - decoding = 'async', - class: className = '', - ...attrs -} = Astro.props; - -let picture = null; -try { - picture = - src && - (await getPicture({ - src, - widths, - formats, - aspectRatio, - })); -} catch (e) { - // continue regardless of error -} - -const { image = {}, sources = [] } = picture || {}; ---- - -{ - src && image?.src && ( - - {sources.map((attrs) => ( - - ))} - - - ) -} diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index a2c38a1..081a73d 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -1,6 +1,6 @@ --- import { Icon } from 'astro-icon'; -import Picture from '~/components/core/Picture.astro'; +import { Picture } from '@astrojs/image/components' ---
diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro index 87132bb..9493f64 100644 --- a/src/components/widgets/Steps.astro +++ b/src/components/widgets/Steps.astro @@ -1,6 +1,6 @@ --- import { Icon } from 'astro-icon'; -import Picture from '~/components/core/Picture.astro'; +import { Picture } from '@astrojs/image/components' ---