set title on pages
This commit is contained in:
parent
064177fbf7
commit
9b14fc82be
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import hljs from 'highlight.js';
|
|||
import React, { Component } from 'react';
|
||||
import Markdown from 'react-markdown';
|
||||
|
||||
import config from './config';
|
||||
import { NotFound } from './NotFound';
|
||||
import { slugify } from './util';
|
||||
|
||||
|
|
@ -51,6 +52,10 @@ class Page extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.title = config.title;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props) {
|
||||
this.params = props.match.params;
|
||||
this.fetchPage();
|
||||
|
|
@ -62,6 +67,7 @@ class Page extends Component {
|
|||
}
|
||||
|
||||
if (this.state.page) {
|
||||
document.title = `${config.title} - ${this.state.page.title}`;
|
||||
return (
|
||||
<article>
|
||||
<header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue