replace react-document-title with react-helmet

This commit is contained in:
Vincent Taverna 2016-11-23 16:41:17 -05:00
parent 512a7d471d
commit d0ef44d107
6 changed files with 27 additions and 31 deletions

View File

@ -2,7 +2,6 @@ import React from 'react'
import moment from 'moment' import moment from 'moment'
import { RouteHandler, Link } from 'react-router' import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import DocumentTitle from 'react-document-title'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'
import SiteSidebar from '../SiteSidebar' import SiteSidebar from '../SiteSidebar'

View File

@ -1,7 +1,6 @@
import React from 'react' import React from 'react'
import moment from 'moment' import moment from 'moment'
import { RouteHandler, Link } from 'react-router' import { RouteHandler, Link } from 'react-router'
import DocumentTitle from 'react-document-title'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
const BUILD_TIME = new Date().getTime() const BUILD_TIME = new Date().getTime()
@ -11,7 +11,7 @@ module.exports = React.createClass({
}, },
render() { render() {
const {body, route} = this.props const {body, route} = this.props
const title = DocumentTitle.rewind() const title = Helmet.rewind()
const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' /> const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' />
let css let css
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {

View File

@ -34,14 +34,15 @@
"markdown-it": "^6.0.2", "markdown-it": "^6.0.2",
"moment": "^2.14.1", "moment": "^2.14.1",
"react": "^15.3.0", "react": "^15.3.0",
"react-document-title": "^2.0.2",
"react-dom": "^15.3.0", "react-dom": "^15.3.0",
"react-ga": "^2.1.2", "react-ga": "^2.1.2",
"react-helmet": "^3.2.2",
"react-router": "^2.6.1", "react-router": "^2.6.1",
"safe-access": "^0.1.0", "safe-access": "^0.1.0",
"underscore.string": "^3.2.3" "underscore.string": "^3.2.3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.3.7",
"babel-core": "^6.11.4", "babel-core": "^6.11.4",
"babel-loader": "^6.2.4", "babel-loader": "^6.2.4",
"babel-preset-react-hmre": "^1.1.1", "babel-preset-react-hmre": "^1.1.1",
@ -51,18 +52,17 @@
"eslint-plugin-import": "^1.12.0", "eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1", "eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0", "eslint-plugin-react": "^6.0.0",
"file-loader": "^0.9.0",
"gh-pages": "^0.11.0", "gh-pages": "^0.11.0",
"image-webpack-loader": "^2.0.0", "image-webpack-loader": "^2.0.0",
"lost": "^7.0.3",
"null-loader": "^0.1.1", "null-loader": "^0.1.1",
"postcss-loader": "^0.9.1", "postcss-loader": "^0.9.1",
"react-transform-catch-errors": "^1.0.2", "react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4", "react-transform-hmr": "^1.0.4",
"redbox-react": "^1.2.10", "redbox-react": "^1.2.10",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"autoprefixer": "^6.3.7",
"file-loader": "^0.9.0",
"rucksack-css": "^0.8.5", "rucksack-css": "^0.8.5",
"lost": "^7.0.3" "style-loader": "^0.13.1",
"webpack": "^1.13.1"
} }
} }

View File

@ -2,7 +2,7 @@ import React from 'react'
import { Link } from 'react-router' import { Link } from 'react-router'
import sortBy from 'lodash/sortBy' import sortBy from 'lodash/sortBy'
import moment from 'moment' import moment from 'moment'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'
@ -39,19 +39,18 @@ class SiteIndex extends React.Component {
}) })
return ( return (
<DocumentTitle title={ config.siteTitle }> <div>
<div> <Helmet title={ config.siteTitle }/>
<SiteSidebar {...this.props}/> <SiteSidebar {...this.props}/>
<div className='content'> <div className='content'>
<div className='main'> <div className='main'>
<div className='main-inner'> <div className='main-inner'>
{ pageLinks } { pageLinks }
</div>
</div> </div>
</div> </div>
</div> </div>
</DocumentTitle> </div>
) )
} }
} }

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import SitePost from '../components/SitePost' import SitePost from '../components/SitePost'
import SitePage from '../components/SitePage' import SitePage from '../components/SitePage'
import { config } from 'config' import { config } from 'config'
@ -19,11 +19,10 @@ class MarkdownWrapper extends React.Component {
} }
return ( return (
<DocumentTitle title={ `${post.title} - ${config.siteTitle}` }> <div>
<div> <Helmet title={ `${post.title} - ${config.siteTitle}` }/>
{ template } { template }
</div> </div>
</DocumentTitle>
); );
} }
} }