Сделал компонент <Img/> для блог-постов

This commit is contained in:
Иван Кузьменко 2025-09-29 02:45:41 +03:00
parent 86dff5272e
commit 13c341d4ff
4 changed files with 23 additions and 1 deletions

View file

@ -6,4 +6,6 @@ description: 'Немного о самом сайте'
# ПРИВЕТ !
Добро пожаловать на наш первый блог-пост!
Добро пожаловать на наш первый блог-пост!
<Img src="wasd_perelesoq_game_jam_2025.png" />

View file

@ -0,0 +1,20 @@
<script lang="ts">
import { page } from '$app/state';
import { resolveBlogPath } from '$lib/util/Blogs';
export let src: string;
export let caption: string;
export let alt: string = '';
</script>
<div class="text-center">
<img
class="mx-auto mb-0 flex justify-center rounded-lg"
class:caption-img={caption}
src={resolveBlogPath(page.params.slug, src)}
alt={alt ? alt : src}
/>
{#if caption}
<p style="margin-top: 0px;">{caption}</p>
{/if}
</div>

View file

Before

Width:  |  Height:  |  Size: 449 KiB

After

Width:  |  Height:  |  Size: 449 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB