/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ const classNames = require('classnames'); 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 { getDescription() { const descLines = this.props.children.trim().split('\n'); for (let 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; } renderSocialButtons() { const post = this.props.metadata; post.path = utils.getPath(post.path, this.props.config.cleanUrl); const fbComment = this.props.config.facebookAppId && this.props.config.facebookComments && (