Сделал компонент <Img/> для блог-постов
This commit is contained in:
parent
4b89b99418
commit
c0f216ceb2
4 changed files with 23 additions and 1 deletions
|
|
@ -7,3 +7,5 @@ description: 'Немного о самом сайте'
|
||||||
# ПРИВЕТ !
|
# ПРИВЕТ !
|
||||||
|
|
||||||
Добро пожаловать на наш первый блог-пост!
|
Добро пожаловать на наш первый блог-пост!
|
||||||
|
|
||||||
|
<Img src="wasd_perelesoq_game_jam_2025.png" />
|
||||||
|
|
|
||||||
20
src/lib/components/Img.svelte
Normal file
20
src/lib/components/Img.svelte
Normal 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>
|
||||||
|
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 449 KiB |
BIN
static/blog/test_unpublished/wasd_perelesoq_game_jam_2025.png
Normal file
BIN
static/blog/test_unpublished/wasd_perelesoq_game_jam_2025.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 449 KiB |
Loading…
Add table
Add a link
Reference in a new issue