mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
Add Prettier Formatting (#258)
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs * Remove trailing-comma as we are using Node 6 on Circle * Use latest Node 6 LTS version in Circle * Remove unused test
This commit is contained in:
parent
0cead4b6f9
commit
65421db62e
50 changed files with 1376 additions and 1350 deletions
|
@ -5,31 +5,44 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require("react");
|
||||
const BlogPost = require("./BlogPost.js");
|
||||
const BlogSidebar = require("./BlogSidebar.js");
|
||||
const Container = require("./Container.js");
|
||||
const Site = require("./Site.js");
|
||||
const React = require('react');
|
||||
const BlogPost = require('./BlogPost.js');
|
||||
const BlogSidebar = require('./BlogSidebar.js');
|
||||
const Container = require('./Container.js');
|
||||
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 fbLike = this.props.config.facebookAppId ? (
|
||||
<div
|
||||
className="fb-like"
|
||||
data-layout="standard"
|
||||
data-share="true"
|
||||
data-width="225"
|
||||
data-show-faces="false"
|
||||
/>
|
||||
) : 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;
|
||||
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;
|
||||
|
@ -51,15 +64,14 @@ class BlogPostLayout extends React.Component {
|
|||
return (
|
||||
<Site
|
||||
className="sideNavVisible"
|
||||
url={"blog/" + this.props.metadata.path}
|
||||
url={'blog/' + this.props.metadata.path}
|
||||
title={this.props.metadata.title}
|
||||
language={"en"}
|
||||
description={this.props.children.trim().split("\n")[0]}
|
||||
config={this.props.config}
|
||||
>
|
||||
language={'en'}
|
||||
description={this.props.children.trim().split('\n')[0]}
|
||||
config={this.props.config}>
|
||||
<div className="docMainWrapper wrapper">
|
||||
<BlogSidebar
|
||||
language={"en"}
|
||||
language={'en'}
|
||||
current={this.props.metadata}
|
||||
config={this.props.config}
|
||||
/>
|
||||
|
@ -68,16 +80,13 @@ class BlogPostLayout extends React.Component {
|
|||
<BlogPost
|
||||
post={this.props.metadata}
|
||||
content={this.props.children}
|
||||
language={"en"}
|
||||
language={'en'}
|
||||
config={this.props.config}
|
||||
/>
|
||||
{this.renderSocialButtons()}
|
||||
</div>
|
||||
<div className="blog-recent">
|
||||
<a
|
||||
className="button"
|
||||
href={this.props.config.baseUrl + "blog"}
|
||||
>
|
||||
<a className="button" href={this.props.config.baseUrl + 'blog'}>
|
||||
Recent Posts
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue