@@ -6,7 +6,7 @@ import {Feed} from 'feed';
6
6
import graphql from 'babel-plugin-relay/macro' ;
7
7
import { createEnvironment } from './Environment' ;
8
8
import { fetchQuery } from 'react-relay/hooks' ;
9
- import { computePostDate , postPath } from './Post' ;
9
+ import { postBackmatter , computePostDate , postPath } from './Post' ;
10
10
import { RssMarkdownRenderer } from './MarkdownRenderer' ;
11
11
import { ServerStyleSheet } from 'styled-components' ;
12
12
import inlineCss from 'inline-css/lib/inline-css' ;
@@ -68,6 +68,13 @@ function removeTrailingSlash(s: ?string): string {
68
68
return s ;
69
69
}
70
70
71
+ function postDate ( post ) {
72
+ return computePostDate ( {
73
+ backmatter : postBackmatter ( post ) ,
74
+ createdAt : post . createdAt ,
75
+ } ) ;
76
+ }
77
+
71
78
export async function buildFeed ( {
72
79
basePath,
73
80
siteHostname,
@@ -96,13 +103,13 @@ export async function buildFeed({
96
103
97
104
const feed = new Feed ( {
98
105
title : config . title ,
99
- description : config . description ,
106
+ description : config . description || '' ,
100
107
id : baseUrl ,
101
108
link : baseUrl ,
102
109
language : 'en' ,
103
110
image : `${ baseUrl } /logo.png` ,
104
111
favicon : `${ baseUrl } /favicon.ico` ,
105
- updated : latestPost ? computePostDate ( latestPost ) : null ,
112
+ updated : latestPost ? postDate ( latestPost ) : null ,
106
113
generator : '' ,
107
114
feedLinks : {
108
115
json : `${ baseUrl } /feed.json` ,
@@ -127,7 +134,7 @@ export async function buildFeed({
127
134
}
128
135
: null ,
129
136
) ,
130
- date : computePostDate ( post ) ,
137
+ date : postDate ( post ) ,
131
138
} ) ;
132
139
}
133
140
}
0 commit comments