mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
Blog enhancements (#80)
* Small CSS adjustments. * Blog adjustments. * Add support for Prism in the blog
This commit is contained in:
parent
a484893c4f
commit
45f6ef8fd9
7 changed files with 80 additions and 2 deletions
|
@ -15,6 +15,40 @@ const Site = require("./Site.js");
|
|||
|
||||
// used for entire blog posts, i.e., each written blog article with sidebar with site header/footer
|
||||
class BlogPostLayout extends React.Component {
|
||||
|
||||
renderSocialButtons() {
|
||||
const post = this.props.metadata;
|
||||
|
||||
const fbLike = this.props.config.facebookAppId ?
|
||||
<div
|
||||
className="fb-like"
|
||||
data-layout="standard"
|
||||
data-share="true"
|
||||
data-width="225"
|
||||
data-show-faces="false">
|
||||
</div>
|
||||
: null;
|
||||
|
||||
const twitterShare = this.props.config.twitter ?
|
||||
<a href="https://twitter.com/share" className="twitter-share-button" data-text={post.title} data-url={this.props.config.url + this.props.config.baseUrl + "blog/" + post.path} data-related={this.props.config.twitter} data-via={post.authorTwitter} data-show-count="false">Tweet</a>
|
||||
: null;
|
||||
|
||||
if (!fbLike && !twitterShare) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<aside className="entry-share">
|
||||
<div className="social-buttons">
|
||||
{fbLike}
|
||||
{twitterShare}
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Site
|
||||
|
@ -39,6 +73,7 @@ class BlogPostLayout extends React.Component {
|
|||
language={"en"}
|
||||
config={this.props.config}
|
||||
/>
|
||||
{this.renderSocialButtons()}
|
||||
</div>
|
||||
<div className="blog-recent">
|
||||
<a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue