Skip to content

Commit 005ae29

Browse files
committed
Add preview image for the "khinkali" article
1 parent 6337f40 commit 005ae29

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.vitepress/theme/BlogPosts.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,26 @@ const props = defineProps<{
99
const filteredPosts = computed(() => {
1010
return posts.filter((post) => post.url.startsWith(props.folder))
1111
})
12+
13+
function onImageError(event: Event, fallback: string | undefined) {
14+
const img = event.target as HTMLImageElement
15+
if (fallback && img.src !== fallback) {
16+
img.src = fallback
17+
}
18+
}
1219
</script>
1320

1421
<template>
1522
<div class="blog-posts">
1623
<article v-for="post in filteredPosts" :key="post.url" class="post-card">
1724
<a :href="post.url" class="post-image-link">
18-
<img v-if="post.thumb || post.image" :src="post.thumb || post.image" :alt="post.title" class="post-image" />
25+
<img
26+
v-if="post.thumb || post.image"
27+
:src="post.thumb || post.image"
28+
:alt="post.title"
29+
class="post-image"
30+
@error="onImageError($event, post.image)"
31+
/>
1932
</a>
2033
<div class="post-content">
2134
<div class="post-title">

blog/khinkali.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "Khinkali"
33
date: 2025-10-30
44
description: "The story behind the khinkali icon for Testo IDE plugin."
5+
image: /blog/khinkali/img-0.jpg
56
author: Aleksei Gagarin
67
---
78

public/blog/khinkali/img-0.jpg

75.4 KB
Loading

ru/blog/khinkali.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "Хинкали"
33
date: 2025-10-30
44
description: "История создания иконки хинкали для IDE-плагина Testo."
5+
image: /blog/khinkali/img-0.jpg
56
author: Алексей Гагарин
67
---
78

0 commit comments

Comments
 (0)