File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/web/docs/src/app/blog/feed.xml Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
// eslint-disable-next-line import/no-extraneous-dependencies
2
2
import RSS from 'rss' ;
3
3
import { getPageMap } from '@theguild/components/server' ;
4
+ import { AuthorId , authors } from '../../../authors' ;
4
5
import { isBlogPost } from '../blog-types' ;
5
6
7
+ function getAuthor ( name : string ) {
8
+ const author = authors [ name as AuthorId ] ?. name ;
9
+ return author ?? name ;
10
+ }
11
+
6
12
export async function GET ( ) {
7
13
const [ _meta , _indexPage , ...pageMap ] = await getPageMap ( '/blog' ) ;
8
14
const allPosts = pageMap
@@ -14,10 +20,11 @@ export async function GET() {
14
20
date : new Date ( item . frontMatter . date ) ,
15
21
url : `https://the-guild.dev/graphql/hive${ item . route } ` ,
16
22
description : ( item . frontMatter as any ) . description ?? '' ,
17
- author :
23
+ author : getAuthor (
18
24
typeof item . frontMatter . authors === 'string'
19
25
? item . frontMatter . authors
20
- : item . frontMatter . authors . at ( 0 ) ,
26
+ : item . frontMatter . authors . at ( 0 ) ! ,
27
+ ) ,
21
28
categories : Array . isArray ( item . frontMatter . tags )
22
29
? item . frontMatter . tags
23
30
: [ item . frontMatter . tags ] ,
You can’t perform that action at this time.
0 commit comments