/** * 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'); // html head for each page class Head extends React.Component { render() { const links = this.props.config.headerLinks; const hasBlog = links.some(link => link.blog); const highlight = { version: '9.12.0', theme: 'default', ...this.props.config.highlight, }; // Use user-provided themeUrl if it exists, else construct one from version and theme. const highlightThemeURL = highlight.themeUrl ? highlight.themeUrl : `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${ highlight.version }/styles/${highlight.theme}.min.css`; // ensure the siteUrl variable ends with a single slash const siteUrl = `${( this.props.config.url + this.props.config.baseUrl ).replace(/\/+$/, '')}/`; return ( {this.props.title} {this.props.version && ( )} {this.props.language && ( )} {this.props.config.ogImage && ( )} {this.props.config.twitterImage && ( )} {this.props.config.noIndex && } {this.props.redirect && ( )} {this.props.config.manifest && ( )} {this.props.config.algolia && ( )} {hasBlog && ( )} {hasBlog && ( )} {this.props.config.gaTrackingId && this.props.config.gaGtag && (