From 57cddb4d0897e7d9a62305c6b2b8a04e824e0941 Mon Sep 17 00:00:00 2001 From: Amy Lam Date: Tue, 17 Apr 2018 23:15:27 -0700 Subject: [PATCH] Allow customizing of blog author image URL documentation (#577) * Rename authorImage to authorImageURL for clarity Update documentation * Fix typo * Add documentation for authorImageURL * Add support for authorImage We will remove support for authorImage in favor of authorImageURL, after we remove authorImage from react-native-website * Update guides-blog.md * Update guides-blog.md --- docs/guides-blog.md | 7 ++++--- lib/core/BlogPost.js | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/guides-blog.md b/docs/guides-blog.md index 4e6ff711b78a..50c589591b24 100644 --- a/docs/guides-blog.md +++ b/docs/guides-blog.md @@ -32,7 +32,7 @@ authorFBID: 503283835 title: Introducing Docusaurus --- -Lorem Ipusm.. +Lorem Ipsum... ``` @@ -41,8 +41,9 @@ Lorem Ipusm.. The only required field is `title`; however, we provide options to add author information to your blog post as well. - `author` - The text label of the author byline. -- `authorURL` - The url associated with the author. This could be a Twitter, GitHub, Facebook account, etc. -- `authorFBID` - The Facebook ID that is used to extract the profile picture. +- `authorURL` - The URL associated with the author. This could be a Twitter, GitHub, Facebook account, etc. +- `authorFBID` - The Facebook profile ID that is used to fetch the profile picture. +- `authorImageURL` - The URL to the author's image. (Note: If you use both `authorFBID` and `authorImageURL`, `authorFBID` will take precedence. Don't include `authorFBID` if you want `authorImageURL` to appear.) - `title` - The blog post title. diff --git a/lib/core/BlogPost.js b/lib/core/BlogPost.js index ce5c1a7fa149..7a8ba0764499 100644 --- a/lib/core/BlogPost.js +++ b/lib/core/BlogPost.js @@ -64,6 +64,14 @@ class BlogPost extends React.Component { ); + } else if (post.authorImageURL) { + return ( +
+ + + +
+ ); } else { return null; }