mirror of
https://github.com/status-im/react-native.git
synced 2025-02-06 06:34:01 +00:00
777a9c0a0e
Summary: Updated the blog's styling to make it more readable. * BlogPageLayout (blog index) - Only excerpts from each article are now shown, as opposed to the entire article. * BlogPost - Broken up into headers, footers. Reorder header so that the blog post title is closer to the content. Adds support for hero images (visible from the blog index). Adds Facebook, Twitter social share buttons. List items are properly spaced now. Blog index: ![screencapture-localhost-8079-react-native-blog-1471905976431](https://cloud.githubusercontent.com/assets/165856/17874405/4ee4fc22-6880-11e6-8344-2ed823f6000e.png) Single blog post: ![screencapture-localhost-8079-react-native-blog-2016-08-12-react-native-meetup-san-francisco-html-1471905997923](https://cloud.githubusercontent.com/assets/165856/17874407/52af9e7a-6880-11e6-99f0-91f90331aced.png) Closes https://github.com/facebook/react-native/pull/9532 Differential Revision: D3758524 Pulled By: bestander fbshipit-source-id: 6385a3e98a3a44343c3b1d3105a32023b748c2c6
101 lines
4.8 KiB
JavaScript
101 lines
4.8 KiB
JavaScript
/**
|
||
* 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 title = this.props.title ? this.props.title + ' – ' : '';
|
||
var currentYear = (new Date()).getFullYear();
|
||
title += 'React Native | A framework for building native apps using React';
|
||
return (
|
||
<html>
|
||
<head>
|
||
<meta charSet="utf-8" />
|
||
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||
<title>{title}</title>
|
||
<meta name="viewport" content="width=device-width" />
|
||
<meta property="og:title" content={title} />
|
||
<meta property="og:type" content="website" />
|
||
<meta property="og:url" content="http://facebook.github.io/react-native/index.html" />
|
||
<meta property="og:image" content="http://facebook.github.io/react-native/img/opengraph.png?2" />
|
||
<meta property="og:description" content="A framework for building native apps using React" />
|
||
|
||
<base href={basePath} />
|
||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
|
||
|
||
<link rel="shortcut icon" href="img/favicon.png?2" />
|
||
<link rel="stylesheet" href="css/react-native.css" />
|
||
|
||
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
|
||
<script type="text/javascript">{'try{Typekit.load();}catch(e){}'}</script>
|
||
</head>
|
||
<body>
|
||
<script dangerouslySetInnerHTML={{__html: `window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));`}} />
|
||
<script dangerouslySetInnerHTML={{__html: `window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, "script", "twitter-wjs"));`}} />
|
||
<div className="container">
|
||
<div className="nav-main">
|
||
<div className="wrap">
|
||
<a className="nav-home" href="">
|
||
<img src="img/header_logo.png" />
|
||
React Native
|
||
</a>
|
||
<a className="nav-version" href="/react-native/versions.html">
|
||
{version}
|
||
</a>
|
||
<HeaderLinks section={this.props.section} />
|
||
</div>
|
||
</div>
|
||
|
||
{this.props.children}
|
||
|
||
<footer className="wrap">
|
||
<div className="center">© {currentYear} Facebook Inc.</div>
|
||
</footer>
|
||
</div>
|
||
|
||
<div id="fb-root" />
|
||
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
|
||
<script dangerouslySetInnerHTML={{__html: `
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
ga('create', 'UA-41298772-2', 'facebook.github.io');
|
||
ga('send', 'pageview');
|
||
|
||
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)
|
||
){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";
|
||
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||
|
||
docsearch({
|
||
apiKey: '2c98749b4a1e588efec53b2acec13025',
|
||
indexName: 'react-native-versions',
|
||
inputSelector: '#algolia-doc-search',
|
||
algoliaOptions: { facetFilters: [ "tags:${algoliaVersion}" ], hitsPerPage: 5 }
|
||
});
|
||
`}} />
|
||
<script src="js/scripts.js" />
|
||
</body>
|
||
</html>
|
||
);
|
||
}
|
||
});
|
||
|
||
module.exports = Site;
|