Page.js improvements

This commit is contained in:
Vesa Luusua 2017-10-06 11:16:32 +03:00
parent dc1c13b7d4
commit e46294ec9a
2 changed files with 6 additions and 2 deletions

View file

@ -3,6 +3,7 @@ import Helmet from 'react-helmet';
import { withRouter } from 'react-router-dom';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
import classNames from 'classnames';
import config from '../../config';
import { canonicalURL, metaTagProps } from '../../util/seo';
import facebookImage from '../../assets/saunatimeFacebook-1200x630.jpg';
@ -79,7 +80,8 @@ class PageComponent extends Component {
const { pathname, search = '' } = history.location;
const pathWithSearch = `${pathname}${search}`;
const schemaTitle = intl.formatMessage({ id: 'Page.schemaTitle' });
const siteTitle = config.siteTitle;
const schemaTitle = intl.formatMessage({ id: 'Page.schemaTitle' }, { siteTitle });
const schemaDescription = intl.formatMessage({ id: 'Page.schemaDescription' });
const metaTitle = title || schemaTitle;
const metaDescription = description || schemaDescription;
@ -128,6 +130,8 @@ class PageComponent extends Component {
>
<title>{title}</title>
<link rel="canonical" href={canonicalURL(pathWithSearch)} />
<meta httpEquiv="Content-Type" content="text/html; charset=UTF-8" />
<meta httpEquiv="Content-Language" content={intl.locale} />
{metaTags}
<script type="application/ld+json">
{schemaJSONString}

View file

@ -253,7 +253,7 @@
"Page.authInfoFailed": "Could not get authentication information.",
"Page.logoutFailed": "Logout failed. Please try again.",
"Page.schemaDescription": "You can book a sauna from Saunatime or get some income by sharing your own sauna",
"Page.schemaTitle": "Book saunas everywhere",
"Page.schemaTitle": "Book saunas everywhere | {siteTitle}",
"PaginationLinks.next": "Next page",
"PaginationLinks.previous": "Previous page",
"PaginationLinks.toPage": "Go to page {page}",