Add dynamic page title
Currently all the pages have the same title, making it hard to tell which page is while when user has multiple tabs opened. This adds 'title' to Site so a page title can be passed in and prepended to the default title
This commit is contained in:
parent
bc56eb1439
commit
129d1548a8
|
@ -14,14 +14,16 @@ var HeaderLinks = require('HeaderLinks');
|
|||
|
||||
var Site = React.createClass({
|
||||
render: function() {
|
||||
var title = this.props.title ? this.props.title + ' – ' : '';
|
||||
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>React Native | A framework for building native apps using React</title>
|
||||
<title>{title}</title>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta property="og:title" content="React Native | A framework for building native apps using React" />
|
||||
<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" />
|
||||
|
|
|
@ -338,7 +338,7 @@ var Autodocs = React.createClass({
|
|||
<APIDoc content={docs} />;
|
||||
|
||||
return (
|
||||
<Site section="docs">
|
||||
<Site section="docs" title={metadata.title}>
|
||||
<section className="content wrap documentationContent">
|
||||
<DocsSidebar metadata={metadata} />
|
||||
<div className="inner-content">
|
||||
|
|
|
@ -18,7 +18,7 @@ var DocsLayout = React.createClass({
|
|||
var metadata = this.props.metadata;
|
||||
var content = this.props.children;
|
||||
return (
|
||||
<Site section="docs">
|
||||
<Site section="docs" title={metadata.title}>
|
||||
<section className="content wrap documentationContent">
|
||||
<DocsSidebar metadata={metadata} />
|
||||
<div className="inner-content">
|
||||
|
|
|
@ -18,7 +18,7 @@ var support = React.createClass({
|
|||
var metadata = this.props.metadata;
|
||||
var content = this.props.children;
|
||||
return (
|
||||
<Site section={metadata.section}>
|
||||
<Site section={metadata.section} title={metadata.title}>
|
||||
<section className="content wrap documentationContent nosidebar">
|
||||
<div className="inner-content">
|
||||
<Marked>{content}</Marked>
|
||||
|
|
|
@ -15,7 +15,7 @@ var H2 = require('H2');
|
|||
var support = React.createClass({
|
||||
render: function() {
|
||||
return (
|
||||
<Site section="support">
|
||||
<Site section="support" title="Support">
|
||||
|
||||
<section className="content wrap documentationContent nosidebar">
|
||||
<div className="inner-content">
|
||||
|
|
Loading…
Reference in New Issue