Skip to content

Commit edc3f5b

Browse files
Merge branch 'main' into feat/action-bar
2 parents 3f74834 + 03f7ecd commit edc3f5b

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

app/components/OgImage/BlogPost.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ const formattedAuthorNames = computed(() => {
110110
v-if="author.avatar"
111111
:src="author.avatar"
112112
:alt="author.name"
113+
width="48"
114+
height="48"
113115
class="w-full h-full object-cover"
114116
/>
115117
<span v-else style="font-size: 20px; color: #666; font-weight: 500">

modules/blog.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ async function fetchBlueskyAvatars(
5151
for (const profile of data.profiles) {
5252
if (profile.avatar) {
5353
const hash = crypto.createHash('sha256').update(profile.avatar).digest('hex')
54-
const dest = join(imagesDir, `${hash}.jpg`)
54+
const dest = join(imagesDir, `${hash}.png`)
5555

5656
if (!existsSync(dest)) {
57-
const res = await fetch(profile.avatar)
58-
await writeFile(join(imagesDir, `${hash}.jpg`), res.body!)
57+
const res = await fetch(`${profile.avatar}@png`)
58+
if (!res.ok || !res.body) {
59+
console.warn(`[blog] Failed to fetch Bluesky avatar: ${profile.avatar}@png`)
60+
continue
61+
}
62+
await writeFile(join(imagesDir, `${hash}.png`), res.body)
5963
}
6064

61-
avatarMap.set(profile.handle, `/blog/avatar/${hash}.jpg`)
65+
avatarMap.set(profile.handle, `/blog/avatar/${hash}.png`)
6266
}
6367
}
6468
} catch (error) {
@@ -85,7 +89,7 @@ function resolveAuthors(authors: Author[], avatarMap: Map<string, string>): Reso
8589
* Resolves Bluesky avatars at build time.
8690
*/
8791
async function loadBlogPosts(blogDir: string, imagesDir: string): Promise<BlogPostFrontmatter[]> {
88-
const files: string[] = globSync(join(blogDir, '*.md'))
92+
const files: string[] = globSync(join(blogDir, '*.md').replace(/\\/g, '/'))
8993

9094
// First pass: extract raw frontmatter and collect all Bluesky handles
9195
const rawPosts: Array<{ frontmatter: Record<string, unknown> }> = []

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"h3": "1.15.5",
147147
"h3-next": "npm:h3@2.0.1-rc.14",
148148
"knip": "5.85.0",
149-
"lint-staged": "16.3.1",
149+
"lint-staged": "16.3.2",
150150
"markdown-it-anchor": "9.2.0",
151151
"oxfmt": "0.36.0",
152152
"oxlint": "1.51.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)