diff --git a/public/index.html b/public/index.html index 725cd63f..5ca08a00 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,9 @@ - + + + diff --git a/public/static/manifest.json b/public/static/manifest.json new file mode 100644 index 00000000..582fdb1f --- /dev/null +++ b/public/static/manifest.json @@ -0,0 +1,14 @@ +{ + "name": "Saunatime", + "icons": [ + { + "src": "/static/webapp-icon-192x192.png", + "sizes": "192x192", + "type": "image/png" + } + ], + "start_url": "/", + "display": "standalone", + "theme_color": "#C0392B", + "background_color": "#FFFFFF" +} diff --git a/public/static/webapp-icon-192x192.png b/public/static/webapp-icon-192x192.png new file mode 100644 index 00000000..a0927879 Binary files /dev/null and b/public/static/webapp-icon-192x192.png differ diff --git a/src/app.test.js b/src/app.test.js index af70be51..749b4eda 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -34,8 +34,8 @@ describe('Application', () => { it('server renders pages that do not require authentication', () => { const urlTitles = { - '/': 'Book saunas everywhere', - '/s': 'Saunatime | search saunas everywhere', + '/': 'Book saunas everywhere | Saunatime', + '/s': 'Search results for map search | Saunatime', '/l/listing-title-slug/1234': 'Loading listing…', '/u/1234': 'Profile page with display name: 1234', '/login': 'Login', diff --git a/src/components/Page/Page.js b/src/components/Page/Page.js index 82a5e814..3c35371a 100644 --- a/src/components/Page/Page.js +++ b/src/components/Page/Page.js @@ -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'; @@ -48,6 +49,7 @@ class PageComponent extends Component { intl, logoutError, scrollingDisabled, + author, contentType, description, facebookImages, @@ -78,18 +80,20 @@ 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; const facebookImgs = facebookImages || [ - { name: 'facebook', url: facebookImage, width: 1200, height: 630 }, + { name: 'facebook', url: `${config.canonicalRootURL}${facebookImage}`, width: 1200, height: 630 }, ]; const twitterImgs = twitterImages || [ - { name: 'twitter', url: twitterImage, width: 600, height: 314 }, + { name: 'twitter', url: `${config.canonicalRootURL}${twitterImage}`, width: 600, height: 314 }, ]; const metaToHead = metaTagProps({ + author, contentType, description: metaDescription, facebookImages: facebookImgs, @@ -100,6 +104,7 @@ class PageComponent extends Component { twitterHandle, updated, url: canonicalURL(pathWithSearch), + locale: intl.locale, }); // eslint-disable-next-line react/no-array-index-key @@ -125,6 +130,8 @@ class PageComponent extends Component { >