Skip to content

Commit ccb8dd8

Browse files
authored
fix: include actual name in blog (#6959)
1 parent 752f28f commit ccb8dd8

File tree

1 file changed

+9
-2
lines changed
  • packages/web/docs/src/app/blog/feed.xml

1 file changed

+9
-2
lines changed

packages/web/docs/src/app/blog/feed.xml/route.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
22
import RSS from 'rss';
33
import { getPageMap } from '@theguild/components/server';
4+
import { AuthorId, authors } from '../../../authors';
45
import { isBlogPost } from '../blog-types';
56

7+
function getAuthor(name: string) {
8+
const author = authors[name as AuthorId]?.name;
9+
return author ?? name;
10+
}
11+
612
export async function GET() {
713
const [_meta, _indexPage, ...pageMap] = await getPageMap('/blog');
814
const allPosts = pageMap
@@ -14,10 +20,11 @@ export async function GET() {
1420
date: new Date(item.frontMatter.date),
1521
url: `https://the-guild.dev/graphql/hive${item.route}`,
1622
description: (item.frontMatter as any).description ?? '',
17-
author:
23+
author: getAuthor(
1824
typeof item.frontMatter.authors === 'string'
1925
? item.frontMatter.authors
20-
: item.frontMatter.authors.at(0),
26+
: item.frontMatter.authors.at(0)!,
27+
),
2128
categories: Array.isArray(item.frontMatter.tags)
2229
? item.frontMatter.tags
2330
: [item.frontMatter.tags],

0 commit comments

Comments
 (0)