feat: allow blog authors email (#6783)

This commit is contained in:
Joshua Chen 2022-03-02 23:28:17 +08:00 committed by GitHub
parent 7ec44bb32c
commit 6cbc58943e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 53 additions and 15 deletions

View file

@ -11,7 +11,8 @@
"title": "Docusaurus maintainer",
"url": "https://sebastienlorber.com",
"image_url": "https://github.com/slorber.png",
"twitter": "sebastienlorber"
"twitter": "sebastienlorber",
"email": "lorber.sebastien@gmail.com"
},
"yangshun": {
"name": "Yangshun Tay",

View file

@ -12,6 +12,7 @@ slorber:
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
twitter: sebastienlorber
email: lorber.sebastien@gmail.com
yangshun:
name: Yangshun Tay

View file

@ -1,4 +1,5 @@
slorber:
name: Sébastien Lorber
title: Docusaurus maintainer
email: lorber.sebastien@gmail.com
url: https://sebastienlorber.com

View file

@ -1,5 +1,4 @@
slorber:
name: Sébastien Lorber (translated)
title: Docusaurus maintainer (translated)
email: lorber.sebastien@gmail.com

View file

@ -77,6 +77,7 @@ Array [
</author>
<author>
<name>Sébastien Lorber (translated)</name>
<email>lorber.sebastien@gmail.com</email>
</author>
</entry>
</feed>",
@ -238,6 +239,7 @@ Array [
<pubDate>Fri, 14 Dec 2018 00:00:00 GMT</pubDate>
<description><![CDATA[Happy birthday! (translated)]]></description>
<content:encoded><![CDATA[<p>Happy birthday!</p>]]></content:encoded>
<author>lorber.sebastien@gmail.com (Sébastien Lorber (translated))</author>
</item>
</channel>
</rss>",

View file

@ -177,6 +177,7 @@ describe('loadBlog', () => {
name: 'Yangshun Tay (translated)',
},
{
email: 'lorber.sebastien@gmail.com',
key: 'slorber',
name: 'Sébastien Lorber (translated)',
title: 'Docusaurus maintainer (translated)',

View file

@ -24,6 +24,7 @@ const AuthorsMapSchema = Joi.object<AuthorsMap>().pattern(
url: URISchema,
imageURL: URISchema,
title: Joi.string(),
email: Joi.string(),
})
.rename('image_url', 'imageURL')
.or('name', 'imageURL')

View file

@ -57,9 +57,7 @@ async function generateBlogFeed({
});
function toFeedAuthor(author: Author): FeedAuthor {
// TODO ask author emails?
// RSS feed requires email to render authors
return {name: author.name, link: author.url};
return {name: author.name, link: author.url, email: author.email};
}
await mapAsyncSequential(blogPosts, async (post) => {

View file

@ -21,6 +21,7 @@ declare module '@docusaurus/plugin-content-blog' {
imageURL?: string;
url?: string;
title?: string;
email?: string;
}
export type BlogPostFrontMatter = {