Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing of blog author image URL documentation #577

Merged
merged 6 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/guides-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ authorFBID: 503283835
title: Introducing Docusaurus
---

Lorem Ipusm..
Lorem Ipsum...
```


Expand All @@ -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.


Expand Down
8 changes: 8 additions & 0 deletions lib/core/BlogPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ class BlogPost extends React.Component {
</a>
</div>
);
} else if (post.authorImageURL) {
return (
<div className={className}>
<a href={post.authorURL} target="_blank" rel="noreferrer noopener">
<img src={post.authorImageURL} />
</a>
</div>
);
} else {
return null;
}
Expand Down