feat: use astro's Image component

This commit is contained in:
Ayo Ayco 2025-01-08 14:36:23 +01:00
parent 7c4a4c979b
commit 6ae6be6e72
3 changed files with 8 additions and 3 deletions

View file

@ -1,4 +1,8 @@
import { defineConfig } from 'astro/config' import { defineConfig } from 'astro/config'
// https://astro.build/config // https://astro.build/config
export default defineConfig({}) export default defineConfig({
image: {
// domains: ['github-readme-stats.vercel.app'],
},
})

View file

@ -9,7 +9,7 @@ importers:
.: .:
dependencies: dependencies:
astro: astro:
specifier: ^5 specifier: '>=5.0.0'
version: 5.1.1(@types/node@22.10.2)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.2) version: 5.1.1(@types/node@22.10.2)(jiti@2.4.2)(rollup@4.29.1)(typescript@5.7.2)
devDependencies: devDependencies:
'@eslint/js': '@eslint/js':

View file

@ -1,4 +1,5 @@
--- ---
import {Image} from 'astro:assets'
export interface Props { export interface Props {
username: string username: string
topLanguages?: boolean topLanguages?: boolean
@ -25,4 +26,4 @@ if (topLanguages) {
alt = altText || alt alt = altText || alt
--- ---
<img src={url} alt={alt} /> <Image inferSize={true} src={url} alt={alt} />