Use siteTitle variable instead of hardcoding the title

On today's talk in BADCamp, Kyle tried to modify the title in the configuration, but it was hardcoded :-p
This commit is contained in:
Joaquin Bravo Contreras 2018-10-26 14:52:22 -07:00
parent 2670ccbbd5
commit db9c9062e8
3 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import { rhythm, scale } from '../utils/typography'
class Template extends React.Component { class Template extends React.Component {
render() { render() {
const { location, children } = this.props const { location, title, children } = this.props
const rootPath = `${__PATH_PREFIX__}/` const rootPath = `${__PATH_PREFIX__}/`
let header let header
@ -26,7 +26,7 @@ class Template extends React.Component {
}} }}
to={'/'} to={'/'}
> >
Gatsby Starter Blog {title}
</Link> </Link>
</h1> </h1>
) )
@ -47,7 +47,7 @@ class Template extends React.Component {
}} }}
to={'/'} to={'/'}
> >
Gatsby Starter Blog {title}
</Link> </Link>
</h3> </h3>
) )

View file

@ -17,7 +17,7 @@ class BlogIndex extends React.Component {
const posts = get(this, 'props.data.allMarkdownRemark.edges') const posts = get(this, 'props.data.allMarkdownRemark.edges')
return ( return (
<Layout location={this.props.location}> <Layout location={this.props.location} title={siteTitle}>
<Helmet <Helmet
htmlAttributes={{ lang: 'en' }} htmlAttributes={{ lang: 'en' }}
meta={[{ name: 'description', content: siteDescription }]} meta={[{ name: 'description', content: siteDescription }]}

View file

@ -15,7 +15,7 @@ class BlogPostTemplate extends React.Component {
const { previous, next } = this.props.pageContext const { previous, next } = this.props.pageContext
return ( return (
<Layout location={this.props.location}> <Layout location={this.props.location} title={siteTitle}>
<Helmet <Helmet
htmlAttributes={{ lang: 'en' }} htmlAttributes={{ lang: 'en' }}
meta={[{ name: 'description', content: siteDescription }]} meta={[{ name: 'description', content: siteDescription }]}