Skip to content

Commit 8fd9984

Browse files
committed
chore: check operations order
1 parent 2673649 commit 8fd9984

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

app/components/OgImage/BlogPost.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ const getInitials = (name: string) =>
4646
const visibleAuthors = computed(() => {
4747
console.log('blog post 5')
4848
props.authors.map(author => {
49-
console.log(
50-
'blog post 5.1',
51-
author.avatar,
52-
author.name,
53-
typeof author.avatar,
54-
typeof author.name,
55-
)
49+
console.log('blog post 5', author.avatar, author.name, typeof author.avatar, typeof author.name)
5650
})
5751
if (props.authors.length <= 3) return props.authors
5852
return props.authors.slice(0, MAX_VISIBLE_AUTHORS)
@@ -125,7 +119,7 @@ const formattedAuthorNames = computed(() => {
125119
>
126120
<img
127121
v-if="author.avatar"
128-
:src="`/blog/avatar/${author.avatar.replace('/blog/avatar/', '')}`"
122+
:src="author.avatar"
129123
:alt="author.name"
130124
class="w-full h-full object-cover"
131125
/>

modules/blog.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ async function fetchBlueskyAvatars(
5353
const hash = crypto.createHash('sha256').update(profile.avatar).digest('hex')
5454
const dest = join(imagesDir, `${hash}.jpg`)
5555

56+
console.log('fetch bluesky avatars 1', dest)
5657
if (!existsSync(dest)) {
5758
const res = await fetch(profile.avatar)
59+
console.log('fetch bluesky avatars 2', profile.avatar)
5860
await writeFile(join(imagesDir, `${hash}.jpg`), res.body!)
61+
console.log('fetch bluesky avatars 3', join(imagesDir, `${hash}.jpg`))
5962
}
6063

64+
console.log('fetch bluesky avatars 4', `/blog/avatar/${hash}.jpg`)
6165
avatarMap.set(profile.handle, `/blog/avatar/${hash}.jpg`)
6266
}
6367
}
@@ -119,6 +123,7 @@ async function loadBlogPosts(blogDir: string, imagesDir: string): Promise<BlogPo
119123

120124
// Batch-fetch all Bluesky avatars in a single request
121125
const avatarMap = await fetchBlueskyAvatars(imagesDir, [...allHandles])
126+
console.log('load blog posts 1', avatarMap)
122127

123128
// Second pass: validate with raw schema, then enrich authors with avatars
124129
const posts: BlogPostFrontmatter[] = []

0 commit comments

Comments
 (0)