/** * Copyright (c) 2017-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * 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'); // 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 ? (
) : null; const twitterShare = this.props.config.twitter ? ( Tweet ) : null; if (!fbLike && !twitterShare) { return; } return (
); } getDescription() { var descLines = this.props.children.trim().split('\n'); for (var i = 0; i < descLines.length; i++) { // Don't want blank lines or descriptions that are raw image rendering strings if (descLines[i] && !descLines[i].startsWith('![')) { return descLines[i]; } } return null; } render() { return (
{this.renderSocialButtons()}
); } } module.exports = BlogPostLayout;