(home) optimize image

This commit is contained in:
Maciej Jur 2023-06-22 22:32:16 +02:00
parent 4c4eb9ed2a
commit a84b511402
5 changed files with 13 additions and 5 deletions

3
.gitignore vendored
View file

@ -24,6 +24,9 @@ pnpm-debug.log*
public/**/*.jpg
public/**/*.png
public/**/*.webp
src/**/*.jpg
src/**/*.png
src/**/*.webp
# obsidian
.obsidian/

View file

@ -30,6 +30,9 @@ export default defineConfig({
theme: 'min-light'
}
},
experimental: {
assets: true,
},
integrations: [
mdx(),
solid(),

View file

@ -1,10 +1,12 @@
---
const image = "/static/iotm/20221016-170316_1.jpg";
import image from "@assets/home/20221016-170316_1.jpg";
import Image from "astro/components/Image.astro";
const alt = "A building covered by multicolor Ivy.";
---
<section class="p-card p-card-image">
<h2 class="p-card__header">Image of the Month</h2>
<a href={image}>
<img class="p-card-image__image" src={image} alt={alt}>
<a href={image.src}>
<Image src={image} alt={alt} class="p-card-image__image" />
</a>
</section>

2
src/env.d.ts vendored
View file

@ -1,2 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
/// <reference types="astro/client-image" />

View file

@ -45,6 +45,6 @@
&__text {
text-indent: 1em;
line-height: 1.2em;
line-height: 1.4em;
}
}