/** * 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'); const OnPageNav = require('./nav/OnPageNav.js'); const utils = require('./utils.js'); // used for entire blog posts, i.e., each written blog article with sidebar with site header/footer class BlogPostLayout extends React.Component { renderSocialButtons() { let post = this.props.metadata; post.path = utils.getPath(post.path, this.props.config.cleanUrl); const fbComment = this.props.config.facebookAppId && this.props.config.facebookComments && (
); const fbLike = this.props.config.facebookAppId && (
); const twitterShare = this.props.config.twitter && (
); return (
{twitterShare} {fbLike} {fbComment}
); } 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() { let post = this.props.metadata; post.path = utils.getPath(post.path, this.props.config.cleanUrl); return (
{this.renderSocialButtons()}
Recent Posts
{this.props.config.onPageNav == 'separate' && ( )}
); } } module.exports = BlogPostLayout;