File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed
Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,26 @@ const props = defineProps<{
99const 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" >
Original file line number Diff line number Diff line change 22title : " Khinkali"
33date : 2025-10-30
44description : " The story behind the khinkali icon for Testo IDE plugin."
5+ image : /blog/khinkali/img-0.jpg
56author : Aleksei Gagarin
67---
78
Original file line number Diff line number Diff line change 22title : " Хинкали"
33date : 2025-10-30
44description : " История создания иконки хинкали для IDE-плагина Testo."
5+ image : /blog/khinkali/img-0.jpg
56author : Алексей Гагарин
67---
78
You can’t perform that action at this time.
0 commit comments