Skip to content

Commit a551912

Browse files
committed
chore: check logs in og image
1 parent 6f82a1b commit a551912

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

app/components/OgImage/BlogPost.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script setup lang="ts">
22
import type { ResolvedAuthor } from '#shared/schemas/blog'
33
4+
console.log('blog post 1')
5+
46
const props = withDefaults(
57
defineProps<{
68
title: string
@@ -14,8 +16,10 @@ const props = withDefaults(
1416
primaryColor: '#60a5fa',
1517
},
1618
)
19+
console.log('blog post 2', props)
1720
1821
const formattedDate = computed(() => {
22+
console.log('blog post 3', props.date)
1923
if (!props.date) return ''
2024
try {
2125
return new Date(props.date).toLocaleDateString('en-US', {
@@ -24,6 +28,7 @@ const formattedDate = computed(() => {
2428
day: 'numeric',
2529
})
2630
} catch {
31+
console.log('blog post 4', props.date)
2732
return props.date
2833
}
2934
})
@@ -39,16 +44,19 @@ const getInitials = (name: string) =>
3944
.slice(0, 2)
4045
4146
const visibleAuthors = computed(() => {
47+
console.log('blog post 5', props.authors)
4248
if (props.authors.length <= 3) return props.authors
4349
return props.authors.slice(0, MAX_VISIBLE_AUTHORS)
4450
})
4551
4652
const extraCount = computed(() => {
53+
console.log('blog post 6', props.authors)
4754
if (props.authors.length <= 3) return 0
4855
return props.authors.length - MAX_VISIBLE_AUTHORS
4956
})
5057
5158
const formattedAuthorNames = computed(() => {
59+
console.log('blog post 7', props.authors)
5260
const allNames = props.authors.map(a => a.name)
5361
if (allNames.length === 0) return ''
5462
if (allNames.length === 1) return allNames[0]

app/components/global/BlogPostFederatedArticles.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const { resolvedAuthors } = useBlueskyAuthorProfiles(authors.value)
2222
// Merge the input data with the fetched avatars
2323
const federatedArticles = computed(() => {
2424
return props.articles.map((article, index) => {
25+
console.log('blog post federated articles 1')
2526
const profile = resolvedAuthors.value[index]
27+
console.log('blog post federated articles 2', profile)
2628
2729
return {
2830
url: article.url,

server/api/atproto/bluesky-author-profiles.get.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import * as app from '#shared/types/lexicons/app'
77

88
export default defineCachedEventHandler(
99
async event => {
10+
console.log('bluesky author profiles 1')
1011
const query = getQuery(event)
1112
const authorsParam = query.authors
13+
console.log('bluesky author profiles 2', authorsParam)
1214

1315
if (!authorsParam || typeof authorsParam !== 'string') {
16+
console.log('bluesky author profiles 3')
1417
throw createError({
1518
statusCode: 400,
1619
statusMessage: 'authors query parameter is required (JSON array)',
@@ -22,6 +25,7 @@ export default defineCachedEventHandler(
2225
const parsed = JSON.parse(authorsParam)
2326
authors = v.parse(v.array(AuthorSchema), parsed)
2427
} catch (error) {
28+
console.log('bluesky author profiles 4', error)
2529
if (error instanceof v.ValiError) {
2630
throw createError({
2731
statusCode: 400,
@@ -33,12 +37,14 @@ export default defineCachedEventHandler(
3337
statusMessage: 'authors must be valid JSON',
3438
})
3539
}
40+
console.log('bluesky author profiles 5', authors)
3641

3742
if (!Array.isArray(authors) || authors.length === 0) {
3843
return { authors: [] }
3944
}
4045

4146
const handles = authors.map(a => a.blueskyHandle).filter(v => v != null)
47+
console.log('bluesky author profiles 6', handles)
4248

4349
if (handles.length === 0) {
4450
return {
@@ -67,6 +73,7 @@ export default defineCachedEventHandler(
6773
: null,
6874
}),
6975
)
76+
console.log('bluesky author profiles 7', resolvedAuthors)
7077

7178
return { authors: resolvedAuthors }
7279
},

0 commit comments

Comments
 (0)