@fullstackdatasolutions/articles 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/nextjs.cjs +1 -1
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.js +1 -1
- package/dist/nextjs.js.map +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/server-articles.test.ts +4 -3
- package/src/server-articles.ts +1 -3
package/package.json
CHANGED
|
@@ -358,9 +358,10 @@ describe('getArticleMetadata - frontmatter parsing', () => {
|
|
|
358
358
|
})
|
|
359
359
|
expect(article).not.toBeNull()
|
|
360
360
|
expect(article!.authorSlug).toBe('andrew-blase')
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
)
|
|
361
|
+
// Relative, not absolute: authorAvatar is only ever rendered as an
|
|
362
|
+
// <img src>, never used for JSON-LD (which resolves its own absolute
|
|
363
|
+
// URL separately via getAuthorAvatar(author, config) at render time).
|
|
364
|
+
expect(article!.authorAvatar).toBe('/articles/authors/andrew-blase/avatar.jpg')
|
|
364
365
|
})
|
|
365
366
|
|
|
366
367
|
it('leaves authorSlug and authorAvatar unset when no config is passed', async () => {
|
package/src/server-articles.ts
CHANGED
|
@@ -296,9 +296,7 @@ async function getArticleSummary(slug: string, config?: ArticlesConfig): Promise
|
|
|
296
296
|
author,
|
|
297
297
|
authors,
|
|
298
298
|
authorSlug: primaryAuthorProfile?.slug,
|
|
299
|
-
authorAvatar: primaryAuthorProfile
|
|
300
|
-
? getAuthorAvatar(primaryAuthorProfile, config)
|
|
301
|
-
: undefined,
|
|
299
|
+
authorAvatar: primaryAuthorProfile ? getAuthorAvatar(primaryAuthorProfile) : undefined,
|
|
302
300
|
category: categories[0],
|
|
303
301
|
categories,
|
|
304
302
|
readTime,
|