(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/**/*.jpg
public/**/*.png public/**/*.png
public/**/*.webp public/**/*.webp
src/**/*.jpg
src/**/*.png
src/**/*.webp
# obsidian # obsidian
.obsidian/ .obsidian/

View file

@ -30,6 +30,9 @@ export default defineConfig({
theme: 'min-light' theme: 'min-light'
} }
}, },
experimental: {
assets: true,
},
integrations: [ integrations: [
mdx(), mdx(),
solid(), 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."; const alt = "A building covered by multicolor Ivy.";
--- ---
<section class="p-card p-card-image"> <section class="p-card p-card-image">
<h2 class="p-card__header">Image of the Month</h2> <h2 class="p-card__header">Image of the Month</h2>
<a href={image}> <a href={image.src}>
<img class="p-card-image__image" src={image} alt={alt}> <Image src={image} alt={alt} class="p-card-image__image" />
</a> </a>
</section> </section>

2
src/env.d.ts vendored
View file

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

View file

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