/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Site */ var React = require('React'); var HeaderLinks = require('HeaderLinks'); var Metadata = require('Metadata'); var Site = React.createClass({ render: function() { const path = Metadata.config.RN_DEPLOYMENT_PATH; const version = Metadata.config.RN_VERSION; const algoliaVersion = version === 'next' ? 'master' : version; var basePath = '/react-native/' + (path ? path + '/' : ''); var currentYear = (new Date()).getFullYear(); var title = this.props.title ? this.props.title : 'React Native | A framework for building native apps using React'; var metaTags = [ { charSet: "utf-8" }, { httpEquiv: "X-UA-Compatible", content: "IE=edge,chrome=1", }, { name: "viewport", content: "width=device-width", }, // Facebook { property: "fb:app_id", content: "1677033832619985", }, { property: "fb:admins", content: "121800083", }, // Open Graph { property: "og:site_name", content: "React Native", }, { property: "og:title", content: title, }, { property: "og:url", content: "https://facebook.github.io/react-native/" + (this.props.path ? this.props.path : "index.html"), }, { property: "og:image", content: this.props.image ? this.props.image : "https://facebook.github.io/react-native/img/opengraph.png", }, { property: "og:description", content: this.props.description ? this.props.description : "A framework for building native apps using React", }, // Twitter Cards { name: "twitter:site", content: "@reactnative", }, { name: "twitter:card", content: "summary_large_image", }, ]; var typeTags = [{ property: "og:type", content: "website", }]; if (this.props.author) { typeTags = [{ property: "og:type", content: "article", }, { property: "article:author", content: this.props.author, }]; } metaTags.push(...typeTags); if (this.props.authorTwitter) { metaTags.push({ name: "twitter:creator", content: "@" + this.props.authorTwitter, }); } return ( {title} { metaTags.map((tag, index) => ) }